首页 > 蓝牙BLE通信那块手机能发送数据到蓝牙设备,但接受不到数据

蓝牙BLE通信那块手机能发送数据到蓝牙设备,但接受不到数据

我用BluetoothAdapter作为搜索BLE终端,用BluetoothLeClass作为读写BLE终端,连接到了蓝牙终端,并通过BluetoothLeClass的writeCharacteristic方法向蓝牙终端写数据,写入成功。

但是我获取不到蓝牙设备发送过来的数据:我是通过BluetoothLeClass 设置setOnDataAvailableListener(OnDataAvailableListener l),在BluetoothLeClass.OnDataAvailableListener的回调方法onCharacteristicWrite中获取数据,但蓝牙设备那边发数据过来,连这个方法都没进(我打印的log没显示)。。。。。
我设置了BluetoothLeClass.setCharacteristicNotification(gattCharacteristic, true);

恩,我觉的是BluetoothLeClass作为读写BLE终端的类没有生效,我掉用他initialize返回true,是不是让他生效要设置什么,谢谢诸君看一下了

【热门文章】
【热门文章】