Synchronous Client#
Functions#
Get the supported profiles / services of the connected remote device.
Get the specific profile / service of the connected remote device.
Get the service characteristic services of the connected / remote device.
Get the supported include services of the connected / remote device.
Get the characteristic value by UUID (char_uuid).
Get the characteristic descriptors list from the remote device.
Get the attribute by handle.
Get the multiple attribute values by using multiple handles.
Get the long attribute value by using handle and offset.
Set the attribute value of the remote device.
Set the attribute value without waiting for an ACK from the remote device.
Set the long attribute value of the remote device.
Prepare the attribute value.
Execute the prepared attribute values.
Initiates the MTU exchange request with the remote device.
This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.
Function Documentation#
rsi_ble_get_profiles#
nt32_t rsi_ble_get_profiles (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_profiles_list_t * p_prof_list)
Get the supported profiles / services of the connected remote device.
[in] | dev_addr | - remote device address |
[in] | start_handle | - start handle (index) of the remote device's service records |
[in] | end_handle | - end handle (index) of the remote device's service records |
[out] | p_prof_list | - profiles/services information will be filled in this structure after retrieving from the remote device, please refer rsi_ble_resp_profiles_list_s structure for more info. |
rsi_ble_on_profiles_list_resp_t callback function will be called after the profiles list response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_profiles_list_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3141
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_profile#
int32_t rsi_ble_get_profile (uint8_t * dev_addr, uuid_t profile_uuid, profile_descriptors_t * p_profile)
Get the specific profile / service of the connected remote device.
[in] | dev_addr | - remote device address |
[in] | profile_uuid | - services/profiles which are searched using profile_uuid |
[out] | p_profile | - profile / service information filled in this structure after retrieving from the remote device, please refer profile_descriptor_s structure for more info. |
rsi_ble_on_profile_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_profile_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3171
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_char_services#
int32_t rsi_ble_get_char_services (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_char_services_t * p_char_serv_list)
Get the service characteristic services of the connected / remote device.
[in] | dev_addr | - remote device address |
[in] | start_handle | - start handle (index) of the remote device's service records |
[in] | end_handle | - end handle (index) of the remote device's service records |
[out] | p_char_serv_list | - service characteristics details are filled in this structure, please refer rsi_ble_resp_char_serv_s structure for more info. |
rsi_ble_on_char_services_resp_t callback function is called after the characteristic service response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_char_services_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3199
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_inc_services#
int32_t rsi_ble_get_inc_services (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_inc_services_t * p_inc_serv_list)
Get the supported include services of the connected / remote device.
[in] | dev_addr | - remote device address |
[in] | start_handle | - start handle (index) of the remote device's service records |
[in] | end_handle | - end handle (index) of the remote device's service records |
[out] | p_inc_serv_list | - include service characteristics details are filled in this structure, please refer rsi_ble_resp_inc_serv structure for more info. |
rsi_ble_on_inc_services_resp_t callback function is called after the include service response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_inc_services_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3230
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_char_value_by_uuid#
int32_t rsi_ble_get_char_value_by_uuid (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, uuid_t char_uuid, rsi_ble_resp_att_value_t * p_char_val)
Get the characteristic value by UUID (char_uuid).
[in] | dev_addr | - remote device address |
[in] | start_handle | - start handle (index) of the remote device's service records |
[in] | end_handle | - end handle (index) of the remote device's service records |
[in] | char_uuid | - UUID of the characteristic |
[out] | p_char_val | - characteristic value is filled in this structure, please refer rsi_ble_resp_att_value_s structure for more info. |
rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
If the return value is less than 0
Note
Refer Error Codes section for above error codes error-codes .
3264
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_att_descriptors#
int32_t rsi_ble_get_att_descriptors (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_att_descs_t * p_att_desc)
Get the characteristic descriptors list from the remote device.
[in] | dev_addr | - remote device address |
[in] | start_handle | - start handle (index) of the remote device's service records |
[in] | end_handle | - end handle (index) of the remote device's service records |
[out] | p_att_desc | - pointer to characteristic descriptor structure, Please refer rsi_ble_resp_att_descs_s structure for more info. |
rsi_ble_on_att_desc_resp_t callback function is called after the attribute descriptors response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_att_desc_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3295
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_att_value#
int32_t rsi_ble_get_att_value (uint8_t * dev_addr, uint16_t handle, rsi_ble_resp_att_value_t * p_att_val)
Get the attribute by handle.
[in] | dev_addr | - remote device address |
[in] | handle | - handle value of the attribute |
[out] | p_att_val | - attribute value is filled in this structure, Please refer rsi_ble_resp_att_value_s structure for more info. |
rsi_ble_on_read_resp_t callback function is called upon receiving the attribute value. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3321
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_multiple_att_values#
int32_t rsi_ble_get_multiple_att_values (uint8_t * dev_addr, uint8_t num_of_handlers, uint16_t * handles, rsi_ble_resp_att_value_t * p_att_vals)
Get the multiple attribute values by using multiple handles.
[in] | dev_addr | - remote device address |
[in] | num_of_handlers | - number of handles in the list |
[in] | handles | - list of attribute handles |
[out] | p_att_vals | - attribute values filled in this structure, please refer rsi_ble_resp_att_value_s structure for more info. |
rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3347
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_long_att_value#
int32_t rsi_ble_get_long_att_value (uint8_t * dev_addr, uint16_t handle, uint16_t offset, rsi_ble_resp_att_value_t * p_att_vals)
Get the long attribute value by using handle and offset.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute handle |
[in] | offset | - offset within the attribute value |
[out] | p_att_vals | - attribute value filled in this structure, please refer rsi_ble_resp_att_value_s structure for more info. |
rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3376
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_set_att_value#
int32_t rsi_ble_set_att_value (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, uint8_t * p_data)
Set the attribute value of the remote device.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute value handle |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3403
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_set_att_cmd#
int32_t rsi_ble_set_att_cmd (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, uint8_t * p_data)
Set the attribute value without waiting for an ACK from the remote device.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute value handle |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
This is a Blocking API. If the API returns RSI_ERROR_BLE_DEV_BUF_FULL (-31) error then wait until the rsi_ble_on_le_more_data_req_t event gets received from the module.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
0x4E60 - Invalid Handle range
0x4E62 - Invalid Parameters
0x4D04 - BLE not connected
0x4D05 - BLE Socket not available
0x4E65 - Invalid Attribute Length When Small Buffer Mode is Configured
Note
Refer Error Codes section for above error codes error-codes .
3435
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_set_long_att_value#
int32_t rsi_ble_set_long_att_value (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, uint8_t * p_data)
Set the long attribute value of the remote device.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute handle |
[in] | offset | - attribute value offset |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
rsi_ble_on_write_resp_t callback function is called after the attribute set action is completed. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3463
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_prepare_write#
int32_t rsi_ble_prepare_write (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, uint8_t * p_data)
Prepare the attribute value.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute handle |
[in] | offset | - attribute value offset |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
rsi_ble_on_write_resp_t callback function is called after the prepare attribute write action is completed. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3492
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_execute_write#
int32_t rsi_ble_execute_write (uint8_t * dev_addr, uint8_t exe_flag)
Execute the prepared attribute values.
[in] | dev_addr | - remote device address |
[in] | exe_flag | - execute flag to write, possible values mentioned below
|
rsi_ble_on_write_resp_t callback function is called after the execute attribute write action is completed. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
Note
Refer Error Codes section for above error codes error-codes .
3518
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_mtu_exchange_event#
int32_t rsi_ble_mtu_exchange_event (uint8_t * dev_addr, uint8_t mtu_size)
Initiates the MTU exchange request with the remote device.
[in] | dev_addr | - remote device address |
[in] | mtu_size | - requested MTU value |
This is a Blocking API and will receive a callback event rsi_ble_on_mtu_event_t as the response for this API.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API. Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure 0x4D04 - BLE not Connected
0x4E62 - Invalid Parameters
Note
Refer Error Codes section for above error codes error-codes
3942
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_mtu_exchange_resp#
int32_t rsi_ble_mtu_exchange_resp (uint8_t * dev_addr, uint8_t mtu_size)
This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.
[in] | dev_addr | - Remote Device Address |
[in] | mtu_size | - requested MTU value |
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
The following values are returned:
0 - Success
0x4D0C - When RSI_BLE_MTU_EXCHANGE_FROM_HOST BIT is not SET. 0x4D05 - BLE Socket Not Available. Non-Zero Value - Failure Refer Error Codes section for above error codes error-codes
3961
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h