Synchronous Client#

Modules#

ATT_MAINTAIN_IN_HOST

Functions#

int32_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. The 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 you 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.

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. The rsi_ble_on_profile_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API, Still you 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.

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 characteristics of the connected remote device, rsi_ble_on_char_services_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API. Still you 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.

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. The 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 you 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.

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). This API retrieves the characteristic's attribute value identified by the specified UUID. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still you need to wait until the callback rsi_ble_on_read_resp_t is received to initiate further attribute related transactions such as read operation on the remote device address.

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. The 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 you 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.

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. The rsi_ble_on_read_resp_t callback function is called upon receiving the attribute value. This is a non-blocking API. Still you 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.

int32_t
rsi_ble_get_multiple_att_values(uint8_t *dev_addr, uint8_t num_of_handlers, const uint16_t *handles, rsi_ble_resp_att_value_t *p_att_vals)

Get the multiple attribute values by using multiple handles. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still you 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.

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. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still you 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.

int32_t
rsi_ble_set_att_value(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Sets the attribute value of the remote device. The rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed. This is a non-blocking API. However, you need to wait until the rsi_ble_on_write_resp_t callback is received from the device to initiate further attribute-related transactions on this remote device address.

int32_t
rsi_ble_set_att_cmd(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Set the attribute value without waiting for an ACK from the remote device. 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.

int32_t
rsi_ble_set_att_cmd_async(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Set the attribute value without waiting for an ACK from the remote device. This is a blocking API. If the API returns an RSI_ERROR_BLE_DEV_BUF_FULL (-31) error, wait until the rsi_ble_on_le_more_data_req_t event is received from the module.

int32_t
rsi_ble_set_long_att_value(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t *p_data)

Set the long attribute value of the remote device. The rsi_ble_on_write_resp_t callback function is called after the attribute set action is completed. This is a non-blocking API. Still you 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.

int32_t
rsi_ble_prepare_write(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t *p_data)

Prepare the attribute value. The 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 you 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.

int32_t
rsi_ble_execute_write(uint8_t *dev_addr, uint8_t exe_flag)

Execute the prepared attribute values. The 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 you 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.

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.

Function Documentation#

rsi_ble_get_profiles#

int32_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. The 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 you 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.

Parameters
[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, Refer to rsi_ble_resp_profiles_list_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3182 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. The rsi_ble_on_profile_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API, Still you 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.

Parameters
[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. Refer to profile_descriptor_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3209 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 characteristics of the connected remote device, rsi_ble_on_char_services_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API. Still you 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.

Parameters
[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, refer to rsi_ble_resp_char_serv_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3234 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. The 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 you 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.

Parameters
[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, refer to rsi_ble_resp_inc_serv structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3262 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). This API retrieves the characteristic's attribute value identified by the specified UUID. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still you need to wait until the callback rsi_ble_on_read_resp_t is received to initiate further attribute related transactions such as read operation on the remote device address.

Parameters
[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 which can be of sizes 128-bit, 32-bit, or 16-bit.

[out]p_char_val

- Pointer to Structure rsi_ble_resp_att_value_s , Characteristic value is filled in this structure, Structure contains length of attribute and attribute value , attribute value can be of maximum size 240 bytes.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

Note


Definition at line 3291 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. The 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 you 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.

Parameters
[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, refer to rsi_ble_resp_att_descs_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3319 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. The rsi_ble_on_read_resp_t callback function is called upon receiving the attribute value. This is a non-blocking API. Still you 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.

Parameters
[in]dev_addr

- remote device address

[in]handle

- handle value of the attribute

[out]p_att_val

- attribute value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3342 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, const uint16_t * handles, rsi_ble_resp_att_value_t * p_att_vals)

Get the multiple attribute values by using multiple handles. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still you 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.

Parameters
[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, refer to rsi_ble_resp_att_value_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3365 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. The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still you 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.

Parameters
[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, refer to rsi_ble_resp_att_value_s structure for more details.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3391 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, const uint8_t * p_data)

Sets the attribute value of the remote device. The rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed. This is a non-blocking API. However, you need to wait until the rsi_ble_on_write_resp_t callback is received from the device to initiate further attribute-related transactions on this remote device address.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3414 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, const uint8_t * p_data)

Set the attribute value without waiting for an ACK from the remote device. 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.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

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


Definition at line 3438 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_att_cmd_async#

int32_t rsi_ble_set_att_cmd_async (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, const uint8_t * p_data)

Set the attribute value without waiting for an ACK from the remote device. This is a blocking API. If the API returns an RSI_ERROR_BLE_DEV_BUF_FULL (-31) error, wait until the rsi_ble_on_le_more_data_req_t event is received from the module.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

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


Definition at line 3462 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, const uint8_t * p_data)

Set the long attribute value of the remote device. The rsi_ble_on_write_resp_t callback function is called after the attribute set action is completed. This is a non-blocking API. Still you 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.

Parameters
[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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3487 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, const uint8_t * p_data)

Prepare the attribute value. The 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 you 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.

Parameters
[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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3514 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. The 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 you 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.

Parameters
[in]dev_addr

- remote device address

[in]exe_flag

- execute flag to write, possible values mentioned below

  • 0 - BLE_ATT_EXECUTE_WRITE_CANCEL

  • 1 - BLE_ATT_EXECUTE_PENDING_WRITES_IMMEDIATELY

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3538 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.

Parameters
[in]dev_addr

- Remote Device Address

[in]mtu_size

- requested MTU value

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

Note


Definition at line 3884 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h