Read notifications when a button is pressed in a BLE device

A few days ago I wrote this question: Can strokes be detected in MiBand 2?

I found using Wireshark that when a MiBand button is clicked, the group sends the UUID to the mobile device.

I modified this sample https://github.com/googlesamples/android-BluetoothLeGatt to capture this event and, for example, show the Toast screen. But no matter how hard I try, I’m not moving forward.

The onDescriptorRead () and onCharacteristicRead () methods are never called.

How to implement this feature using GATT in Android? Many thanks

+4
source share

Source: https://habr.com/ru/post/1670103/


All Articles