2.0.0.4R9
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
Synchronous Connection Oriented (SCO) Channel

Functions

wiced_bt_dev_status_t wiced_bt_sco_accept_connection (uint16_t sco_index, uint8_t hci_status, wiced_bt_sco_esco_codec_setting_id_t esco_set_id)
 
wiced_bt_dev_status_t wiced_bt_sco_create_as_acceptor (uint16_t *p_sco_index)
 
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_esco_codec_setting_id_t esco_set_id)
 
void * wiced_bt_sco_get_buffer_pool (void)
 
wiced_bt_dev_status_t wiced_bt_sco_remove (uint16_t sco_index)
 
wiced_bt_dev_status_t wiced_bt_sco_set_buffer_pool (uint16_t buffer_size, uint16_t buffer_count)
 
wiced_bt_dev_status_t wiced_bt_sco_set_data_callback (wiced_bt_sco_data_cback_t *p_cback)
 
wiced_bt_dev_status_t wiced_bt_sco_write_data (uint16_t sco_index, uint8_t *sco_data, uint16_t data_length)
 

Detailed Description

The SCO logical transport is a point-to-point transport between the master and a specific slave. The SCO logical transport reserves slots and can therefore be considered as a circuit-switched connection between the master and the slave. SCO packets are never retransmitted. SCO link is mainly used for Hands Free Audio. (HFP)

Function Documentation

wiced_bt_dev_status_t wiced_bt_sco_accept_connection ( uint16_t  sco_index,
uint8_t  hci_status,
wiced_bt_sco_esco_codec_setting_id_t  esco_set_id 
)

Function wiced_bt_sco_accept_connection

             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 : WICED_BT_SCO_CONNECTION_ACCEPT 0x00 WICED_BT_SCO_CONNECTION_REJECT_RESOURCES 0x0D WICED_BT_SCO_CONNECTION_REJECT_SECURITY 0x0E WICED_BT_SCO_CONNECTION_REJECT_DEVICE 0x0F
[in]esco_set_id: see wiced_bt_sco_esco_codec_setting_id_t
Returns
WICED_BT_SUCCESS if successful . WICED_BT_ILLEGAL_VALUE invalid esco set ID.
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 WICED_BT_PENDING : 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_esco_codec_setting_id_t  esco_set_id 
)

Function wiced_bt_sco_create_as_initiator

             Creates a synchronous connection oriented connection as initiator.
Parameters
[in]bd_addr: Peer bd_addr
[out]p_sco_index: SCO index
[in]esco_set_id: see wiced_bt_sco_esco_codec_setting_id_t
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 WICED_BT_PENDING : Create connection successfully, "p_sco_index" is returned
void* wiced_bt_sco_get_buffer_pool ( void  )

Function wiced_bt_sco_get_buffer_pool

             Userial calls this function to find the private GKI buffer pool for SCO over HCI.
Returns
the private pool.
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 WICED_BT_PENDING : Remove connection successfully
wiced_bt_dev_status_t wiced_bt_sco_set_buffer_pool ( uint16_t  buffer_size,
uint16_t  buffer_count 
)

Function wiced_bt_sco_set_buffer_pool

             If buffer_size > 0 and wiced_bt_sco does not have a private pool yet,
             this function allocates a private GKI buffer pool.
             If buffer_size = 0 and wiced_bt_sco has a private pool,
             this function deallocates the private GKI buffer pool.
Parameters
[in]buffer_size: buffer size for the private pool.
[in]buffer_count: number of buffers in this pool.
Returns
WICED_BT_SUCCESS if the action was carried out successfully as desired WICED_BT_NO_RESOURCES no resources.
wiced_bt_dev_status_t wiced_bt_sco_set_data_callback ( wiced_bt_sco_data_cback_t p_cback)

Function wiced_bt_sco_set_data_callback

             App must call this API to register a data callback function.
             The stack calls this callback function when there are incoming SCO packets.
Parameters
[in]p_cback: function pointer to the callabck function Stack calls this function to deliver incoming SCO packets to app.
Returns
WICED_BT_SUCCESS if the successful (PCM or Test mode). WICED_BT_NO_RESOURCES no resources to start the command. WICED_BT_ILLEGAL_VALUE invalid callback function pointer. WICED_BT_PENDING Command sent. Waiting for command cmpl event.
Note
if the call back is NULL or if the application doesn't call this function to register a callback, and if the SCO route is SCO_OVER_HCI, the received data will be discarded.
wiced_bt_dev_status_t wiced_bt_sco_write_data ( uint16_t  sco_index,
uint8_t *  sco_data,
uint16_t  data_length 
)

Function wiced_bt_sco_write_data

             Called to send data over (e)SCO.
Parameters
[in]sco_index: SCO index.
[in]sco_data: pointer to the data to be sent over SCO.
[in]data_length: length of the data
Returns
WICED_BT_SUCCESS data write is successful WICED_BT_SCO_BAD_LENGTH SCO data length exceeds the max SCO packet size. WICED_BT_NO_RESOURCES no resources. WICED_BT_UNKNOWN_ADDR unknown SCO connection handle, or SCO is not routed via HCI.