Server#
Functions#
Add a new service to the local GATT Server.
Add a new attribute to a specific service.
Get the local attribute value.
Remove the GATT service record.
Remove the GATT attribute record.
Send attribute error response for any of the att request.
Send the response to the write request received from the remote device.
Function Documentation#
rsi_ble_add_service#
int32_t rsi_ble_add_service (uuid_t service_uuid, rsi_ble_resp_add_serv_t * p_resp_serv)
Add a new service to the local GATT Server.
[in] | service_uuid | - new service UUID value, please refer uuid_s structure for more info. |
[out] | p_resp_serv | - new service handler filled in this structure, please refer rsi_ble_resp_add_serv_s structure for more info. |
This is a Blocking API.
Pre-conditions:
Device should be initialized before calling this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
0x4046 - Invalid Arguments
0x4D08 - Profile record full
Note
Refer to the Status Codes section for the above error codes at additional-status-codes .
3147
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_add_attribute#
int32_t rsi_ble_add_attribute (rsi_ble_req_add_att_t * p_attribute)
Add a new attribute to a specific service.
[in] | p_attribute | - add a new attribute to the service, please refer rsi_ble_req_add_att_s structure for more info. |
This is a Blocking API.
Pre-conditions: Device should be initialized before calling this API.
Returns
The following values are returned:
0 - Success
Non-Zero Value - Failure
0x4046 - Invalid Arguments
0x4D09 - Attribute record full
Note
Refer to the Status Codes section for the above error codes at additional-status-codes .
3163
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_set_local_att_value#
int32_t rsi_ble_set_local_att_value (uint16_t handle, uint16_t data_len, const uint8_t * p_data)
N/A | handle | |
N/A | data_len | |
N/A | p_data |
3192
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_set_wo_resp_notify_buf_info#
int32_t rsi_ble_set_wo_resp_notify_buf_info (const uint8_t * dev_addr, uint8_t buf_mode, uint8_t buf_cnt)
N/A | dev_addr | |
N/A | buf_mode | |
N/A | buf_cnt |
3220
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_notify_value#
int32_t rsi_ble_notify_value (const uint8_t * dev_addr, uint16_t handle, uint16_t data_len, const uint8_t * p_data)
N/A | dev_addr | |
N/A | handle | |
N/A | data_len | |
N/A | p_data |
3248
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_indicate_value#
int32_t rsi_ble_indicate_value (const uint8_t * dev_addr, uint16_t handle, uint16_t data_len, const uint8_t * p_data)
N/A | dev_addr | |
N/A | handle | |
N/A | data_len | |
N/A | p_data |
3269
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_get_local_att_value#
int32_t rsi_ble_get_local_att_value (uint16_t handle, rsi_ble_resp_local_att_value_t * p_resp_local_att_val)
Get the local attribute value.
[in] | handle | - local attribute handle |
[out] | p_resp_local_att_val | - local attribute value filled in this structure, see rsi_ble_resp_local_att_value_s structure for more info. |
This is a Blocking 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
0x4046 - Invalid Arguments
0x4D06 - Attribute record not found
Note
Refer to the Status Codes section for the above error codes at additional-status-codes
This API can only be used if the service is maintained inside the firmware. The services which are maintained by firmware must follow the below rules.
Rule 1: The attribute_data_size is less than 20 bytes during the service_creation
Rule 2: While creating the service, don't use the RSI_BLE_ATT_MAINTAIN_IN_HOST bit in the RSI_BLE_ATT_CONFIG_BITMAP macro.
3340
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_gatt_read_response#
int32_t rsi_ble_gatt_read_response (uint8_t * dev_addr, uint8_t read_type, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t * p_data)
N/A | dev_addr | |
N/A | read_type | |
N/A | handle | |
N/A | offset | |
N/A | length | |
N/A | p_data |
3367
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_remove_gatt_service#
int32_t rsi_ble_remove_gatt_service (uint32_t service_handler)
Remove the GATT service record.
[in] | service_handler | - GATT service record handle |
This is a Blocking 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
0x4D0A - BLE profile not found (profile handler invalid)
Note
Refer to the Status Codes section for the above error codes at additional-status-codes
3387
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_remove_gatt_attibute#
int32_t rsi_ble_remove_gatt_attibute (uint32_t service_handler, uint16_t att_hndl)
Remove the GATT attribute record.
[in] | service_handler | - GATT service record handle |
[in] | att_hndl | - attribute handle |
This is a Blocking 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
0x4D06 - Attribute record not found
Note
Refer to the Status Codes section for the above error codes at additional-status-codes
3403
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_att_error_response#
int32_t rsi_ble_att_error_response (uint8_t * dev_addr, uint16_t handle, uint8_t opcode, uint8_t err)
Send attribute error response for any of the att request.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute handle |
[in] | opcode | - error response opcode |
[in] | err | - specific error related Gatt |
This is a Blocking 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 to the Status Codes section for the above error codes at additional-status-codes
3423
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_gatt_write_response#
int32_t rsi_ble_gatt_write_response (uint8_t * dev_addr, uint8_t type)
Send the response to the write request received from the remote device.
[in] | dev_addr | - remote device address |
[in] | type | - response type
|
This is a Blocking 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
0x4046 - Invalid Arguments
0x4D04 - BLE not Connected
Note
Refer to the Status Codes section for the above error codes at additional-status-codes
3487
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_gatt_prepare_write_response#
int32_t rsi_ble_gatt_prepare_write_response (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t * data)
N/A | dev_addr | |
N/A | handle | |
N/A | offset | |
N/A | length | |
N/A | data |
3511
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h