GAP#
Functions#
Request the local device to set a random address. This is a Blocking API.
Request the local device to set a given random address. This is a Blocking API.
Request the local device to start advertising. This is a Blocking API A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected.
Request the local device to start advertising with specified values. This is a Blocking API A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected.
Encrypt the plain text data fed by the user using the key provided. It uses the AES-128 bit block cypher alogo to generate encrypted data. Refer to Bluetooth Spec 5.0 for further details.
Stop advertising. This is a Blocking API.
Set the advertising data. This is a Blocking API.
Request the local device to set the scan response data. This is a Blocking API .
Start scanning. This is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
Start scanning with values. This is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
Stop scanning. This is a Blocking API.
Connect to the remote BLE device with the user configured parameters. This is a blocking API. A received event rsi_ble_on_enhance_connect_t / rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.
Connect to the remote BLE device. This is a blocking API. A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.
Connect to the remote BLE device with the user configured parameters.
Cancel the connection to the remote BLE device. This is a blocking API. A received event rsi_ble_on_disconnect_t indicates disconnect complete.
Disconnect with the remote BLE device. This is a Blocking API.
Get the local device state. This is a Blocking API. The state value is filled in "resp".
Set the SMP Pairing Capability of local device. This is a Blocking API.
Set the IRK value to the local device. This is a Blocking API.
Give the response for the remote device connection parameter request. This is a Blocking API A received event rsi_ble_on_conn_update_complete_t indicates connection update procedure is successful.
Request the SMP pairing process with the remote device. This is a Blocking API A received event rsi_ble_on_smp_request_t indicated remote device is given Security Request and need to respond back with rsi_ble_smp_pair_request A received event rsi_ble_on_smp_response_t indicated remote device is given SMP Pair Request and need to respond back with rsi_ble_smp_pair_response A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
Send SMP pairing failure reason to the remote device.
Send the local long term key of its associated local EDIV and local Rand. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
Send SMP pairing response during the process of pairing with the remote device. This is a Blocking API A received event rsi_ble_on_smp_passkey_t indicated Legacy SMP passkey is received and need to respond back with rsi_ble_smp_passkey() A received event rsi_ble_on_sc_passkey_t indicated BLE SC passkey is received and need to respond back with rsi_ble_smp_passkey() A received event rsi_ble_on_smp_passkey_display_t indicates SMP passkey display is received from the module A received event rsi_ble_on_smp_failed_t indicated SMP Failed event is received.
Send SMP passkey during SMP pairing process with the remote device. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed
Get the timeout value of the LE ping. This is a Blocking API.
Set the timeout value of the LE ping. This is a Blocking API A received event of rsi_ble_on_le_ping_payload_timeout_t indicates le ping payload timeout expired.
Clear all the BD address present in accept list. This is a Blocking API.
Add BD address to accept list. This is a Blocking API.
Delete particular BD address from accept list. This is a Blocking API.
resolvlist api used for multiple purpose based on the process type. It will be used to add/remove/clear a device to/from the list. This is a Blocking API
Request to get resolving list size. This is a Blocking API.
Request to enable address resolution, and to set resolvable private address timeout. This is a Blocking API.
Request to set privacy mode for particular device. This is a Blocking API.
Reads the TX and RX PHY rates of the Connection. This is a Blocking API.
Set TX and RX PHY. This is a Blocking API A received event rsi_ble_on_phy_update_complete_t indicates phy rate update complete.
Requests the connection parameters change with the remote device. When the Silabs device is acting as a master, this API is used to update the connection parameters. When the Silabs device is acts as a slave, this API is used to request the master to intiate the connection update procedure. This is a Blocking API A received event rsi_ble_on_conn_update_complete_t indicates connection parameters update complete.
Sets the TX octets and the TX time of specified link (remote device connection). This is a Blocking API. A received event rsi_ble_on_data_length_update_t indicates data length update complete.
reads the max supported values of TX octets, TX time, RX octets and Rx time. This is a Blocking API
Issue a vendor-specific command to set the RF type in the controller on given inputs. This is a Blocking API.
Give vendor-specific command to set the acceptlist feature based on the advertisers advertising payload. This is a Blocking API.
Used to extract remote Bluetooth device name from the received advertising report.
Update the direct address with the remote device address. This is a Blocking API.
Start the encryption process with the remote device. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption. A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
Function Documentation#
rsi_ble_set_random_address#
int32_t rsi_ble_set_random_address (void )
Request the local device to set a random address. This is a Blocking API.
[in] |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
94
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_random_address_with_value#
int32_t rsi_ble_set_random_address_with_value (uint8_t * random_addr)
Request the local device to set a given random address. This is a Blocking API.
[in] | random_addr | - random address of the device to be set |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
117
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_start_advertising#
rsi_ble_start_advertising (void )
Request the local device to start advertising. This is a Blocking API A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected.
[in] |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
148
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_start_advertising_with_values#
int32_t rsi_ble_start_advertising_with_values (void * rsi_ble_adv)
Request the local device to start advertising with specified values. This is a Blocking API A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected.
[in] | rsi_ble_adv | - This structure pointer holds the information of advertising values This variable is the pointer of the rsi_ble_req_adv_s structure |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
188
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_encrypt#
int32_t rsi_ble_encrypt (uint8_t * key, uint8_t * data, uint8_t * resp)
Encrypt the plain text data fed by the user using the key provided. It uses the AES-128 bit block cypher alogo to generate encrypted data. Refer to Bluetooth Spec 5.0 for further details.
[in] | key | - 16 Bytes key for Encryption of data. |
[in] | data | - 16 Bytes of Data request to encrypt. |
[out] | resp | - Encrypted data |
Call rsi_wireless_init() before calling this API. This is a Blocking API
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
217
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_stop_advertising#
rsi_ble_stop_advertising (void )
Stop advertising. This is a Blocking API.
[in] |
Call rsi_ble_start_advertising() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
243
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_advertise_data#
int32_t rsi_ble_set_advertise_data (uint8_t * data, uint16_t data_len)
Set the advertising data. This is a Blocking API.
[in] | data | - Advertising data. |
[in] | data_len | - Total length of advertising data. |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1. The maximum length of advertising data payload is 31 bytes.
The basic format of advertising payload record contains length and data.
270
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_scan_response_data#
int32_t rsi_ble_set_scan_response_data (uint8_t * data, uint16_t data_len)
Request the local device to set the scan response data. This is a Blocking API .
[in] | data | - Data about to be sent |
[in] | data_len | - Length of data, which is about to be sent |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
296
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_start_scanning#
rsi_ble_start_scanning (void )
Start scanning. This is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
[in] |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
322
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_start_scanning_with_values#
int32_t rsi_ble_start_scanning_with_values (void * rsi_ble_scan_params)
Start scanning with values. This is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
[in] | rsi_ble_scan_params | - BLE scan parameters structure please refer rsi_ble_req_scan_s structure for more info |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
354
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_stop_scanning#
rsi_ble_stop_scanning (void )
Stop scanning. This is a Blocking API.
[in] |
rsi_ble_start_scanning() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed
Note
Refer Error Codes section for above error codes Error Codes .
383
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_connect_with_params#
int32_t rsi_ble_connect_with_params (uint8_t remote_dev_addr_type, int8_t * remote_dev_addr, uint16_t scan_interval, uint16_t scan_window, uint16_t conn_interval_max, uint16_t conn_interval_min, uint16_t conn_latency, uint16_t supervision_tout)
Connect to the remote BLE device with the user configured parameters. This is a blocking API. A received event rsi_ble_on_enhance_connect_t / rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.
[in] | remote_dev_addr_type | - AddressType - Specifies the type of the address mentioned in BD Address 0 - Public Address 1 - Random Address |
[in] | remote_dev_addr | - This parameter describes the device address of remote device |
[in] | scan_interval | - LE Scan Interval : N=0xXXXX It is defined as the time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. Range: 0x0004 to 0x4000 Time = N * 0.625 msec Time Range: 2.5 msec to 10 . 24 seconds |
[in] | scan_window | - LE Scan Window : N=0xXXXX Amount of time for the duration of the LE scan. LE_Scan_Window must be less than or equal to LE_Scan_Interval Range: 0x0004 to 0x4000 Time = N * 0.625 msec Time Range: 2.5 msec to 10 . 24 seconds |
[in] | conn_interval_max | - Max Connection Interval : N=0xXXXX Minimum value for the connection event interval, which must be greater than or equal to Conn_Interval_Min. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use |
[in] | conn_interval_min | - Min Connection Interval : N=0xXXXX Minimum value for the connection event interval, which must be greater than or equal to Conn_Interval_Max. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use |
[in] | conn_latency | - Connection Latency : N = 0xXXXX Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F4 |
[in] | supervision_tout | - Supervision Timeout : N = 0xXXXX Supervision timeout for the LE Link. Range: 0x000A to 0x0C80 Time = N * 10 msec Time Range: 100 msec to 32 seconds 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use |
Note
If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising, the stack will try to connect forever. In this case, the application will not get an event related to the connection request. To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request. Subsequent calls of this command have to wait for the ongoing command to complete.
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
459
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_connect#
int32_t rsi_ble_connect (uint8_t remote_dev_addr_type, int8_t * remote_dev_addr)
Connect to the remote BLE device. This is a blocking API. A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.
[in] | remote_dev_addr_type | - This parameter describes the address type of the remote device |
[in] | remote_dev_addr | - This parameter describes the device address of the remote device |
Note
If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising, the stack will try to connect forever. In this case, the application will not get an event related to the connection request. To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request. Subsequent calls of this command have to wait for the ongoing command to complete.
rsi_wireless_init() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
526
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_enhance_connect_with_params#
int32_t rsi_ble_enhance_connect_with_params (void * ble_enhance_conn_params)
Connect to the remote BLE device with the user configured parameters.
[in] | ble_enhance_conn_params | - BLE enhance connection parameter structure: dev_addr_type - Address type of the device to connect 0 - Public Address 1 - Random Address dev_addr - Address of the device to connect filter_policy - Initiater filter policy is used to determine whether the Filter Accept List is used. 0 - Filter Accept List is not used to determine which advertiser to connect to. 1 - Filter Accept List is used to determine which advertiser to connect to. own_addr_type - own address type le_scan_interval - LE Scan Interval : N=0xXXXX It is defined as the time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. Range: 0x0004 to 0x4000 Time = N * 0.625 msec Time Range: 2.5 msec to 10 . 24 seconds le_scan_window - LE Scan Window : N=0xXXXX Amount of time for the duration of the LE scan. LE_Scan_Window must be less than or equal to LE_Scan_Interval Range: 0x0004 to 0x4000 Time = N * 0.625 msec Time Range: 2.5 msec to 10 . 24 seconds conn_interval_min - Min Connection Interval : N=0xXXXX Minimum value for the connection event interval, which must be greater than or equal to Conn_Interval_Max. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use conn_interval_max - Max Connection Interval : N=0xXXXX Maximum value for the connection event interval, which must be greater than or equal to Conn_Interval_Min. Range: 0x0006 to 0x0C80 Time = N * 1.25 msec Time Range: 7.5 msec to 4 seconds. 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use conn_latency - Connection Latency : N = 0xXXXX Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F4 supervision_tout - Supervision Timeout : N = 0xXXXX Supervision timeout for the LE Link. Range: 0x000A to 0x0C80 Time = N * 10 msec Time Range: 100 msec to 32 seconds 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use min_ce_length - Min Connection Event Length : N=0xXXXX The minimum length of connection event recommended for this LE connection. Range: 0x0000 to 0xFFFF Time = N * 0.625 msec max_ce_length - Max Connection Event Length : N=0xXXXX The maximum length of connection event recommended for this LE connection. Range: 0x0000 to 0xFFFF Time = N * 0.625 msec |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments
Note
Refer Error Codes section for above error codes Error Codes .
611
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_connect_cancel#
int32_t rsi_ble_connect_cancel (int8_t * remote_dev_address)
Cancel the connection to the remote BLE device. This is a blocking API. A received event rsi_ble_on_disconnect_t indicates disconnect complete.
[in] | remote_dev_address | - This parameter describes the device address of the remote device |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments 0x4E02 - Unknown Connection Identifier
Note
Refer Error Codes section for above error codes Error Codes .
637
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_disconnect#
int32_t rsi_ble_disconnect (int8_t * remote_dev_address)
Disconnect with the remote BLE device. This is a Blocking API.
[in] | remote_dev_address | - This parameter describes the device address of the remote device |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
668
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_get_device_state#
int32_t rsi_ble_get_device_state (uint8_t * resp)
Get the local device state. This is a Blocking API. The state value is filled in "resp".
[out] | resp | - This is an output parameter which consists of local device state. This is a 1-byte value. The possible states are described below BIT(0) Advertising state BIT(1) Scanning state BIT(2) Initiating state BIT(3) Connected state |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
700
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_smp_pairing_cap_data#
int32_t rsi_ble_set_smp_pairing_cap_data (rsi_ble_set_smp_pairing_capabilty_data_t * smp_pair_cap_data)
Set the SMP Pairing Capability of local device. This is a Blocking API.
[in] | smp_pair_cap_data | - This structure pointer holds the information of the SMP capability data values please refer rsi_ble_set_smp_pairing_capabilty_data structure for more info |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
719
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_local_irk_value#
int32_t rsi_ble_set_local_irk_value (uint8_t * l_irk)
Set the IRK value to the local device. This is a Blocking API.
[in] | l_irk | - l_irk Pointer to local_irk |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
736
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_conn_param_resp#
int32_t rsi_ble_conn_param_resp (uint8_t * remote_dev_address, uint8_t status)
Give the response for the remote device connection parameter request. This is a Blocking API A received event rsi_ble_on_conn_update_complete_t indicates connection update procedure is successful.
[in] | remote_dev_address | - remote device address |
[in] | status | - accept or reject the connection parameters update request 0 - ACCEPT, 1 - REJECT |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments 0x4E02 - Unknown Connection Identifier
Note
Refer Error Codes section for above error codes Error Codes .
766
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_smp_pair_request#
int32_t rsi_ble_smp_pair_request (uint8_t * remote_dev_address, uint8_t io_capability, uint8_t mitm_req)
Request the SMP pairing process with the remote device. This is a Blocking API A received event rsi_ble_on_smp_request_t indicated remote device is given Security Request and need to respond back with rsi_ble_smp_pair_request A received event rsi_ble_on_smp_response_t indicated remote device is given SMP Pair Request and need to respond back with rsi_ble_smp_pair_response A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
[in] | remote_dev_address | - This is the remote device address |
[in] | io_capability | - This is the device input output capability 0x00 - Display Only 0x01 - Display Yes/No 0x02 - Keyboard Only 0x03 - No Input No Output |
[in] | mitm_req | - MITM enable/disable 0 - Disable 1 - Enable |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
814
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_smp_pair_failed#
int32_t rsi_ble_smp_pair_failed (uint8_t * remote_dev_address, uint8_t reason)
Send SMP pairing failure reason to the remote device.
[in] | remote_dev_address | - This is the remote device address |
[in] | reason | - This is the reason for SMP Pairing Failure 0x05 - Pairing Not Supported 0x08 - Unspecified Reason 0x09 - Repeated Attempts |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
852
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_ltk_req_reply#
int32_t rsi_ble_ltk_req_reply (uint8_t * remote_dev_address, uint8_t reply_type, uint8_t * ltk)
Send the local long term key of its associated local EDIV and local Rand. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
[in] | remote_dev_address | - remote device address |
[in] | reply_type | - 0 - Negative reply BIT(0) - Positive Reply (Encryption Enabled) BIT(1) - Un authenticated LTK or STK based Encyption Enabled BIT(2) - Authenticated LTK or STK based Encyption Enabled BIT(3) - Auntenticated LTK with LE Secure Connections based Encryption Enabled BIT(4) to BIT(6) - Reserved for Future use BIT(7) - LE Secure Connection Enabled |
[in] | ltk | - Long Term Key 16 bytes |
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
894
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_smp_pair_response#
int32_t rsi_ble_smp_pair_response (uint8_t * remote_dev_address, uint8_t io_capability, uint8_t mitm_req)
Send SMP pairing response during the process of pairing with the remote device. This is a Blocking API A received event rsi_ble_on_smp_passkey_t indicated Legacy SMP passkey is received and need to respond back with rsi_ble_smp_passkey() A received event rsi_ble_on_sc_passkey_t indicated BLE SC passkey is received and need to respond back with rsi_ble_smp_passkey() A received event rsi_ble_on_smp_passkey_display_t indicates SMP passkey display is received from the module A received event rsi_ble_on_smp_failed_t indicated SMP Failed event is received.
[in] | remote_dev_address | - This is the remote device address |
[in] | io_capability | - This is the device input output capability 0x00 - Display Only 0x01 - Display Yes/No 0x02 - Keyboard Only 0x03 - No Input No Output |
[in] | mitm_req | - MITM Request info 0 - Disable 1 - Enable |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
945
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_smp_passkey#
int32_t rsi_ble_smp_passkey (uint8_t * remote_dev_address, uint32_t passkey)
Send SMP passkey during SMP pairing process with the remote device. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed
[in] | remote_dev_address | - This is the remote device address |
[in] | passkey | - This is the key required in pairing process |
Call rsi_ble_smp_pair_request and rsi_ble_smp_pair_response before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
984
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_get_le_ping_timeout#
int32_t rsi_ble_get_le_ping_timeout (uint8_t * remote_dev_address, uint16_t * time_out)
Get the timeout value of the LE ping. This is a Blocking API.
[in] | remote_dev_address | - This is the remote device address |
[out] | time_out | - This a response parameter which holds timeout value for authentication payload command. |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
Currently Get ping is not supported.
1018
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_le_ping_timeout#
int32_t rsi_ble_set_le_ping_timeout (uint8_t * remote_dev_address, uint16_t time_out)
Set the timeout value of the LE ping. This is a Blocking API A received event of rsi_ble_on_le_ping_payload_timeout_t indicates le ping payload timeout expired.
[in] | remote_dev_address | - This is the remote device address |
[out] | time_out | - This input parameter sets timeout value for authentication payload command.(in milliseconds) |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
1057
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_clear_acceptlist#
int32_t rsi_ble_clear_acceptlist (void )
Clear all the BD address present in accept list. This is a Blocking API.
[in] |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1085
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_addto_acceptlist#
int32_t rsi_ble_addto_acceptlist (int8_t * dev_address, uint8_t dev_addr_type)
Add BD address to accept list. This is a Blocking API.
[in] | dev_address | - Address of the device which is going to add in accept list |
[in] | dev_addr_type | - address type of BD address |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Maximum number of device address that firmware can store is 10. Refer Error Codes section for above error codes Error Codes .
1108
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_deletefrom_acceptlist#
int32_t rsi_ble_deletefrom_acceptlist (int8_t * dev_address, uint8_t dev_addr_type)
Delete particular BD address from accept list. This is a Blocking API.
[in] | dev_address | - Address of the device which is going to delete from accept list |
[in] | dev_addr_type | - address type of BD address |
rsi_ble_addto_acceptlist() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1137
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_resolvlist#
int32_t rsi_ble_resolvlist (uint8_t process_type, uint8_t remote_dev_addr_type, uint8_t * remote_dev_address, uint8_t * peer_irk, uint8_t * local_irk)
resolvlist api used for multiple purpose based on the process type. It will be used to add/remove/clear a device to/from the list. This is a Blocking API
[in] | process_type | - Indicates which type of process this is, as follows: 1 - add a device to the resolve list 2 - remove a device from the resolve list 3 - clear the entire resolve list |
[in] | remote_dev_addr_type | - typr of the remote device address |
[in] | remote_dev_address | - remote device address 0 - Public identity address 1 - Random (static) identity address |
[in] | peer_irk | - 16-byte IRK of the peer device |
[in] | local_irk | - 16-byte IRK of the local device |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1179
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_get_resolving_list_size#
int32_t rsi_ble_get_resolving_list_size (uint8_t * resp)
Request to get resolving list size. This is a Blocking API.
[out] | resp | - output parameter which consists of supported resolving the list size. |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 : Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1219
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_addr_resolution_enable#
int32_t rsi_ble_set_addr_resolution_enable (uint8_t enable, uint16_t tout)
Request to enable address resolution, and to set resolvable private address timeout. This is a Blocking API.
[in] | enable | - value to enable/disable address resolution 1 - enables address resolution 0 - disables address resolution |
[in] | tout | - the period for changing address of our local device in seconds Value ranges from 0x0001 to 0xA1B8 (1s to approximately 11.5 hours) |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 : Buffer not available to serve the command
1242
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_privacy_mode#
int32_t rsi_ble_set_privacy_mode (uint8_t remote_dev_addr_type, uint8_t * remote_dev_address, uint8_t privacy_mode)
Request to set privacy mode for particular device. This is a Blocking API.
[in] | remote_dev_addr_type | - type of the remote device address 0 - Public Identity Address 1 - Random (static) Identity Address |
[in] | remote_dev_address | - remote device address |
[in] | privacy_mode | - type of the privacy mode 0 - Network privacy mode 1 - Device privacy mode |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 : Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1274
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_readphy#
int32_t rsi_ble_readphy (int8_t * remote_dev_address, rsi_ble_resp_read_phy_t * resp)
Reads the TX and RX PHY rates of the Connection. This is a Blocking API.
[in] | remote_dev_address | - remote device address |
[out] | resp | - pointer to store the response please refer rsi_ble_resp_read_phy_s structure for more info. |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
1299
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_setphy#
int32_t rsi_ble_setphy (int8_t * remote_dev_address, uint8_t tx_phy, uint8_t rx_phy, uint16_t coded_phy)
Set TX and RX PHY. This is a Blocking API A received event rsi_ble_on_phy_update_complete_t indicates phy rate update complete.
[in] | remote_dev_address | - remote device address |
[in] | tx_phy | - transmit phy rate BIT(0) - Host prefers to use the LE 1M transmitter PHY (possibly among others) BIT(1) - Host prefers to use the LE 2M transmitter PHY (possibly among others) BIT(2) - Host prefers to use the LE Coded transmitter PHY (possibly among others) BIT(3) - BIT(7) Reserved for future use |
[in] | rx_phy | - receive phy rate BIT(0) - Host prefers to use the LE 1M receiver PHY (possibly among others) BIT(1) - Host prefers to use the LE 2M receiver PHY (possibly among others) BIT(2) - Host prefers to use the LE Coded receiver PHY (possibly among others) BIT(3) - BIT(7) Reserved for future use |
[in] | coded_phy | - TX/RX coded phy rate 0 = Host has no preferred coding when transmitting on the LE Coded PHY 1 = Host prefers that S=2 coding be used when transmitting on the LE Coded PHY 2 = Host prefers that S=8 coding be used when transmitting on the LE Coded PHY 3 = Reserved for future use |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
1344
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_conn_params_update#
int32_t rsi_ble_conn_params_update (uint8_t * remote_dev_address, uint16_t min_int, uint16_t max_int, uint16_t latency, uint16_t timeout)
Requests the connection parameters change with the remote device. When the Silabs device is acting as a master, this API is used to update the connection parameters. When the Silabs device is acts as a slave, this API is used to request the master to intiate the connection update procedure. This is a Blocking API A received event rsi_ble_on_conn_update_complete_t indicates connection parameters update complete.
[in] | remote_dev_address | - remote device address |
[in] | min_int | - minimum value for the connection interval. this shall be less than or equal to max_int . |
[in] | max_int | - maximum value for the connection interval. this shall be greater than or equal to min_int. |
[in] | latency | - slave latency for the connection in number of connection events. Ranges from 0 to 499 |
[in] | timeout | - supervision timeout for the LE Link. Ranges from 10 to 3200 (Time = N * 10 ms, Time Range: 100 ms to 32 s) |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - Success Non-Zero Value - Failure 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
min_int and max_int values ranges from 6 to 3200 (Time = N * 1.25 ms, Time Range: 7.5 ms to 4 s) latency : If latency value is greater than 32 ,Limiting the slave latency value to 32 Max supported slave latency is 32 when Device is in Slave Role.
1396
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_set_data_len#
int32_t rsi_ble_set_data_len (uint8_t * remote_dev_address, uint16_t tx_octets, uint16_t tx_time)
Sets the TX octets and the TX time of specified link (remote device connection). This is a Blocking API. A received event rsi_ble_on_data_length_update_t indicates data length update complete.
[in] | remote_dev_address | - remote device device |
[in] | tx_octets | - preferred maximum number of payload octets that the local Controller should include in a single Link Layer packet on this connection. |
[in] | tx_time | - preferred maximum number of microseconds that the local Controller should use to transmit a single Link Layer packet on this connection. |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - LE_Set_Data_Length command succeeded. Non-Zero Value - Failure 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
1445
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_read_max_data_len#
int32_t rsi_ble_read_max_data_len (rsi_ble_read_max_data_length_t * blereaddatalen)
reads the max supported values of TX octets, TX time, RX octets and Rx time. This is a Blocking API
[out] | blereaddatalen | - pointer to structure variable, Please refer rsi_ble_resp_read_max_data_length_s structure for more info. |
rsi_ble_connect() API needs to be called before this API.
Returns
0 - command success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
1472
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_vendor_rf_type#
int32_t rsi_ble_vendor_rf_type (uint8_t ble_power_index)
Issue a vendor-specific command to set the RF type in the controller on given inputs. This is a Blocking API.
[in] | ble_power_index | - power index |
Call rsi_wireless_init() before calling this API
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command
Note
Refer Error Codes section for above error codes Error Codes .
1627
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_accept_list_using_adv_data#
int32_t rsi_ble_accept_list_using_adv_data (uint8_t enable, uint8_t data_compare_index, uint8_t len_for_compare_data, uint8_t * payload)
Give vendor-specific command to set the acceptlist feature based on the advertisers advertising payload. This is a Blocking API.
[in] | enable | - enable/disable |
[in] | data_compare_index | - From which index onwards compare |
[in] | len_for_compare_data | - total length of data to compare |
[in] | payload | - Payload |
Call rsi_wireless_init() before calling this API.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E62 Invalid Parameters
Note
Refer Error Codes section for above error codes Error Codes .
1660
of file bluetooth/rsi_ble_gap_apis.c
BT_LE_ADPacketExtract#
void BT_LE_ADPacketExtract (uint8_t * remote_name, uint8_t * pbuf, uint8_t buf_len)
Used to extract remote Bluetooth device name from the received advertising report.
[in] | remote_name | - device name |
[in] | pbuf | - advertise data packet buffer pointer |
[in] | buf_len | - buffer length |
Call rsi_wireless_init() before calling this API.
Returns
void
1694
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_update_directed_address#
void rsi_ble_update_directed_address (uint8_t * remote_dev_addr)
Update the direct address with the remote device address. This is a Blocking API.
[in] | remote_dev_addr | - Remote device BD address |
Call rsi_wireless_init() before calling this API.
Returns
void
1740
of file bluetooth/rsi_ble_gap_apis.c
rsi_ble_start_encryption#
int32_t rsi_ble_start_encryption (uint8_t * remote_dev_address, uint16_t ediv, uint8_t * rand, uint8_t * ltk)
Start the encryption process with the remote device. This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption. A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
[in] | remote_dev_address | - Remote BD address in string format |
[in] | ediv | - remote device ediv value. |
[in] | rand | - remote device rand value. |
[in] | ltk | - remote device ltk value. |
Encryption enabled event should come before calling this API for second time SMP connection.
Returns
0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected
Note
Refer Error Codes section for above error codes Error Codes .
1775
of file bluetooth/rsi_ble_gap_apis.c