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.

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)
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)
int32_t
rsi_ble_set_att_cmd(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)
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)
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)
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#

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.

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


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


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

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


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


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


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


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


Definition at line 2949 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)
Parameters
N/Adev_addr
N/Anum_of_handlers
N/Ahandles
N/Ap_att_vals

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


Definition at line 2998 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)
Parameters
N/Adev_addr
N/Ahandle
N/Adata_len
N/Ap_data

Definition at line 3022 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)
Parameters
N/Adev_addr
N/Ahandle
N/Adata_len
N/Ap_data

Definition at line 3046 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)
Parameters
N/Adev_addr
N/Ahandle
N/Aoffset
N/Adata_len
N/Ap_data

Definition at line 3071 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)
Parameters
N/Adev_addr
N/Ahandle
N/Aoffset
N/Adata_len
N/Ap_data

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

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


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

  • 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


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

  • 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

Note


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