Synchronous Client#

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.

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.

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, 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.

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.

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).

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.

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.

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.

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.

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

Set the attribute value of the remote device, 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.

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.

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.

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.

int32_t
rsi_ble_execute_write(uint8_t *dev_addr, uint8_t exe_flag)

Execute the prepared attribute values.

int32_t
rsi_ble_mtu_exchange_event(uint8_t *dev_addr, uint8_t mtu_size)

Initiates the MTU exchange request with the remote device.

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.

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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. See profile_descriptor_s structure for more info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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 info.

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_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.

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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

[out]p_char_val

- Characteristic value is filled in this structure. See rsi_ble_resp_att_value_s structure for more info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

Note


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

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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 info.

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3367 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)

Set the attribute value of the remote device, 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.

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 3391 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.

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

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 3415 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.

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

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


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

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

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D04 - BLE not Connected

    • 0x4E62 - Invalid Parameters

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes

  • When services are maintained on the host, this API need to be triggered by the application.


Definition at line 3816 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 3833 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h