Smart Remote 3 nRF52 v1.2
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Android TV Voice Service (ATVV)

Android TV Voice Service implementation. More...

Modules

 Bytes per audio frame
 
 Command message values
 
 Control message values
 
 Error codes
 
 Profile version
 
 Supported audio codec and rate combinations
 
 Timeout values [millisecond]
 
 Transmit Characteristic size
 
 Used audio codec
 

Data Structures

struct  ble_atvv_evt_get_caps_t
 ATVV Service BLE_ATVV_EVT_GET_CAPS event data. More...
 
struct  ble_atvv_evt_mic_open_t
 ATVV Service BLE_ATVV_EVT_MIC_OPEN event data. More...
 
struct  ble_atvv_evt_t
 ATVV Service event structure. More...
 
struct  ble_atvv_s
 ATVV Service structure. More...
 

Macros

#define BLE_ATVV_DEF(_name)
 Macro for defining a ble_atvv instance. More...
 
#define BLE_ATVV_MAX_DATA_LEN   (BLE_GATT_MTU_SIZE_DEFAULT - OPCODE_LENGTH - HANDLE_LENGTH)
 Maximum length of data (in bytes) that can be transmitted to the peer by the ATVV Service module.
 
#define BLE_UUID_ATV_BASE
 
#define BLE_UUID_ATV_CTL_CHARACTERISTIC   0x0004
 
#define BLE_UUID_ATV_RX_CHARACTERISTIC   0x0003
 
#define BLE_UUID_ATV_SERVICE   0x0001
 
#define BLE_UUID_ATV_TX_CHARACTERISTIC   0x0002
 

Typedefs

typedef void(* ble_atvv_evt_handler_t )(ble_atvv_evt_t const *p_evt)
 ATVV Service event handler type.
 

Enumerations

enum  ble_atvv_ctl_type_t {
  BLE_ATVV_CTL_AUDIO_STOP = ATVV_CTL_AUDIO_STOP, BLE_ATVV_CTL_AUDIO_START = ATVV_CTL_AUDIO_START, BLE_ATVV_CTL_START_SEARCH = ATVV_CTL_START_SEARCH, BLE_ATVV_CTL_AUDIO_SYNC = ATVV_CTL_AUDIO_SYNC,
  BLE_ATVV_CTL_GET_CAPS_RESP = ATVV_CTL_GET_CAPS_RESP, BLE_ATVV_CTL_MIC_OPEN_ERROR = ATVV_CTL_MIC_OPEN_ERROR
}
 ATVV Service control message types. More...
 
enum  ble_atvv_error_code_t
 Error codes.
 
enum  ble_atvv_evt_type_t {
  BLE_ATVV_EVT_ENABLED, BLE_ATVV_EVT_DISABLED, BLE_ATVV_EVT_MIC_OPEN, BLE_ATVV_EVT_MIC_CLOSE,
  BLE_ATVV_EVT_GET_CAPS
}
 ATVV Service event types. More...
 
enum  ble_atvv_frame_size_t
 Frame size.
 
enum  ble_atvv_rx_char_size_t
 Transmit characteristic size.
 
enum  ble_atvv_supported_codecs_t
 Supported codecs.
 
enum  ble_atvv_used_codec_t
 Used codec.
 

Functions

ret_code_t ble_atvv_ctl_send (ble_atvv_t const *p_atvv, uint16_t conn_handle, ble_atvv_ctl_type_t type, void *p_param)
 Function for sending control and error messages to the peer. More...
 
ret_code_t ble_atvv_frame_data_transmit (ble_atvv_t const *p_atvv, uint8_t const *p_frame_data, uint16_t len, uint16_t conn_handle)
 Function for transmitting frame data. More...
 
ret_code_t ble_atvv_init (ble_atvv_t *p_atvv, ble_atvv_evt_handler_t p_evt_handler)
 Function for initializing the ATVV Service. More...
 
void ble_atvv_on_ble_evt (ble_evt_t const *p_ble_evt, void *p_context)
 Function for handling BLE events of the ATVV Service. More...
 

Detailed Description

Android TV Voice Service implementation.

Note
The application must register this module as a BLE event observer using the NRF_SDH_BLE_OBSERVER macro. Example:
ble_atvv_t instance;
NRF_SDH_BLE_OBSERVER(anything, BLE_ATVV_BLE_OBSERVER_PRIO,
ble_atvv_on_ble_evt, &instance);

Macro Definition Documentation

#define BLE_ATVV_DEF (   _name)

Macro for defining a ble_atvv instance.

Parameters
_nameName of the instance.
#define BLE_UUID_ATV_BASE
Value:
{{0x64, 0xB6, 0x17, 0xF6, \
0x01, 0xAF, 0x7D, 0xBC, \
0x05, 0x4F, 0x21, 0x5A, \
0x00, 0x00, 0x5E, 0xAB}}

Used vendor-specific UUID.

#define BLE_UUID_ATV_CTL_CHARACTERISTIC   0x0004

16-bit UUID of the CTL Characteristic.

#define BLE_UUID_ATV_RX_CHARACTERISTIC   0x0003

16-bit UUID of the RX Characteristic.

#define BLE_UUID_ATV_SERVICE   0x0001

16-bit UUID of the ATVV Service.

#define BLE_UUID_ATV_TX_CHARACTERISTIC   0x0002

16-bit UUID of the TX Characteristic.

Enumeration Type Documentation

ATVV Service control message types.

Enumerator
BLE_ATVV_CTL_AUDIO_STOP 

End of an audio message.

BLE_ATVV_CTL_AUDIO_START 

Beginning of an audio message.

BLE_ATVV_CTL_START_SEARCH 

Start a voice search message.

BLE_ATVV_CTL_AUDIO_SYNC 

Frame count sync message.

BLE_ATVV_CTL_GET_CAPS_RESP 

Reply to "get caps" command.

BLE_ATVV_CTL_MIC_OPEN_ERROR 

Error when opening the mic.

ATVV Service event types.

Enumerator
BLE_ATVV_EVT_ENABLED 

Service enabled (CCCDs written).

BLE_ATVV_EVT_DISABLED 

Service disabled (CCCDs written, or disconnect).

BLE_ATVV_EVT_MIC_OPEN 

Open mic command received.

BLE_ATVV_EVT_MIC_CLOSE 

Close mic command received.

BLE_ATVV_EVT_GET_CAPS 

Get capability command received. Respond with ble_atvv_ctl_send.

Function Documentation

ret_code_t ble_atvv_ctl_send ( ble_atvv_t const *  p_atvv,
uint16_t  conn_handle,
ble_atvv_ctl_type_t  type,
void *  p_param 
)

Function for sending control and error messages to the peer.

Note
"Get caps resp" message is automatically filled, based on parameters given in ble_atvv_init.
Parameters
[in]p_atvvATVV Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance.
[in]typeControl message type.
[in]conn_handleConnection handle to use for message transmission.
[in]p_paramDepends on the type parameter: "uint16_t frame_count" for BLE_ATVV_CTL_AUDIO_SYNC "ble_atvv_error_code_t error" for BLE_ATVV_CTL_MIC_OPEN_ERROR Otherwise, this parameter is ignored.
Returns
NRF_SUCCESS If the control message was successfully sent.
ret_code_t ble_atvv_frame_data_transmit ( ble_atvv_t const *  p_atvv,
uint8_t const *  p_frame_data,
uint16_t  len,
uint16_t  conn_handle 
)

Function for transmitting frame data.

Note
This function does not perform frame buffering. Frame data size must conform to maximum bytes/characteristic parameter.
Parameters
[out]p_atvvATVV Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance.
[in]p_frame_dataFrame data to transmit.
[in]lenLength of frame data.
[in]conn_handleConnection handle to use for message transmission.
Returns
NRF_SUCCESS If the frame data was successfully sent.
ret_code_t ble_atvv_init ( ble_atvv_t p_atvv,
ble_atvv_evt_handler_t  p_evt_handler 
)

Function for initializing the ATVV Service.

Parameters
[out]p_atvvATVV Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance.
[in]p_evt_handlerEvent handler callback.
Returns
NRF_SUCCESS If the service was successfully initialized. Otherwise, an error code is returned.
void ble_atvv_on_ble_evt ( ble_evt_t const *  p_ble_evt,
void *  p_context 
)

Function for handling BLE events of the ATVV Service.

Parameters
[in]p_ble_evtEvent received from the SoftDevice.
[in]p_contextATVV Service structure.

Documentation feedback | Developer Zone | Subscribe | Updated