微信蓝牙notifyBLECharacteristicValueChange 调用出现错误
使用的是IOS 系统,使用的是官方代码片段
出现错误:{errCode: 10008, errno: 1500104, errMsg: "notifyBLECharacteristicValueChange:fail set notify failed. deviceID = 0DC7AD37-AF90-4A16-C5DC-9A036AD0BA92, serviceID = 1000F000-0000-1000-8000-00805F9B34FB, characteristicID = 1000F001-0000-1000-8000-00805F9B34FB, errMsg = The attribute could not be found."}
代码:
wx.notifyBLECharacteristicValueChange({
deviceId,
serviceId,
characteristicId: item.uuid,
state: true,
success(res){
console.log('notifyBLECharacteristicValueChange'+res);
},
fail(err){
console.log(err);
}
})
你试图通知的 BLE 特征(characteristic)不存在或者无法在你的蓝牙设备中找到
properties: Object
indicate: false
notify: true
read: true
write: false
writeDefault: false
writeNoResponse: false
__proto__: Object
uuid: "1000F001-0000-1000-8000-00805F9B34FB"
__proto__: Object
1: Object
properties: Object
indicate: false
notify: false
read: false
write: true
writeDefault: true
writeNoResponse: true
__proto__: Object
uuid: "E44BC439-ABFD-45A2-B575-925416129600"