读取是哪个接口,是在onDiscovered返回读取的数据吗?
有没有读取 ISODep 标签相关的例子?完全不会啊https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.html
2020-09-25openBluetoothAdapter: function () { wx.openBluetoothAdapter({ success: res => { console.log(res); } }) }, connect: function() { wx.startBluetoothDevicesDiscovery({ services: ['0000FEE1-0000-1000-8000-00805F9B34FB'], allowDuplicatesKey: true, success: res => { console.log(JSON.stringify(res)); wx.getBluetoothDevices({ success: res => { console.log('getBluetoothDevices:' + JSON.stringify(res)); if(res.devices.length > 0) { this.setData({ deviceId: res.devices[0].deviceId }) wx.createBLEConnection({ deviceId: res.devices[0].deviceId, complete: res => { console.log('createBLEConnection:' + JSON.stringify(res)); } }) } } }) } }); }, notify: function() { wx.getBLEDeviceServices({ deviceId: '48ADF6C5-261F-D9B0-BD6C-91FCF8B57737', complete: function (res) { console.log('getBLEDeviceServices:' + JSON.stringify(res)); wx.getBLEDeviceCharacteristics({ deviceId: '48ADF6C5-261F-D9B0-BD6C-91FCF8B57737', serviceId: '0000FEE1-0000-1000-8000-00805F9B34FB', complete: function (res) { console.log('getBLEDeviceCharacteristics:' + JSON.stringify(res)); wx.notifyBLECharacteristicValueChange({ deviceId: '48ADF6C5-261F-D9B0-BD6C-91FCF8B57737', serviceId: '0000FEE1-0000-1000-8000-00805F9B34FB', characteristicId: '00001003-0000-1000-8000-00805F9B34FB', state: true, complete: res => { console.log(JSON.stringify(res)); } }) wx.onBLECharacteristicValueChange((res) => { console.log('onBLECharacteristicValueChange:' + JSON.stringify(res)); }); } }) } }) }, write: function(){ let buffer = new ArrayBuffer(1) let dataView = new DataView(buffer) dataView.setUint8(0, 0) wx.writeBLECharacteristicValue({ deviceId: '48ADF6C5-261F-D9B0-BD6C-91FCF8B57737', serviceId: '0000FEE1-0000-1000-8000-00805F9B34FB', characteristicId: '00001003-0000-1000-8000-00805F9B34FB', value: buffer, complete: function (res) { console.log('writeBLECharacteristicValue:' + JSON.stringify(res)); // wx.readBLECharacteristicValue({ // deviceId: '48ADF6C5-261F-D9B0-BD6C-91FCF8B57737', // serviceId: '0000FEE1-0000-1000-8000-00805F9B34FB', // characteristicId: '00001003-0000-1000-8000-00805F9B34FB', // success: function(res) { // console.log('readBLECharacteristicValue:' + JSON.stringify(res)); // }, // }) }, }) }, [图片] onBLECharacteristicValueChange 没有回调 手机 iPhone 11 Pro, iOS 13.3 微信 7.0.12
关于wx.onBLECharacteristicValueChange无法回调的问题?我现在这边的情况是这样的,写了小程序蓝牙的demo,用的ios测试,但是wx.onBLECharacteristicValueChange这个无法回调,我用的特征值是支持write+notify的,notify是成功开启了,蓝牙设备那边也是观察到写入特征值成功,但是不知道为什么就是不回调这个特征值变化事件,请问有人知道怎么解决吗?
2020-06-10机型: iPhone 8 iOS 11.4.1 微信版本:6.7.2 代码片段: var file = wx.getFileSystemManager() file.writeFile({ filePath: wx.env.USER_DATA_PATH + '/test/test.text', data: new Uint16Array([97, 32, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33]), complete: function (res) { console.log(res); } })
fs.writeFile 无法写入 arrayBuffer- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo var file = wx.getFileSystemManager() file.writeFile({ filePath: wx.env.USER_DATA_PATH + '/test/test.text', data: new Uint16Array([97, 32, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33]), complete: function (res) { console.log(res); } })
2018-09-26FileSystemManager.mkdir({ dirPath: 'test', complete(obj) { console.log(obj); } }); 同样创建失败,不太明白dirPath 的路径要求
FileSystemManager.mkdir创建失败FileSystemManager.mkdir递归创建文件夹失败 错误信息errMsg: "mkdir:fail no such file or directory http://usr/model/base" 参数recursive已经为true了
2018-09-18