Is there a way to know when the BLE actually does a notification?

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

cross mob
EyGe_3183606
Level 4
Level 4
25 replies posted 10 sign-ins 10 replies posted

Hi,

I have PSOC 4.

My question is if there is a way to know when the BLE actually does a notification?

I mean, currently, the function CyBle_GattsNotification is non blocking which means that when the function returns it does not mean that a notification was actually sent.

That means that even if I get CYBLE_ERROR_OK returned, I don't know that the notification actually occurred.

Is there a way (like in case of broadcast) to assign a callback function to get an interrupt once the notification is sent so that I know it was sent and when it was sent?

Thanks

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

Hello EyGe_3183606 ,

As per the BLE specification, BLE Data packets sent through BLE notification are not acknowledged in the application layer. When you use notifications, there will not be any acknowledgment in the application layer, but there will be acknowledgment in the link layer. This means that when the peer sends the packets, the next packet will not be sent unless the sender receives an acknowledgement at the link layer. This ensures that there are no missing packets.

For acknowledgement, you can use Indication instead of Notification. For indication, the sender will call the API CyBle_GattsIndication() api and at the GATT Client's end CYBLE_EVT_GATTC_HANDLE_VALUE_IND event will be received. The client should respond back to the server when the data is received by calling an API CyBle_GattcConfirmation(). This function call results in CYBLE_EVT_GATTS_HANDLE_VALUE_CNF event at the GATT Server's end.

Thanks,
P Yugandhar.

View solution in original post

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

Hello EyGe_3183606 ,

As per the BLE specification, BLE Data packets sent through BLE notification are not acknowledged in the application layer. When you use notifications, there will not be any acknowledgment in the application layer, but there will be acknowledgment in the link layer. This means that when the peer sends the packets, the next packet will not be sent unless the sender receives an acknowledgement at the link layer. This ensures that there are no missing packets.

For acknowledgement, you can use Indication instead of Notification. For indication, the sender will call the API CyBle_GattsIndication() api and at the GATT Client's end CYBLE_EVT_GATTC_HANDLE_VALUE_IND event will be received. The client should respond back to the server when the data is received by calling an API CyBle_GattcConfirmation(). This function call results in CYBLE_EVT_GATTS_HANDLE_VALUE_CNF event at the GATT Server's end.

Thanks,
P Yugandhar.