GAP#
Functions#
Sets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.
Gets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.
Sets the BT Module discovery mode status to INQUIRY_SCAN. This is a blocking API.
Request the local device to enter limited discovery mode. The device comes out of discovery mode after the time out. If the 'time_out_ms' is set to '0', the device will be in continuous discoverable mode. This is a blocking API.
Write the current iac lap to the controller. This is a blocking API.
Clears INQUIRY_SCAN BIT from BT Module discovery mode. This is a blocking API.
Gets the BT Module discovery mode status, whether INQUIRY_SCAN enabled/not. This is a blocking API.
Sets the BT Module connectablity status to PAGE_SCAN. This is a blocking API.
Sets the No.of channels to be used to Transmit or Receive the data/control packets between Local and Remote Devices. This is a blocking API.
Reads the afh mode, whether it is enable/disable. This is a blocking API.
Clears the PAGE_SCAN BIT in BT Module connectablity status. This is a blocking API.
Gets the BT Module connectablity status, whether PAGE_SCAN enabled/not. This is a blocking API.
If the local device requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event).At connection setup, only the device(s) with the Authentication_Enable parameter enabled will try to authenticate the other device. This is a blocking API.
If the local device doesn't requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event). This is a blocking API.
Reads the value from the Authentication_Enable configuration parameter, whether Authentication is Enabled/Disabled. This is a blocking API.
Know the remote device name, if empty name present in the Inquired list during Inquiry. And also can call this API after bt connection. This is a blocking API. A received event rsi_bt_on_remote_name_resp_t has the name of the remote_dev_addr which is requested.
The Remote Device name request which is initiated by rsi_bt_remote_name_request_async() api will be cancelled by using this API. This is a blocking API. A received event rsi_bt_on_remote_name_request_cancel_t indicates that remote name request has been cancelled.
Starts the Inquiry procedure till duration specified in the inquiry_duration parameter and allowed maximum number of devices to be inquired is mentioned in max_devices parameter. This is a blocking API. A received event rsi_bt_on_scan_resp_t provides the Inquired devices information. A received event rsi_bt_on_inquiry_complete_t indicates that Inquiry has been completed .
The Inquiry request which is initiated with rsi_bt_inquiry() api will be cancelled by using this API. This is a blocking API.
Initiate a connection request to the GATT Server on the Remote Device via BT Classic L2cap Channel instead BLE, which in terms called as ATT_OVER_CLASSIC. This is a blocking API.
Add device Identification in SDP protocol. This is a blocking API.
Change the packet types in the controller after connection only, can switch between 2DH3,2DH5,3DH3,3DH5. This is a blocking API.
Configure the LP HP transitions in the controller. This is a blocking API.
Usually Authentication procedure will starts from stack itself once PHY Level Connection completes, but if already authentication is in disable state and after PHY Level Connection if User needs Authetication, then firstly need to enable Authentication and secondly call this API. This is a blocking API.
Usually Encrytpion procedure will starts from stack itself once PHY Level Connection and authentication completed, but user can decide whether to enable/disable encryption from the host. This is a blocking API.
Delete the existing linkkeys which are stored in Controller Memory. This is a blocking API.
Function Documentation#
rsi_bt_set_local_class_of_device#
int32_t rsi_bt_set_local_class_of_device (uint32_t class_of_device)
Sets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.
[in] | class_of_device | - name to be set to the local device COD |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
41
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_get_local_class_of_device#
int32_t rsi_bt_get_local_class_of_device (uint8_t * resp)
Gets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.
[out] | resp | - response buffer to hold the response of this API |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
64
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_start_discoverable#
rsi_bt_start_discoverable (void )
Sets the BT Module discovery mode status to INQUIRY_SCAN. This is a blocking API.
N/A |
rsi_wireless_init API needs to be called before this API
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
82
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_start_limited_discoverable#
int32_t rsi_bt_start_limited_discoverable (int32_t time_out_ms)
Request the local device to enter limited discovery mode. The device comes out of discovery mode after the time out. If the 'time_out_ms' is set to '0', the device will be in continuous discoverable mode. This is a blocking API.
[in] | time_out_ms | - Limited discovery mode time_out in ms. |
rsi_wireless_init API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
107
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_write_current_iac_lap#
int32_t rsi_bt_write_current_iac_lap (uint8_t no_of_iaps, uint8_t * iap_lap_list)
Write the current iac lap to the controller. This is a blocking API.
[in] | no_of_iaps | - number of iap lap count |
[in] | iap_lap_list | - pointer to the iap laps list |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
130
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_stop_discoverable#
rsi_bt_stop_discoverable (void )
Clears INQUIRY_SCAN BIT from BT Module discovery mode. This is a blocking API.
N/A |
rsi_wireless_init API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
158
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_get_discoverable_status#
int32_t rsi_bt_get_discoverable_status (uint8_t * resp)
Gets the BT Module discovery mode status, whether INQUIRY_SCAN enabled/not. This is a blocking API.
[out] | resp | - response buffer to hold the response of this API |
rsi_bt_start_discoverable() API need to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
181
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_set_connectable#
rsi_bt_set_connectable (void )
Sets the BT Module connectablity status to PAGE_SCAN. This is a blocking API.
N/A |
rsi_wireless_init API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
198
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_set_afh_host_channel_classification#
int32_t rsi_bt_set_afh_host_channel_classification (uint8_t enable, uint8_t * channel_map)
Sets the No.of channels to be used to Transmit or Receive the data/control packets between Local and Remote Devices. This is a blocking API.
[in] | enable | - This parameter is used to enable or disable afh host channel classification. This parameter supports the following values. 0 - Disable 1 - Enable |
[in] | channel_map | - Array of channel mapping values. Channel map range: This parameter contains 80 1-bit fields. The nth such field (in the range 0 to 78 bits) contains the value for channel n: 0: channel n is bad 1: channel n is unknown |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND 0x4E12 - INVALID_HCI_COMMAND_PARAMETERS
Note
Refer Error Codes section for common error codes Error Codes .
227
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_get_afh_host_channel_classification#
int32_t rsi_bt_get_afh_host_channel_classification (uint8_t * status)
Reads the afh mode, whether it is enable/disable. This is a blocking API.
[out] | status | - This parameter is to hold the response of this API. |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
252
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_set_non_connectable#
rsi_bt_set_non_connectable (void )
Clears the PAGE_SCAN BIT in BT Module connectablity status. This is a blocking API.
N/A |
rsi_wireless_init API need to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
275
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_get_connectable_status#
int32_t rsi_bt_get_connectable_status (uint8_t * resp)
Gets the BT Module connectablity status, whether PAGE_SCAN enabled/not. This is a blocking API.
[out] | resp | - response buffer to hold the response of this API |
rsi_bt_set_connectable() API needs to be called before this API
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
296
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_enable_authentication#
rsi_bt_enable_authentication (void )
If the local device requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event).At connection setup, only the device(s) with the Authentication_Enable parameter enabled will try to authenticate the other device. This is a blocking API.
N/A |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
Changing this parameter does not affect existing connection.
319
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_disable_authentication#
rsi_bt_disable_authentication (void )
If the local device doesn't requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event). This is a blocking API.
N/A |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
Changing this parameter does not affect existing connection.
342
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_get_authentication#
int32_t rsi_bt_get_authentication (uint8_t * resp)
Reads the value from the Authentication_Enable configuration parameter, whether Authentication is Enabled/Disabled. This is a blocking API.
[out] | resp | - response buffer to hold the response of this API |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
363
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_remote_name_request_async#
int32_t rsi_bt_remote_name_request_async (uint8_t * remote_dev_addr, rsi_bt_event_remote_device_name_t * bt_event_remote_device_name)
Know the remote device name, if empty name present in the Inquired list during Inquiry. And also can call this API after bt connection. This is a blocking API. A received event rsi_bt_on_remote_name_resp_t has the name of the remote_dev_addr which is requested.
[in] | remote_dev_addr | - remote device address |
[out] | bt_event_remote_device_name | - response buffer to hold the name of remote device Please refer rsi_bt_event_remote_device_name_s structure for more info. |
Call rsi_wireless_init() and rsi_bt_inquiry() before calling this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
382
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_remote_name_request_cancel#
int32_t rsi_bt_remote_name_request_cancel (uint8_t * remote_dev_addr)
The Remote Device name request which is initiated by rsi_bt_remote_name_request_async() api will be cancelled by using this API. This is a blocking API. A received event rsi_bt_on_remote_name_request_cancel_t indicates that remote name request has been cancelled.
[in] | remote_dev_addr | - remote device address |
rsi_bt_remote_name_request_async() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E12 - INVALID_HCI_COMMAND_PARAMETERS
Note
Refer Error Codes section for common error codes Error Codes .
411
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_inquiry#
int32_t rsi_bt_inquiry (uint8_t inquiry_type, uint32_t inquiry_duration, uint8_t max_devices)
Starts the Inquiry procedure till duration specified in the inquiry_duration parameter and allowed maximum number of devices to be inquired is mentioned in max_devices parameter. This is a blocking API. A received event rsi_bt_on_scan_resp_t provides the Inquired devices information. A received event rsi_bt_on_inquiry_complete_t indicates that Inquiry has been completed .
[in] | inquiry_type | - This is the Inquiry type. 0 - Standard Inquiry 1 - Inquiry with RSSI 2 - Extended Inquiry |
[in] | inquiry_duration | - duration of inquiry. |
[in] | max_devices | - This is the maximum number of devices allowed to inquiry from 1 to 10 |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for common error codes Error Codes .
441
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_cancel_inquiry#
rsi_bt_cancel_inquiry (void )
The Inquiry request which is initiated with rsi_bt_inquiry() api will be cancelled by using this API. This is a blocking API.
N/A |
Call rsi_wireless_init() and then rsi_bt_inquiry() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4FF9 - ERROR_STATE_INVALID
Note
Refer Error Codes section for common error codes Error Codes .
473
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_gatt_connect#
int32_t rsi_bt_gatt_connect (uint8_t * remote_dev_addr)
Initiate a connection request to the GATT Server on the Remote Device via BT Classic L2cap Channel instead BLE, which in terms called as ATT_OVER_CLASSIC. This is a blocking API.
[in] | remote_dev_addr | - remote device address |
Note
This API is not supported in the current release.
Call rsi_wireless_init() and rsi_bt_connect() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4FF8 - ERROR_INVALID_COMMAND 0x4046 - ERR_BT_INVALID_ARGS
Note
Refer Error Codes section for common error codes Error Codes .
To enable att_over_classic feature, 29th bit to be set in bt_custom_feature_bit_map.
1112
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_add_device_id#
int32_t rsi_bt_add_device_id (uint16_t spec_id, uint16_t vendor_id, uint16_t product_id, uint16_t version, int primary_rec, uint16_t vendor_id_source)
Add device Identification in SDP protocol. This is a blocking API.
[in] | spec_id | - Version number of the Bluetooth Device ID Profile specification supported by the device. |
[in] | vendor_id | - Uniquely identify the vendor of the device. |
[in] | product_id | - To distinguish between different products made by the vendor |
[in] | version | - A numeric expression identifying the device release number in Binary-Coded Decimal |
[in] | primary_rec | - Set to TRUE in the case single Device ID Service Record exists in the device. If multiple Device ID Service Records exist, and no primary record has been defined, set to FALSE. |
[in] | vendor_id_source | - This attribute designates which organization assigned the VendorID attribute, 0x201. |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4105 - ERR_BT_SDP_PNP_SERVICE_ALREADY_EXISTS 0x4046 - ERR_BT_INVALID_ARGS
Note
Refer Error Codes section for common error codes Error Codes .
1155
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_change_pkt_type#
int32_t rsi_bt_change_pkt_type (uint8_t * remote_dev_addr, uint16_t pkt_type)
Change the packet types in the controller after connection only, can switch between 2DH3,2DH5,3DH3,3DH5. This is a blocking API.
[in] | remote_dev_addr | - Remote device address |
[in] | pkt_type | - change the packet types in the controller |
Call rsi_wireless_init() and rsi_bt_connect() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER
Note
Refer Error Codes section for common error codes Error Codes .
1191
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_ptt_req#
int32_t rsi_bt_ptt_req (uint8_t mode)
Configure the LP HP transitions in the controller. This is a blocking API.
[in] | mode | - BR/EDR mode 0 - BR Mode 1 - EDR Mode |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
1224
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_request_authentication#
int32_t rsi_bt_request_authentication (int8_t * remote_dev_addr)
Usually Authentication procedure will starts from stack itself once PHY Level Connection completes, but if already authentication is in disable state and after PHY Level Connection if User needs Authetication, then firstly need to enable Authentication and secondly call this API. This is a blocking API.
[in] | remote_dev_addr | - Remote device address |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER
Note
Refer Error Codes section for common error codes Error Codes .
1249
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_encryption_enable_or_disable#
int32_t rsi_bt_encryption_enable_or_disable (int8_t * remote_dev_addr, uint8_t enable_or_disable)
Usually Encrytpion procedure will starts from stack itself once PHY Level Connection and authentication completed, but user can decide whether to enable/disable encryption from the host. This is a blocking API.
[in] | remote_dev_addr | - Remote device address |
[in] | enable_or_disable | - To enable/disable the encryption. 1 - Enable 0 - Disable |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E11 - UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE
Note
Refer Error Codes section for common error codes Error Codes .
1284
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_link_policy_settings_config#
int32_t rsi_bt_link_policy_settings_config (uint8_t * remote_dev_addr, uint16_t link_policy_settings)
N/A | remote_dev_addr | |
N/A | link_policy_settings |
1317
of file bluetooth/rsi_bt_gap_apis.c
rsi_bt_delete_linkkeys#
int32_t rsi_bt_delete_linkkeys (int8_t * remote_dev_addr, uint8_t delete_linkkeys)
Delete the existing linkkeys which are stored in Controller Memory. This is a blocking API.
[in] | remote_dev_addr | - Remote device address |
[in] | delete_linkkeys | - Based on this flag the Controller deletes all the stored linkkeys (or) deletes specific to the remote_dev_addr. 1 - Deletes all stored Linkkeys from Controller 0 - Deletes Specfic to the remote_dev_addr |
Note
This API is not supported in the current release.
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E12 - ERR_BT_INVALID_HCI_COMMAND_PARAMETER 0x4E12 - UNKNOWN_HCI_COMMAND
Note
Refer Error Codes section for common error codes Error Codes .
1351
of file bluetooth/rsi_bt_gap_apis.c