IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Contributor II

I am writing an application for the 20732S in which my slave sends a series of notifications to the master.

The connection is established OK, and it works fine for a while, once per second sending 2 or 3 notification messages, and then sending nothing for about 1 second.  The data is received OK on the master.  (In this case it is a galaxy S3).  The connection interval is the standard rate, about 50 ms. Between each set of notifications there are about 19 empty connection intervals.

I can see the connection on a sniffer and I can see the packets being transmitted.  However, after a while, just as the next set of notifications is about to be sent, the connection breaks down.  The Master continues to attempt to send an empty PDU on each connection interval, but no response is sent anymore by the slave device.  Neither side of the connection seems to be aware that the connection has broken down.  On the android side I have a timeout that tries to close the connection but the empty PDUs keep being sent from the master.  On the tag side, everything appears to be fine as well - my code continues to push notifications and the connection down callback does not get called until much later it is eventually called.  Note that I have the connection idle timer set to '3' (seconds I guess?), but this doesn't seem to get triggered.

So it appears that something in the stack is wedged and maybe is continuing to receive connection interval PDUs, but is failing to send any packets in response, and not tripping the connection idle timeout either.

I'm setting the connection idle timeout to 3 in the configuration structure -- not sure if this actually has any effect.  I'm not sure how I should set be setting the connection idle timer using emconinfo_setIdleConnTimeout(), and if I were to use this function, what unit is the timeout expressed in?  I could not find this documented.

Anyway - how can I debug this?  How can I tell whether the tag is receiving the PDUs and whether it is sending anything in return?  Am I setting the connection idle timer correctly and if so what should I expect it to do?  If the device is getting wedged, is there any workaround?  Is there something I might be doing to cause this?  It does appear that the failure is correlated with my code attempting to send packets.

1 Solution
Contributor II

I have not tested re-enabling interrupts with the longer crystal warmup time.

View solution in original post

5 Replies