- 【微信分享】H5页在微信内打开,进入分享操作时,获取ticket,偶发返回null
【微信分享】H5页在微信内打开,进入分享操作时,获取ticket,偶发返回null 获取ticket接口 https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=45_7UItIpChFVO1OWQfh6DNBmtbHRbmswM4t-1W_9FUQ5RGJR6DMWa1kGvEhLaSRmd51n0e1KHqi_paaCpiNEHnce9ijrr46PcB3qYal4HSxlzcBTGrX8wHBedMM8an_ER4JuGr8kJRfVMorL5LKTPdABAZIE&type=jsapi
2021-06-04 - ios系统,writeBLECharacteristicValue报错,跪求帮忙
ios版本11.41,微信版本6.7.1,基础库版本2.2.5 直接上代码了,deviceId、serviceId、characteristicId都是通过api获取到的,在向蓝牙设备做写操作的时候,一直返回错误代码10008,错误信息“The value's length is invalid”,请问是接口参数调用问题,还是蓝牙设备返回了错误信息。跪求各位大佬帮忙解决一下,万分感谢。 var hex = '1b840084' var typedArray = new Uint8Array(hex.match(/[\da-f]{2}/gi).map(function (h) { return parseInt(h, 16) })) var buffer = typedArray.buffer;//that.hexStringToArrayBuffer(test) wx.writeBLECharacteristicValue({ deviceId: '291B5157-23FD-61D3-90D5-2D44D314FB97', serviceId: '0000FFE5-0000-1000-8000-00805F9B34FB', characteristicId: '0000FFE9-0000-1000-8000-00805F9B34FB', value: buffer, success: function (res) { console.log('write success') }, fail: function(res) { console.log('write fail') console.log(res) } })
2018-09-04 - BLE下ISO使用writeBLECharacteristicValue失败
同样的代码,在安卓手机可以正常调用writeBLECharacteristicValue向蓝牙设备写入,但是在iphone手机(版本11.2.2)上调用,返回错误编码10008,错误信息“the value's length is invalid”,请大佬告知如何解决。代码如下: wx.notifyBLECharacteristicValueChange({ state: true, deviceId: deviceId, serviceId: notifyserviceId, characteristicId: notifycharacteristicId, success: function (res) { console.log("notify success") setTimeout(function () { that.writeBLECharacteristicValue(deviceId, writeserviceId, writecharacteristicId) }, 2000); }, fail: function (res) { console.log("notify fail:" + res.errMsg) }, complete : function() { wx.onBLECharacteristicValueChange(function (res) { console.log(res) }); } }) }, writeBLECharacteristicValue: function (deviceId, writeserviceId, writecharacteristicId) { var that = this let buffer = new ArrayBuffer(1) let dataView = new DataView(buffer) dataView.setUint8(0, 0) wx.writeBLECharacteristicValue({ deviceId: deviceId, serviceId: writeserviceId, characteristicId: writecharacteristicId, value: buffer, success: function (res) { console.log('write success') }, fail(res) { console.log('write fail') console.log(res) } }) },
2018-08-12