2500关注7806浏览
无法读取蓝牙数据
- 预期表现
可以读取蓝牙数据
- 复现路径
TI CC2541
- 提供一个最简复现 Demo
参见:
https://www.jianshu.com/p/8690dbafe849
小程序调用相关代码发送命令后无法回复。
相关说明代码
wx.notifyBLECharacteristicValueChanged(
{
state: true, // 启用 notify 功能
// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
deviceId: deviceIdA,
// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
serviceId: serviceIdA,
// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
characteristicId: characteristicIdB,
complete: function (res) {
console.log('recv ready notifyBLECharacteristicValueChanged message:', res.errMsg)
me.setData({
reminding: '设备已连接',
beginClass: 'begin',
disableState: '',
})
}
})
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>