- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In short: the API does not seem to generate a failure event in case of a write during connection loss.
Flow:
After connection established, I shutdown the peer device.
Following that, I write WriteCharacteristic onto the inactive peer device, (I get no error on the write function itself.)
Setting a timeout of 33 seconds, (32 is max on most devices)
Listening to the OnCharacteristicWrite event for all timeout duration, according to documentation this one should tell me if the write was done.
Timeout ends, I never get an event saying write failed, nothing from the dongle is indicating an issue.
Is there someway to verify connection is lost via GAP/GATT, or I must assume connection lost on retry?
Help me out guys!
Thanks!
This is following my attempts to find a solution to:
https://community.infineon.com/t5/PSoC-4/In-CySmart-API-getting-a-CONNECTION-TIMEOUT-event/td-p/3450...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @D_Sd_3235936 ,
Once the BLE devices are connected and after connection, if no data is transferring between the devices(Master and slave) then empty packets will be transferred for every connection interval in order to keep the connection. If you shutdown the peripheral device then the central device will keeps on sending the empty packets until the supervision timeout occurs, and due to no response from the peripheral device, the central device will be disconnected after supervision timeout. So, if you send the write request then you won't receive a write failed event instead you will receive the 'Connection Terminated Notification' event with CONNECTION_TIMEOUT reason in the cysmart app.
Please refer to the attached BLE Air logs(I set the connection interval to 7.5ms and super vision timeout to 5seconds at the central side). From the air logs, you can observe that the Central device sending the empty packets until the super vision timeout (5 seconds) occurs.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'Connection Terminated Notification' event with CONNECTION_TIMEOUT .
I am looking for that event in the API reference guide , but was not able to find it.
How do I get it?
What function invokes it?
The CySmart App is defiantly receiving it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
ICyBleMgr: BLE Manager Provides APIs to scan, connect and to perform other GAP central operations. For the disconnection, cyApiErr Disconnect (ICyBleDevice device) is used to disconnect from a BLE device. Please refer to the Page 54 & 173 for more information.
Please refer to the attached Cysmart sample code.
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, ,
Neither me or the peer device sends a disconnect.
Connection is lost due to peer device shut down.
API does not indicate anything in that case.
Can you please verify the code example get any indication on peer device
being shutdown (after connection) ?
When using CySmart it is immediately indicates TIMEOUT event. How does
CySmart 1.3 know? Can you look at it code ? Can you provide the code?
Does CySmart even uses the API/DLL? If so can you look at the event it uses
for connection timeout?
It is very important to us to know if link is dead as we are uploading FW
via FOTA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I went through the attached example and unfortunately it does not support disconnection event.
Is there another example available? that supports all the events of the API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer to the below thread.
Thanks,
P Yugandhar.