Is there an event to indicate BLE transmition complete

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

cross mob
AlAd_4179981
Level 1
Level 1
First like given Welcome!

Hi,

I was wondering is there an event or any way to indicate BLE tx transmission complete.

for example when a peripheral device sends a notification, how to know that the tx transmission complete.

regards,

Ali

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Ali,

In BLE all the transmission is done in link layer. The link layer has the buffer which stores the data to be transmitted and the instructions. So the application layer APIs will not know whether the data is transmitted or not. The reason is the 

You can do following thing:

1. Use Indication instead of Notification. For indicaton, the sender will call the API Cy_BLE_GATTS_SendIndication() and

the receiver(Client) will get an event  CY_BLE_EVT_GATTC_HANDLE_VALUE_IND . The client should respond back to the server when the data is received by calling an API Cy_BLE_GATTC_SendConfirmation. At Server side you will get another event CY_BLE_EVT_GATTS_HANDLE_VALUE_CNF that the data is successfully reached at Client side.

Using this ways the sender will know whether the data reached safely of not.

Please refer PDL--> BLE Middleware library for more information.

You can also see WriteWithoutresponse API for GATT Client which is actually a blocking API where the API result is success only after the transmission. Unfortunately there is no blocking API for Notification or Indication.

Thanks

Ganesh

View solution in original post

1 Reply
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Ali,

In BLE all the transmission is done in link layer. The link layer has the buffer which stores the data to be transmitted and the instructions. So the application layer APIs will not know whether the data is transmitted or not. The reason is the 

You can do following thing:

1. Use Indication instead of Notification. For indicaton, the sender will call the API Cy_BLE_GATTS_SendIndication() and

the receiver(Client) will get an event  CY_BLE_EVT_GATTC_HANDLE_VALUE_IND . The client should respond back to the server when the data is received by calling an API Cy_BLE_GATTC_SendConfirmation. At Server side you will get another event CY_BLE_EVT_GATTS_HANDLE_VALUE_CNF that the data is successfully reached at Client side.

Using this ways the sender will know whether the data reached safely of not.

Please refer PDL--> BLE Middleware library for more information.

You can also see WriteWithoutresponse API for GATT Client which is actually a blocking API where the API result is success only after the transmission. Unfortunately there is no blocking API for Notification or Indication.

Thanks

Ganesh