BLE android notifications read

牧云@^-^@ 提交于 2020-01-07 04:41:11

问题


I'm experiencing an android application on Android Studio.

I'm actually able to enable and receive notifications or characteristics reads without problem.

Where I'm a bit stuck it's when I read characteristics (by button) if notifications are enable. In my application the data from characteristics reading is right on a case and the notification's data on an other case. But when I read characteristics when notifications are enable, sometimes data exchange their places.

I tried to put a global variable which take a value on the ChangeValue Callback but it's not working all the time.

All of my new data is going on the class:

private final BroadcastReceiver mGattUpdateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) {

So here is my question, how to differentiate both data on this function?

来源:https://stackoverflow.com/questions/43781902/ble-android-notifications-read

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!