BT/BLE#
Functions#
Clear the Bluetooth wait bitmap.
Set the bt wait bitmap.
Register the bt-common callbacks.
Determine the ACL packet type (BT classic) using the frame type.
Determine the BT protocol (BT COMMON / BT classic / BLE ) using the packet type.
Calculate semaphore wait time for a protocol (BT COMMON / BT classic / BLE ) using the packet type.
Handle BT data transfer completion.
Return BT status.
Set BT status.
Get bt status.
Update local Device buffer availability per slave in global ble cb structure.
Update Remote BLE Device info in global ble cb structure.
Remove Remote BLE Device info in global ble cb structure.
Process BT RX packets.
Process BT RX packets.
Initialize bt control block structure.
Initialize bt global control block.
Wait for BT card ready.
Register the GAP extended callbacks.
Initailize the BT callbacks register.
Initailize the BT callbacks register.
Chip memory status.
Form the payload of the BT command packet.
Fill the BT Classic command packet payload.
Form the payload of the BT Classic command packet.
Fill commands and places into Bt TX queue.
Initialize bt stack.
Function Documentation#
rsi_bt_clear_wait_bitmap#
void rsi_bt_clear_wait_bitmap (uint16_t protocol_type, uint8_t sem_type)
Clear the Bluetooth wait bitmap.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | protocol_type | - Protocol type |
uint8_t | [in] | sem_type | - Type |
Returns
void
rsi_bt_set_wait_bitmap#
void rsi_bt_set_wait_bitmap (uint16_t protocol_type, uint8_t sem_type)
Set the bt wait bitmap.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | protocol_type | - Protocol |
uint8_t | [in] | sem_type | - Type |
Returns
void
rsi_bt_common_register_callbacks#
void rsi_bt_common_register_callbacks (rsi_bt_get_ber_pkt_t rsi_bt_get_ber_pkt_from_app)
Register the bt-common callbacks.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_get_ber_pkt_t | [in] | rsi_bt_get_ber_pkt_from_app | - BER Call back |
Returns
void
rsi_bt_get_ACL_type#
uint8_t rsi_bt_get_ACL_type (uint16_t rsp_type)
Determine the ACL packet type (BT classic) using the frame type.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | rsp_type | - packet type |
Returns
1 - HCI Command Packet, 2 - HCI ACL packet ,3 - HCI PER Packet
Non-Zero Value - Failure (Not a BT Classic Packet)
rsi_bt_get_proto_type#
uint16_t rsi_bt_get_proto_type (uint16_t rsp_type, rsi_bt_cb_t ** bt_cb)
Determine the BT protocol (BT COMMON / BT classic / BLE ) using the packet type.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | rsp_type | - Packet type |
rsi_bt_cb_t ** | [in] | bt_cb | - BT control back |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_get_timeout#
uint32_t rsi_bt_get_timeout (uint16_t cmd_type, uint16_t protocol_type)
Calculate semaphore wait time for a protocol (BT COMMON / BT classic / BLE ) using the packet type.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | cmd_type | - Command Type |
uint16_t | [in] | protocol_type | - Protocol type , whether it is BT Common/BT Classic/BLE |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_common_tx_done#
void rsi_bt_common_tx_done (rsi_pkt_t * pkt)
Handle BT data transfer completion.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_t * | [in] | pkt | - Pointer to packet |
Returns
void
rsi_get_bt_state#
uint32_t rsi_get_bt_state (rsi_bt_cb_t * bt_cb)
Return BT status.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_cb | - BT control block |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_set_status#
void rsi_bt_set_status (rsi_bt_cb_t * bt_cb, int32_t status, None)
Set BT status.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_cb | - BT control block |
int32_t | [in] | status | - Status value to be set |
[out] | None |
Returns
void
rsi_bt_get_status#
uint32_t rsi_bt_get_status (rsi_bt_cb_t * bt_cb)
Get bt status.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_cb | - BT control block |
Returns
0 - Success
Non-Zero Value - Failure
rsi_ble_update_le_dev_buf#
void rsi_ble_update_le_dev_buf (rsi_ble_event_le_dev_buf_ind_t * rsi_ble_event_le_dev_buf_ind)
Update local Device buffer availability per slave in global ble cb structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_ble_event_le_dev_buf_ind_t * | [in] | rsi_ble_event_le_dev_buf_ind |
Returns
void
rsi_add_remote_ble_dev_info#
void rsi_add_remote_ble_dev_info (rsi_ble_event_enhance_conn_status_t * remote_dev_info)
Update Remote BLE Device info in global ble cb structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_ble_event_enhance_conn_status_t * | [in] | remote_dev_info |
Returns
void
rsi_remove_remote_ble_dev_info#
void rsi_remove_remote_ble_dev_info (rsi_ble_event_disconnect_t * remote_dev_info)
Remove Remote BLE Device info in global ble cb structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_ble_event_disconnect_t * | [in] | remote_dev_info | - Remote device information |
Returns
void
rsi_driver_process_bt_resp#
int32_t rsi_driver_process_bt_resp (rsi_bt_cb_t * bt_cb, rsi_pkt_t * pkt, void(*)(rsi_bt_cb_t *cb, uint16_t type, uint8_t *data, uint16_t length) rsi_bt_async_callback_handler, uint16_t protocol_type)
Process BT RX packets.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_cb | - BT control block |
rsi_pkt_t * | [in] | pkt | - Pointer to received RX packet |
void(*)(rsi_bt_cb_t *cb, uint16_t type, uint8_t *data, uint16_t length) | [in] | rsi_bt_async_callback_handler | |
uint16_t | N/A | protocol_type |
Returns
0 - Success
Non-Zero Value - Failure
rsi_driver_process_bt_resp_handler#
uint16_t rsi_driver_process_bt_resp_handler (rsi_pkt_t * pkt)
Process BT RX packets.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_pkt_t * | [in] | pkt | - Pointer to received RX packet |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_cb_init#
int8_t rsi_bt_cb_init (rsi_bt_cb_t * bt_cb, uint16_t protocol_type)
Initialize bt control block structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_cb | - Pointer to bt_cb structure |
uint16_t | [in] | protocol_type | - Protocol type |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_global_cb_init#
uint16_t rsi_bt_global_cb_init (rsi_driver_cb_t * driver_cb, uint8_t * buffer)
Initialize bt global control block.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_driver_cb_t * | [in] | driver_cb | - Pointer to bt_cb structure |
uint8_t * | [in] | buffer | - Buffer |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_common_init#
void rsi_bt_common_init (void )
Wait for BT card ready.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
void
rsi_bt_gatt_extended_register_callbacks#
void rsi_bt_gatt_extended_register_callbacks (rsi_bt_on_gatt_connection_t bt_on_gatt_connection_event, rsi_bt_on_gatt_disconnection_t bt_on_gatt_disconnection_event)
Register the GAP extended callbacks.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_on_gatt_connection_t | [in] | bt_on_gatt_connection_event | - GATT Connection status callback |
rsi_bt_on_gatt_disconnection_t | [in] | bt_on_gatt_disconnection_event | - GATT Disconnection status callback |
Returns
void
rsi_bt_callbacks_handler#
void rsi_bt_callbacks_handler (rsi_bt_cb_t * bt_classic_cb, uint16_t rsp_type, uint8_t * payload, uint16_t payload_length)
Initailize the BT callbacks register.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | bt_classic_cb | - BT BLE struct pointer |
uint16_t | [in] | rsp_type | - BT Packet type |
uint8_t * | [in] | payload | - Payload |
uint16_t | [in] | payload_length | - payload length |
Returns
void
rsi_ble_callbacks_handler#
void rsi_ble_callbacks_handler (rsi_bt_cb_t * ble_cb, uint16_t rsp_type, uint8_t * payload, uint16_t payload_length)
Initailize the BT callbacks register.
Type | Direction | Argument Name | Description |
---|---|---|---|
rsi_bt_cb_t * | [in] | ble_cb | - BLE control back |
uint16_t | [in] | rsp_type | - BLE Packet type |
uint8_t * | [in] | payload | - Payload |
uint16_t | [in] | payload_length | - Payload length |
Returns
void
rsi_ble_on_chip_memory_status_callbacks_register#
void rsi_ble_on_chip_memory_status_callbacks_register (chip_ble_buffers_stats_handler_t ble_on_chip_memory_status_event)
Chip memory status.
Type | Direction | Argument Name | Description |
---|---|---|---|
chip_ble_buffers_stats_handler_t | [in] | ble_on_chip_memory_status_event | - Memory status |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_prepare_common_pkt#
uint16_t rsi_bt_prepare_common_pkt (uint16_t cmd_type, void * cmd_struct, rsi_pkt_t * pkt)
Form the payload of the BT command packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | cmd_type | - Type of the command |
void * | [in] | cmd_struct | - Pointer of the command structure |
rsi_pkt_t * | [out] | pkt | - Pointer of the packet to fill the contents of the payload |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_prepare_classic_pkt#
uint16_t rsi_bt_prepare_classic_pkt (uint16_t cmd_type, void * cmd_struct, rsi_pkt_t * pkt)
Fill the BT Classic command packet payload.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | cmd_type | - Type of the command |
void * | [in] | cmd_struct | - Pointer of the command structure |
rsi_pkt_t * | [out] | pkt | - Pointer of the packet to fill the contents of the payload |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_prepare_le_pkt#
uint16_t rsi_bt_prepare_le_pkt (uint16_t cmd_type, void * cmd_struct, rsi_pkt_t * pkt)
Form the payload of the BT Classic command packet.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | cmd_type | - Type of the command |
void * | [in] | cmd_struct | - Pointer of the command structure |
rsi_pkt_t * | [out] | pkt | - Pointer of the packet to fill the contents of the payload |
Returns
0 - Success
Non-Zero Value - Failure
rsi_bt_driver_send_cmd#
int32_t rsi_bt_driver_send_cmd (uint16_t cmd, void * cmd_struct, void * resp)
Fill commands and places into Bt TX queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | cmd | - Type of the command to send |
void * | [in] | cmd_struct | - Pointer of the packet structure to send |
void * | [in] | resp | - Pointer of the packet to fill the contents of the payload |
Returns
0 - Success
Non-Zero Value - Failure
intialize_bt_stack#
int32_t intialize_bt_stack (uint8_t mode)
Initialize bt stack.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | mode | - Mode |
Returns
0 - Success
Non-Zero Value - Failure