wandersnail / easyble-x

A simple framework for Android Bluetooth Low Energy (BLE)
Apache License 2.0
156 stars 37 forks source link

大神,Notify收到的值在哪里? #6

Closed ghost closed 5 years ago

ghost commented 5 years ago

大神,Notify收到的值在哪里? builder.setCallback(new NotificationChangeCallback() { @Override public void onNotificationChanged(Request request, boolean isEnabled) { } @Override public void onRequestFailed(Request request, int failType , Object value) { } }); 只有Notify的开关通知。

wandersnail commented 5 years ago

//注册观察者 EasyBLE.getInstance().registerObserver(this); //重写onCharacteristicChanged方法,即可在方法收到数据 @Override public void onCharacteristicChanged(@NonNull Device device, @NonNull UUID service, @NonNull UUID characteristic, @NonNull byte[] value) { //收到的notify数据 }