My data field app reads a data stream from a bike sensor using the compute(info) function, decodes the values and displays them. It works perfectly. However, when activating the data field on Garmin Edge1030, 1030plus and 1040, all current BLE and ANT+ connections to all connected sensors/devices suddenly break down at seemingly random times.
Connected sensors in testing context: Phone (BLE, no BT/EDR) + Varia eRTL515 (BLE) + Garmin Speed Sensor (ANT+) + Rotor Power/Cadence Sensor (ANT+)
This error only occurs while there is a parallel phone connection via BLE. If I switch off the phone connection on the Garmin, there are no disconnects.
The data field reads a data stream of 90-120 bytes per second from the sensor using a BLE delegate with 1 BLE profile. The data stream from the sensor pulses every second, i.e. the sensor delivers the data in blocks and then pauses briefly. The data flows in via GATT notification. MTU of the BLE connection is 20. Thus, 4-5 callbacks (OnCharacteristicChanged) occur per second, i.e. the data comes in 20-byte blocks, corresponding to MTU. In the OnChararacteristicChanged callback funtcion i add this data to a buffer (byte array). I process it via compute(info) function once per second. The size of the buffer varies between 60-160, depending on actual timing.
I used the profiler to check the runtime of the compute routine, which is approx. 12 milliseconds. The memory consumption of the data field is constant at approx. 27 KB, i.e. there is no memory leak.
Source code see here: https://github.com/cyberman54/Forumslader-Companion
I have tried many analyses to narrow down the origin of the error, but to no avail. The data field app runs without errors, there are no crashes or exceptions, nor are there any other anomalies when the connection is lost.
I tracked this down further, found lots of this error logs on the device. It seems each time the connections break, the same error log is written, and a file coredump.zip is saved.
I can provide the coredump.zip to Garmin for analysis, please contact me.
"product_name":"Edge 1030 Plus",
"system_version":"6.81",
"build_type":"PRODUCTION",
"backtrace":"BTM background - Error type ( 0 ) File( ..\\..\\..\\BTM-smart\\btm_gatts.c ) Line( 495 )",
"error_cause":"Assert",
"proprietary_info":{
"Commit ID":"af92afead6000efe1479f548c68e13d828d356c1",
"Time":"2024-6-18 15:22:20",
"Ram Dump":"N/A",
"ESht PC":"0x00000000",
"ESht SP":"0x00000000",
"Project Specific":"0x00000000",
"Fatal":"NO",
"Task ID":"62FCF4B0",
"Task Name":"BTM background",
"File Name":"..\\..\\..\\BTM-smart\\btm_gatts.c",
"Line Number":"495",
"Message":"495"
}