This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem with Application based on "MasterEmulator->ProximityDemo"

HI, I wrote my application based on "MasterEmulator->ProximityDemo" for testing device with nrf51822. My device have to switching between Gazell and BLE stacks so all the time BLE is breaking. The problem is that when i read data from pipe using PC application sometimes app was stick for a 30s. Those behavior making imposible to develop application for stress testing my device. Debug info attached below.

Regards, Firas

LOG: Data read on pipe number 1: 0x00 0x04 0x00 0x00 0x08 3235;09:32:10.4740 [] Data read on pipe number 1: 0x00 0x04 0x00 0x00 0x08 3236;09:32:10.6850 [ReadPacketQueueThread] Serial port read: 04-05-04-00-00-00-13 3238;09:32:10.6950 [ReadPacketQueueThread] HCI event: BTLE_EVENT_DISCONNECTION_COMPLETE ConnectionHandle: 0x0000, Reason: BTLE_REMOTE_USER_TERMINATED_CONNECTION 3239;09:32:10.6970 [ReadPacketQueueThread] Received LL Connection Termination Event, reason 13 3240;09:32:10.6980 [ReadPacketQueueThread] Lost connection to device 3237;09:32:10.6940 [] GATT: Sending Read Request on Characteristic Value uuid 0x5A401527AB2E2548C43508C300000710 on handle=001D 3241;09:32:10.7010 [] WRITE DATA PACKET:03-00-04-00-0A-1D-00 3242;09:32:10.7010 [] Sending packet: AttReadRequest, 0A-1D-00, Handle: 0x001D 3243;09:32:10.7020 [] Serial port write: 02-00-00-07-00-03-00-04-00-0A-1D-00 3244;09:32:10.7030 [] Data buffer queue length (+1): 1 3245;09:32:10.7030 [] Number of data packets sent: 214 3246;09:32:10.7350 [] SERVER: Received packet - 3247;09:32:10.7370 [] SERVER: Received Link Loss The thread 0x1388 has exited with code 259 (0x103). The thread 0x1228 has exited with code 259 (0x103). 3248;09:32:40.8127 [] GATT: Received None - None A first chance exception of type 'IronPython.Runtime.Exceptions.PythonException' occurred in emulatorlibs.dll A first chance exception of type 'IronPython.Runtime.Exceptions.PythonException' occurred in emulatorlibs.dll LOG: Connecting 3249;09:32:41.1197 [] Connecting 3250;09:32:41.1207 [] Enter Connect

Parents
  • The problem seems to be caused by a race condition between an outbound ATT request and an inbound disconnect event. The ATT request gets sent just as the link has been terminated, and MCP keeps waiting for up to 30 seconds for the response which obviously never gets received as the link is terminated. Latest version of Master Control Panel, v3.6.0, includes an improvement that should cover the issue you are seeing.

Reply
  • The problem seems to be caused by a race condition between an outbound ATT request and an inbound disconnect event. The ATT request gets sent just as the link has been terminated, and MCP keeps waiting for up to 30 seconds for the response which obviously never gets received as the link is terminated. Latest version of Master Control Panel, v3.6.0, includes an improvement that should cover the issue you are seeing.

Children
Related