xiaoyaoyou1212 / BLE

✨Android BLE基础操作框架,基于回调,操作简单。包含扫描、多连接、广播包解析、服务读写及通知等功能。
http://www.huwei.tech/
Apache License 2.0
1.38k stars 364 forks source link

Demo中蓝牙连接上模块后无法接收数据 #10

Closed MAIMIHO closed 7 years ago

MAIMIHO commented 7 years ago

连接上后选择可写服务, 能正常写入, 串口有数据打印. 但反过来, 串口发数据, 选择可通知服务, 并没有走接收消息的回调. showGattServices()方法中 ViseBluetooth.getInstance().enableCharacteristicNotification(characteristic, bleCallback, true); 已经走到了. 但是串口发消息的时候ViseBluetooth中onCharacteristicChanged() 没有收到消息, 是什么原因导致的呢? 麻烦你了.

xiaoyaoyou1212 commented 7 years ago

@MAIMIHO 你更新代码再试试,还有这个需要判定该设备是否支持可通知服务,你看看选择可通知服务的时候下面的编辑框是否有显示UUID内容

MAIMIHO commented 7 years ago

现在能正常收到了, 谢谢.