[代码]wx.createBLEConnection({[代码][代码] [代码][代码]// deviceId: "EF801388-1005-3F51-485D-4061AE28C2E5",[代码][代码] [代码][代码]deviceId: [代码][代码]"D8:B0:4C:EA:F6:3A"[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]wx.getBLEDeviceServices({[代码][代码] [代码][代码]// deviceId: "EF801388-1005-3F51-485D-4061AE28C2E5",[代码][代码] [代码][代码]deviceId: [代码][代码]"D8:B0:4C:EA:F6:3A"[代码][代码],[代码][代码] [代码][代码]//搜索设备获得的蓝牙设备 id [代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]let service_id = [代码][代码]"0003CDD0-0000-1000-8000-00805F9B0131"[代码][代码];[代码][代码] [代码][代码]wx.getBLEDeviceCharacteristics({[代码][代码] [代码][代码]// deviceId: "EF801388-1005-3F51-485D-4061AE28C2E5",[代码][代码] [代码][代码]deviceId: [代码][代码]"D8:B0:4C:EA:F6:3A"[代码][代码],[代码][代码] [代码][代码]serviceId: [代码][代码]'0003CDD0-0000-1000-8000-00805F9B0131'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]setTimeout([代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]wx.notifyBLECharacteristicValueChange({[代码][代码] [代码][代码]// deviceId: "EF801388-1005-3F51-485D-4061AE28C2E5",[代码][代码] [代码][代码]deviceId: [代码][代码]"D8:B0:4C:EA:F6:3A"[代码][代码],[代码][代码] [代码][代码]serviceId: [代码][代码]'0003CDD0-0000-1000-8000-00805F9B0131'[代码][代码],[代码][代码] [代码][代码]characteristicId: [代码][代码]'0000ff01-0000-1000-8000-00805f9b34fb'[代码][代码],[代码][代码] [代码][代码]state: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.error([代码][代码]"开启通知"[代码][代码], res)[代码][代码] [代码][代码]wx.onBLECharacteristicValueChange([代码][代码]function[代码][代码](res) {[代码] [代码] [代码][代码]})[代码] [代码] [代码][代码]fail(res) {[代码][代码] [代码][代码]console.error([代码][代码]"开启通知失败"[代码][代码])[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, 250)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(res) {[代码][代码] [代码][代码]console.log(res.errMsg);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码]
微信蓝牙小程序无法打开notify[图片] 我的蓝牙设备在原生安卓上都正常运行,在微信小程序上打开通知一直提示10007,然后看了下特征值属性,都为false,是我代码问题还是设备问题还是微信小程序暂不支持?
2018-11-08