I develop an app for Android Lollipop (phone) that receives data from portable device using BLE. The data from device is tranmistted via notifications. Notifications cause onCharacteristicChanged() method where the data is parsed and saved into file.
Everything may work fine for few hours. But at some random time it stops working and the log is filled by the following messages:
...
07-27 00:36:33.940 E/bt-l2cap(31622): l2cu_build_header - no buffer
07-27 00:36:33.989 E/GKI_LINUX(31622): GKI_exception(): Task State Table
07-27 00:36:33.989 E/GKI_LINUX(31622): TASK ID [0] task name [BTU] state [1]
07-27 00:36:33.989 E/GKI_LINUX(31622): TASK ID [1] task name [BTIF] state [1]
07-27 00:36:33.989 E/GKI_LINUX(31622): TASK ID [2] task name [A2DP-MEDIA] state [1]
07-27 00:36:33.989 E/GKI_LINUX(31622): GKI_exception 65524 getbuf: out of buffers
...
And then by some reasons this GKI_exception messages stop with the following line:
07-27 01:32:23.361 E/bt-btm (31622): btm_sec_disconnected - Clearing Pending flag
And after that BLE will never connect to the device until we turn BLE off and on at the phone.
How to solve it?