低功耗蓝牙开发中遇到的坑(android,kotlin)
1)低功耗蓝牙订阅NOTIFY通知后,onCharacteristicChanged不回调,无数据
解决方法:
重写setCharacteristicNotification方法针对有descriptor(描述符)的UUID
//改变特征订阅状态
private fun setCharacteristicNotification(
gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic,
enabled: Boolean, charaStr: UUID, descriptor: UUID