Asynchronous Client#

Functions#

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

Indicate the local value to the remote device. This is a blocking API.

int32_t
rsi_ble_indicate_confirm(const uint8_t *dev_addr)

Send indicate confirmation to the remote device. This is a blocking API.

int32_t
rsi_ble_get_profiles_async(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 asynchronously. The rsi_ble_on_event_profiles_list_t callback function will be called after the profiles list event is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_profiles_list_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_profile_async(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_one_event_profile_by_uuid_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_one_event_profile_by_uuid_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_char_services_async(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. The rsi_ble_on_event_read_by_char_services_t callback function is called after the included service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_char_services_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_inc_services_async(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_event_read_by_inc_services_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_inc_services_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_char_value_by_uuid_async(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). The rsi_ble_on_event_read_att_value_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_att_value_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_att_descriptors_async(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_gatt_desc_val_event_t callback function is called after the attribute descriptors response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_gatt_desc_val_event_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_att_value_async(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val)

Get the attribute with a handle. The rsi_ble_on_event_read_resp_t callback function is called upon receiving the attribute value. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_multiple_att_values_async(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_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_get_long_att_value_async(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_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

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

Set the attribute value of the remote device. The rsi_ble_on_event_write_resp_t callback function is called after the attribute set action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_prepare_write_async(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_event_prepare_write_resp_t callback function is called after the prepare attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_prepare_write_resp_t or rsi_ble_on_gatt_error_resp_t.

int32_t
rsi_ble_execute_write_async(uint8_t *dev_addr, uint8_t exe_flag)

Execute the prepared attribute values. The rsi_ble_on_event_write_resp_t callback function is called after the execute attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

Function Documentation#

rsi_ble_indicate_value_sync#

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

Indicate the local value to the remote device. This is a blocking API.

Parameters
[in]dev_addr

- remote device address

[in]handle

- local attribute handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

        This will not send any confirmation event to the application instead 

        send the status as success on receiving confirmation from remote side.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE socket not available

    • 0x4E60 - Invalid Handle Range

Note


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

rsi_ble_indicate_confirm#

int32_t rsi_ble_indicate_confirm (const uint8_t * dev_addr)

Send indicate confirmation to the remote device. This is a blocking API.

Parameters
[in]dev_addr

- remote device address

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE socket not available

Note

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

  • API is required to be called from the application when the "RSI_BLE_INDICATE_CONFIRMATION_FROM_HOST" is enabled in the opermode configurations.


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

rsi_ble_get_profiles_async#

int32_t rsi_ble_get_profiles_async (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 asynchronously. The rsi_ble_on_event_profiles_list_t callback function will be called after the profiles list event is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_profiles_list_t or rsi_ble_on_gatt_error_resp_t.

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 the rsi_ble_resp_profiles_list_s structure for more details.

Note

  • p_prof_list structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


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

rsi_ble_get_profile_async#

int32_t rsi_ble_get_profile_async (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_one_event_profile_by_uuid_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_one_event_profile_by_uuid_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_profile structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


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

rsi_ble_get_char_services_async#

int32_t rsi_ble_get_char_services_async (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. The rsi_ble_on_event_read_by_char_services_t callback function is called after the included service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_char_services_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_char_services_list structure should be passed as NULL because nothing will be filled in this structure

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

Note


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

rsi_ble_get_inc_services_async#

int32_t rsi_ble_get_inc_services_async (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_event_read_by_inc_services_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_inc_services_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_inc_serv_list structure should be passed as NULL because nothing will be filled in this structure

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

Note


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

rsi_ble_get_char_value_by_uuid_async#

int32_t rsi_ble_get_char_value_by_uuid_async (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). The rsi_ble_on_event_read_att_value_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_att_value_t or rsi_ble_on_gatt_error_resp_t.

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

Note

  • p_char_val structure should be passed as NULL because nothing will be filled in this structure

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

Note


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

rsi_ble_get_att_descriptors_async#

int32_t rsi_ble_get_att_descriptors_async (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_gatt_desc_val_event_t callback function is called after the attribute descriptors response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_gatt_desc_val_event_t or rsi_ble_on_gatt_error_resp_t.

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 strcuture for more details.

    @note   p_att_desc structure should be passed as NULL because nothing will be filled in this structure 

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

Note


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

rsi_ble_get_att_value_async#

int32_t rsi_ble_get_att_value_async (uint8_t * dev_addr, uint16_t handle, rsi_ble_resp_att_value_t * p_att_val)

Get the attribute with a handle. The rsi_ble_on_event_read_resp_t callback function is called upon receiving the attribute value. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_att_val structure should be passed as NULL because nothing will be filled in this structure

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

Note


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

rsi_ble_get_multiple_att_values_async#

int32_t rsi_ble_get_multiple_att_values_async (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_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_att_vals structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


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

rsi_ble_get_long_att_value_async#

int32_t rsi_ble_get_long_att_value_async (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_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

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.

Note

  • p_att_vals structure should be passed as NULL because nothing would be filled in this structure

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

Note


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

rsi_ble_set_att_value_async#

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

Set the attribute value of the remote device. The rsi_ble_on_event_write_resp_t callback function is called after the attribute set action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

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

Note


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

rsi_ble_prepare_write_async#

int32_t rsi_ble_prepare_write_async (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_event_prepare_write_resp_t callback function is called after the prepare attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_prepare_write_resp_t or rsi_ble_on_gatt_error_resp_t.

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

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


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

rsi_ble_execute_write_async#

int32_t rsi_ble_execute_write_async (uint8_t * dev_addr, uint8_t exe_flag)

Execute the prepared attribute values. The rsi_ble_on_event_write_resp_t callback function is called after the execute attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

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

    • 0x4D05 - BLE Socket not available

Note


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