Common APIs#
Functions#
Set the device BD address. This is blocking API.
Enable and disable BER. This is blocking API.
Set the given name to local device. This is blocking API.
Get the local device name. This is blocking API.
Get the RSSI of the remote device. This is blocking API.
Get the local device address. This is blocking API.
Get the BT stack version. This is blocking API.
Initialize the BT device. This is blocking API.
Deinitialize the BT device. This is blocking API.
Select either internal / external antenna on the chip. This is blocking API.
Enable/Disable the mentioned features. This is blocking API.
Select the power save profile mode for BT / BLE. This is blocking API.
Function Documentation#
rsi_bt_set_bd_addr#
int32_t rsi_bt_set_bd_addr (uint8_t * dev_addr)
Set the device BD address. This is blocking API.
[in] | dev_addr | - public address of the device to be set |
needs to be called immediately after rsi_wireless_init() OPERMODE command.
Returns
0 - Success Non-Zero Value - Failure -3 - Command is given in wrong state(i.e not immediate after opermode)
Note
Refer Error Codes section for above error codes Error Codes .
37
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_ber_enable_or_disable#
int32_t rsi_bt_ber_enable_or_disable (struct rsi_bt_ber_cmd_s * ber_cmd)
Enable and disable BER. This is blocking API.
[in] | ber_cmd | - pointer address which contains the command structure. Please refer rsi_bt_ber_cmd_s structure for more info |
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
57
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_set_local_name#
int32_t rsi_bt_set_local_name (uint8_t * local_name)
Set the given name to local device. This is blocking API.
[in] | local_name | - Name to be set to the local device. |
rsi_wireless_init() API need to be called before this API.
Note
For BLE alone Opermode : When the name of the local device is set to a value with length more than 16 bytes then error is returned with an error code 0x4E66.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
77
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_get_local_name#
int32_t rsi_bt_get_local_name (rsi_bt_resp_get_local_name_t * bt_resp_get_local_name)
Get the local device name. This is blocking API.
[out] | bt_resp_get_local_name | - This parameter is the response buffer to hold the response of this API. Please refer rsi_bt_resp_get_local_name_s structure for more info. |
rsi_wireless_init() API need to be called before this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
100
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_get_rssi#
int32_t rsi_bt_get_rssi (uint8_t * dev_addr, int8_t * resp)
Get the RSSI of the remote device. This is blocking API.
[in] | dev_addr | - Remote device address. |
[out] | resp | - Parameter to hold the response of this API, rssi is filled in this resp parameter. |
rsi_bt_connect() API need to be called before this API.
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
116
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_get_local_device_address#
int32_t rsi_bt_get_local_device_address (uint8_t * resp)
Get the local device address. This is blocking API.
[out] | resp | - Parameter to hold the response of this API, local bd_addr is filled in this resp parameter. |
rsi_wireless_init() 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 .
137
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_get_bt_stack_version#
int32_t rsi_bt_get_bt_stack_version (rsi_bt_resp_get_bt_stack_version_t * bt_resp_get_bt_stack_version)
Get the BT stack version. This is blocking API.
[out] | bt_resp_get_bt_stack_version | - Response buffer to hold the response of this API. Please refer rsi_bt_resp_get_bt_stack_version_s structure for more info |
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
151
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_init#
rsi_bt_init (void )
Initialize the BT device. This is blocking API.
N/A |
rsi_wireless_init() API needs to be called before this API. If the device is in powersave, get back the device to ACTIVE MODE by using rsi_bt_power_save_profile()
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
167
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_deinit#
rsi_bt_deinit (void )
Deinitialize the BT device. This is blocking API.
N/A |
rsi_wireless_init() API needs to be called before this API. If the device is in powersave, get back the device to ACTIVE MODE by using rsi_bt_power_save_profile()
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
183
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_set_antenna#
int32_t rsi_bt_set_antenna (uint8_t antenna_value)
Select either internal / external antenna on the chip. This is blocking API.
[in] | antenna_value | - Parameter is used to select either internal or external antenna. Possible values: 0x00 RSI_SEL_INTERNAL_ANTENNA 0x01 RSI_SEL_EXTERNAL_ANTENNA |
rsi_wireless_init() 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 .
200
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_set_antenna_tx_power_level#
int32_t rsi_bt_set_antenna_tx_power_level (uint8_t protocol_mode, int8_t tx_power)
Enable/Disable the mentioned features. This is blocking API.
[in] | protocol_mode | - protocol mode 1 - BT classic 2 - BT Low Energy |
[in] | tx_power | - power value Antenna transmit power level Default Value for BLE Tx Power Index is 31, The range for the BLE Tx Power Index is 1 to 75 (0, 32 indexes are invalid) Default tx power index for BT classic is 14 1 - 31 0DBM Mode. 33 - 63 10DBM Mode. 64 - 75 HP Mode. |
rsi_wireless_init() API need to be called before this API
Note
The default value will vary based on country region and board
Returns
0 - Success Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes Error Codes .
254
of file bluetooth/rsi_bt_common_apis.c
rsi_bt_power_save_profile#
int32_t rsi_bt_power_save_profile (uint8_t psp_mode, uint8_t psp_type)
Select the power save profile mode for BT / BLE. This is blocking API.
[in] | psp_mode | Following psp_mode is defined. 0 - RSI_ACTIVE. In this mode module is active and power save is disabled. 1 - RSI_SLEEP_MODE_1. On mode. In this sleep mode, SoC will never turn off, therefore no handshake is required before sending data to the module. BT/BLE does not support this mode. 2 - RSI_SLEEP_MODE_2. Connected sleep mode. In this sleep mode, SoC will go to sleep based on GPIO or Message, therefore handshake is required before sending data to the module. 8 - RSI_SLEEP_MODE_8. Disconnected sleep mode. In this sleep mode, module will turn off the SoC. Since SoC is turn off, therefore handshake is required before sending data to the module. |
[in] | psp_type | Following psp_type is defined. 0 - RSI_MAX_PSP. This psp_type will be used for max power saving 1 - Fast PSP 2 - UAPSD |
rsi_wireless_init() 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 .
psp_type is only valid in psp_mode 2. BT/BLE doesnot support in RSI_SLEEP_MODE_1. BT/BLE supports only RSI_MAX_PSP mode. Remaining modes are not supported.
298
of file bluetooth/rsi_bt_common_apis.c