public interface EventObserver
extends cn.wandersnail.commons.observer.Observer
date: 2019/8/3 13:15 author: zengfansheng
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
onBluetoothAdapterStateChanged(int state)
蓝牙开关状态变化
|
default void |
onConnectionStateChanged(BluetoothDevice device,
int state)
连接状态变化
|
default void |
onRead(BluetoothDevice device,
byte[] value)
收到数据
|
default void |
onWrite(BluetoothDevice device,
java.lang.String tag,
byte[] value,
boolean result)
写入结果
|
default void onBluetoothAdapterStateChanged(int state)
state - BluetoothAdapter#STATE_OFF等default void onRead(@NonNull
BluetoothDevice device,
@NonNull
byte[] value)
device - 设备value - 收到的数据default void onWrite(@NonNull
BluetoothDevice device,
@NonNull
java.lang.String tag,
@NonNull
byte[] value,
boolean result)
device - 设备tag - 写入时设置的tagvalue - 要写入的数据result - 写入结果default void onConnectionStateChanged(@NonNull
BluetoothDevice device,
int state)
device - 设备state - 设备。状态Connection.STATE_CONNECTED,可能的值Connection.STATE_RELEASED等