Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(String mac)
→ OriginResponse
-
连接蓝牙
mac设备mac地址
返回 code 表示连接是否成功
-
dispose()
→ void
-
销毁.
原生移除各种监听. 比如扫描,监听等
-
getConnectState(String mac)
→ OriginResponse
-
主动获取当前设备连接状态
CONNECTING("CONNECTING"), CONNECTED("CONNECTED"), DISCONNECTED("DISCONNECTED"), DISCONNECTING("DISCONNECTING");
在进行蓝牙读写操作时,应该判断是否处于连接状态
设备的蓝牙连接状态将通过EventChannel连续返回
-
isEnable()
→ OriginResponse
-
蓝牙是否可用
系统支持蓝牙 && 蓝牙已经打开
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(String mac, String uuid)
→ OriginResponse
-
当前连接的设备监听数据
mac 设备 mac地址
uuid notify 描述符
回调数据,由原生进行解析,不同业务各自解析
会判断 监听uuid 是否可用,返回成功或者失败
-
read(String mac, String uuid)
→ OriginResponse
-
从当前连接的设备读取数据
mac 设备 mac地址
uuid 读 描述符
会判断 读uuid 是否可用,返回成功或者失败
-
startScan()
→ OriginResponse
-
开始扫描设备.扫描到到的XM设备,将返回设备信息 ID MAC PID
扫描到的设备将通过EventChannel发送到Flutter
为了节省资源,应该在页面不可见时停止扫描,之后再次开始.由FlutterUI层调用控制
code 表示开始扫描成功
-
stopScan()
→ void
-
停止扫描
-
toString()
→ String
-
A string representation of this object.
inherited
-
write(String mac, String uuid, String data)
→ OriginResponse
-
从当前连接的设备读取数据
mac 设备 mac地址
uuid 读 描述符
data HexString, 发送到设备时转化为 byte[]
会判断 写uuid 是否可用,返回成功或者失败
-
writeWIFIInfo(String mac, String uuid, String ssid, String password, String capabilities)
→ OriginResponse
-
写入WIFI信息,因为信息有特殊的组装格式,还是调用之前的原生方法进行解析