- NFC通信 如何验证扇区密码?
getNFCStatus() { var that = this; const nfc = wx.getNFCAdapter(); this.nfc = nfc; function discoverHandler(res) { if (res.techs.includes(that.nfc.tech.mifareClassic)) { //获取NFCA实例 const nfcM1 = that.nfc.getMifareClassic() that.nfcM1 = nfcM1 } that.nfcM1.connect({ success(res) { var array = new Uint8Array([0X30,0X00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]) that.nfcM1.transceive({ data: array.buffer, success: (res) => { console.log("NFC数据写入成功"); }, fail: (res) => { console.log("NFC数据写入失败");console.log(res) }, complete(res) { console.log('res:', res) } }) }, fail(err) { console.log("err" + err) } }) that.nfcM1.isConnected({ success:(res)=>{ var array = new Uint8Array([0X30,0X00]) that.nfcM1.transceive({ data: array.buffer, // data:sendData, success: (res) => { console.log("NFC数据写入成功"); console.log(res.data) var result = that.ab2hex(res.data); console.log(result) }, fail: (res) => { console.log("NFC数据写入失败"); console.log(res) }, complete(res) { console.log('res:', res) } }) } }) return } nfc.onDiscovered(discoverHandler) nfc.startDiscovery({ fail(err) { console.log('failed to discover:', err) }, success(res) { console.log("sucess to discover:", res) } }) }, 我的扇区密码是[0XFF,0XFF,0XFF,0XFF,0XFF,0XFF] 但我验证完成后,返回回来的扇区数据不对,不知道应该如何去验证这个扇区密码?
2022-03-09 - 请问如何将float转为4字节的字节数组了?
请问如何将float转为4字节的字节数组了?
2022-01-10 - 使用wx.downloadFile()文件下载失败?
Gitee上的文件大小有30K,下载到本地缓存后,只有2K大小 onclick(){ const targetPath = wx.env.USER_DATA_PATH; console.log("targetPath=" + targetPath); wx.downloadFile({ url: "https://gitee.com/timetech/ISUN/raw/master/ZL-S748_ISUN-STK_APP_V1.12.0.bin", success: (result) => { console.log(result) }, fail: (res) => { console.log("fail="+result) } }) } 返回回来的数据,显示只有1.2K大小,接口走的又是成功的回调,不知道问题原因出在哪里? [图片]
2022-01-10 - 蓝牙发送数据失败?
微信小程序发送蓝牙数据, wx.writeBLECharacteristicValue 走success成功的回调,但 wx.onBLECharacteristicValueChange方法中没有接收到蓝牙设备发送过来的数据,蓝牙设备中也显示未收到小程序发送过来的数据。
2021-12-13 - 微信开发者工具如何支持ES7语法?
最新版的微信开发者工具,无法使用es7语法,接入fackbook中的runtime.js后导入js使用await语句提示Unexpected reserved word 'await'报错
2021-11-19