NFCA指令 (IOS 14443-3A) Read ID 0x78 Read all bytes 0x00 Read 8 bytes 0x02 Read 1 bytes 0x01 Read 16 bytes 0x30 Read segment 0x10 Write 4 bytes 0xa2 Write 1 bytes with erase 0x53 Write 1 bytes without erase 0x1a Write 8 bytes with erase 0x54 Write 8 bytes without erase 0x1b Sector select 0xc2 Get version 0x60 eg: Read 16 bytes from block 0x04 0x30:0x04 eg: Write FF:FF:FF:FF on block 0x04 0xa2:0x04:0xff:0xff:0xff:0xff Check command 0x06 Check response 0x07 Update command 0x08 Update response 0x09 Select 0xa4 Select by name 0x04 Select by file id 0x00 Read binary 0xb0 Update binary 0xd6 Read ECC Signature 0x3c:0x00 Read counter 0x39:0x02
nfc 功能,NfcA.transceive为什么总是失败?api:NfcA.transceive基础库:2.14.2 微信版本:7.0.21 华为手机 能读到卡片的类型,也能连接上卡片,nfcA.connect可以成功,但是transcevie就失败了 错误信息:transceive:fail:system internal error 错误code:13017 const app = getApp() Page({ data: { }, onLoad: function () { const adapter = wx.getNFCAdapter(); console.log(adapter); this.adapter = adapter; adapter.onDiscovered(function (res){ console.log('读到卡片了', res); //console.log(res.techs); if(res.techs.includes(adapter.tech.nfcA)){ console.log('发现'+adapter.tech.nfcA+'卡'); const nfcA = adapter.getNfcA(); app.nfcA = nfcA; nfcA.connect({ success: function(res){ console.log('设备已连接', res) nfcA.transceive({ data:new ArrayBuffer(0), success: function(res){ console.log('发送数据成功, 接收数据如下:', res); }, fail: function(err){ console.log('发送数据失败', err); } }) }, fail: function(err){ console.log('设备联接错误', err); } }); } }) adapter.startDiscovery({ success: function(res){ console.log('成功发现设备',res); }, fail: function(err){ console.log('发现设备出错', err); }, complete: function(){ } }); }, onHide() { if (this.nfc) { this.nfc.stopDiscovery() } } })
2022-01-17