Infineon Logo AIROC BTSDK v4.7 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Synchronous Connection Oriented (SCO) Channel

SCO Definitions and Functions. More...

Data Structures

struct  wiced_bt_sco_params_t
 
struct  wiced_bt_voice_path_setup_t
 

Macros

#define WICED_BT_SCO_CONNECTION_ACCEPT   0x00
 
#define WICED_BT_SCO_CONNECTION_REJECT_RESOURCES   0x0D
 
#define WICED_BT_SCO_CONNECTION_REJECT_SECURITY   0x0E
 
#define WICED_BT_SCO_CONNECTION_REJECT_DEVICE   0x0F
 
#define WICED_INVALID_SCO_INDEX   0xFFFF
 
#define WICED_SCO_LINK_ALL_PKT_MASK   0x003F
 
#define WICED_SCO_LINK_ONLY_MASK   0x0007
 
#define WICED_SCO_PKT_TYPES_MASK_HV3   0x0004
 
#define WICED_SCO_PKT_TYPES_MASK_EV3   0x0008
 
#define WICED_SCO_PKT_TYPES_MASK_EV4   0x0010
 
#define WICED_SCO_PKT_TYPES_MASK_EV5   0x0020
 
#define WICED_SCO_PKT_TYPES_MASK_NO_2_EV3   0x0040
 
#define WICED_SCO_PKT_TYPES_MASK_NO_3_EV3   0x0080
 
#define WICED_SCO_PKT_TYPES_MASK_NO_2_EV5   0x0100
 
#define WICED_SCO_PKT_TYPES_MASK_NO_3_EV5   0x0200
 
#define WICED_BT_SCO_DATA_CB_GET_LENGTH(ltch_len)   ((ltch_len>>8)&0xff)
 
#define wiced_bt_sco_create_as_acceptor_with_specific_ag(ag_addr, p_sco_index)   BTM_CreateSco(ag_addr, 0, 0, p_sco_index)
 

Typedefs

typedef void( wiced_bt_sco_data_cb_t )(uint32_t ltch_len, uint8_t *p_data)
 

Enumerations

enum  wiced_bt_sco_route_path_t { WICED_BT_SCO_OVER_I2SPCM = 0, WICED_BT_SCO_OVER_APP_CB = 1 }
 

Functions

wiced_bt_dev_status_t wiced_bt_sco_create_as_initiator (wiced_bt_device_address_t bd_addr, uint16_t *p_sco_index, wiced_bt_sco_params_t *p_params)
 Function wiced_bt_sco_create_as_initiator. More...
 
wiced_bt_dev_status_t wiced_bt_sco_create_as_acceptor (uint16_t *p_sco_index)
 Function wiced_bt_sco_create_as_acceptor. More...
 
wiced_bt_dev_status_t wiced_bt_sco_remove (uint16_t sco_index)
 Function wiced_bt_sco_remove. More...
 
void wiced_bt_sco_accept_connection (uint16_t sco_index, uint8_t hci_status, wiced_bt_sco_params_t *p_params)
 Function wiced_bt_sco_accept_connection. More...
 
wiced_bt_dev_status_t wiced_bt_sco_setup_voice_path (wiced_bt_voice_path_setup_t *pData)
 Function wiced_bt_sco_setup_voice_path. More...
 
uint16_t wiced_bt_sco_output_stream (uint8_t *p_pcmsrc, uint16_t len)
 Function wiced_bt_sco_output_stream. More...
 
void wiced_bt_sco_turn_off_pcm_clock (void)
 Function wiced_bt_sco_turn_off_pcm_clock. More...
 
uint8_t BTM_CreateSco (BD_ADDR remote_bda, BOOLEAN is_orig, UINT16 pkt_types, UINT16 *p_sco_inx)
 

Detailed Description

SCO Definitions and Functions.

SCO logical transport, is a symmetric, point-to-point transport between the central and a specific peripheral. The SCO logical transport reserves slots and can therefore be considered as a circuit-switched connection between the central and the peripheral. The central may support up to three SCO links to the same peripheral or to different peripherals. A peripheral may support up to three SCO links from the same central, or two SCO links if the links originate from different centrals. SCO packets are never retransmitted.

Enumeration Type Documentation

Enumerator
WICED_BT_SCO_OVER_APP_CB 

PCM data config for routing over APP.

Function Documentation

void wiced_bt_sco_accept_connection ( uint16_t  sco_index,
uint8_t  hci_status,
wiced_bt_sco_params_t p_params 
)

Function wiced_bt_sco_accept_connection.

The wiced_voice_path.a was required to be included before we link this function. Called to handle (e)SCO connection request event (wiced_bt_sco_connect_request_event).

Parameters
[in]sco_index: SCO index to remove
[in]HCIstatus code : HCI_SUCCESS 0x00 HCI_ERR_HOST_REJECT_RESOURCES 0x0D HCI_ERR_HOST_REJECT_SECURITY 0x0E HCI_ERR_HOST_REJECT_DEVICE 0x0F
[in]p_params: Pointer to the SCO parameter structure
wiced_bt_dev_status_t wiced_bt_sco_create_as_acceptor ( uint16_t *  p_sco_index)

Function wiced_bt_sco_create_as_acceptor.

Creates a synchronous connection oriented connection as acceptor.

Parameters
[out]p_sco_index: SCO index returned
Returns
WICED_BT_UNKNOWN_ADDR : Create connection failed, ACL connection is not up or address is invalid WICED_BT_BUSY : Create connection failed, a SCO connection is already conncted to the same BD address WICED_BT_WRONG_MODE : Create connection failed, link in park mode or automatic un-park is not supported WICED_BT_NO_RESOURCES : Create connection failed, max SCO limit has been reached BTM_CMD_STARTED : Create connection successfully, "p_sco_index" is returned
wiced_bt_dev_status_t wiced_bt_sco_create_as_initiator ( wiced_bt_device_address_t  bd_addr,
uint16_t *  p_sco_index,
wiced_bt_sco_params_t p_params 
)

Function wiced_bt_sco_create_as_initiator.

The wiced_voice_path.a was required to included before we link this function. Creates a synchronous connection oriented connection as initiator.

Parameters
[in]bd_addr: Peer bd_addr
[in]p_params: Pointer to the SCO parameter structure
[out]p_sco_index: SCO index returned
Returns
WICED_BT_UNKNOWN_ADDR : Create connection failed, ACL connection is not up WICED_BT_BUSY : Create connection failed, another SCO is being conncted to the same BD address WICED_BT_WRONG_MODE : Create connection failed, wrong mode WICED_BT_NO_RESOURCES : Create connection failed, max SCO limit has been reached BTM_CMD_STARTED : Create connection successfully, "p_sco_index" is returned
uint16_t wiced_bt_sco_output_stream ( uint8_t *  p_pcmsrc,
uint16_t  len 
)

Function wiced_bt_sco_output_stream.

The wiced_voice_path.a was required to include before we link this function. Send pcm data to internl audio pipe.

Parameters
[in]p_pcmsrc: Audio stream source.
[in]len: Length of stream.
Returns
: Return the legth of non transmited stream.
wiced_bt_dev_status_t wiced_bt_sco_remove ( uint16_t  sco_index)

Function wiced_bt_sco_remove.

Removes a specific synchronous connection oriented connection.

Parameters
[in]sco_index: SCO index to remove
Returns
WICED_BT_UNKNOWN_ADDR : Remove connection failed, invalid SCO index WICED_BT_NO_RESOURCES : Remove connection failed, no resource WICED_BT_SUCCESS : Remove connection successfully, device is still listening for incoming connection BTM_CMD_STARTED : Remove connection successfully
wiced_bt_dev_status_t wiced_bt_sco_setup_voice_path ( wiced_bt_voice_path_setup_t pData)

Function wiced_bt_sco_setup_voice_path.

The wiced_voice_path.a was required to include before we link this function. Configure the SCO routing path.

Parameters
[in]pData: To setup SCO routing path
Returns
WICED_BT_SUCCESS : Config success. WICED_BT_PENDING : Command sent. Waiting for command complete event. WICED_BT_BUSY : Command not sent. Waiting for command complete event for prior command.
void wiced_bt_sco_turn_off_pcm_clock ( void  )

Function wiced_bt_sco_turn_off_pcm_clock.

The wiced_voice_path.a was required to include before we link this function. To turn off the PCM/I2S hardware clock This function needs to be called after the application turns off (or mutes audio data in/out of) the codec

Returns
: None