BLE Server behavior for Read Characteristic Value

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

1) About response for ignoring

When client require Read Characteristic Value, although PSoC6 server automatically send value without any application opperation, what error should I respond in case I would like to ignore the request?

2) Timing to response data from Server

When client require Read Characteristic Value, a event is trrigerd by the server side and the server send response.

When does the response happen?

is it when event happen?

is it when the event is released?

Best regards,

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

1. If we want to ignore the read request we can send error response to the client using the API Cy_BLE_GATTS_SendErrorRsp() in the server sideThis  function sends an error response to the peer device. The Error Response is used to state that a given request cannot be performed, and to provide the reason as defined in type cy_en_ble_gatt_err_code_t. we can use any of valid GATT error codes. Please refer the API in the BLE component datasheet for more information.

2. In the server, we have to continuously process the events(using Cy_BLE_ProcessEvents()). As soon as the read request event happens the server will send read response to the client.

Thanks,

P Yugandhar.

View solution in original post

0 Likes
1 Reply
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

1. If we want to ignore the read request we can send error response to the client using the API Cy_BLE_GATTS_SendErrorRsp() in the server sideThis  function sends an error response to the peer device. The Error Response is used to state that a given request cannot be performed, and to provide the reason as defined in type cy_en_ble_gatt_err_code_t. we can use any of valid GATT error codes. Please refer the API in the BLE component datasheet for more information.

2. In the server, we have to continuously process the events(using Cy_BLE_ProcessEvents()). As soon as the read request event happens the server will send read response to the client.

Thanks,

P Yugandhar.

0 Likes