- NFC IsoDeo类标签无法进行数据通信?
IsoDep.transceive(Object object) 往 NFC 卡片写入 apdu 指令并接收卡片返回数据; 参考代码: var frameStr = "00CA0000106810AAAAAAAAAAAAAA310301B20005161A"; //var frameStr = "3004"; var frame = HexUtils.hexToByteArray(frameStr); console.log(HexUtils.byteArrToHex(frame)); nfcTag.transceive({ data: frame.buffer, success: res => { console.log("数据写入成功" + JSON.stringify(res)); console.log("-------" + HexUtils.byteArrToHex(res.data.buffer)); }, fail: error => { console.log("数据写入失败"); console.log(error); }, complete: res => { //this.closeConnect(NFCTab); } }) 打印日志如下: 数据写入成功{"errno":0,"errMsg":"transceive:ok","data"{},"__wx_dont_hook_sdk_inner_variable_packkeys_otherwise_you_will_regret_and_occur_bug__":["data"]} -------NULL 测试手机华为Mate40E,测试数据满足apdu格式,用android 原生APP测试,发送和接收数据均正常
2024-03-18 - NFCA类标签,数据发送成功,但无数据返回,但android应用测试可正常读写数据,请问是什么原因?
wenxin app版本:8.0.47 nfcTag = nfcAdapter.getIsoDep(); var frameStr = "3004"; var frame = HexUtils.hexToByteArray(frameStr); console.log(HexUtils.byteArrToHex(frame)); nfcTag.transceive({ data: frame.buffer, success: res => { console.log("数据写入成功" + JSON.stringify(res)); console.log("-------" + HexUtils.byteArrToHex(res.data.buffer)); }, fail: error => { console.log("数据写入失败"); console.log(error); }, complete: res => { } }) 连接设备成功 index.js:157 hahahahahahhahaha-------testcmd_1 index.js:163 setTimeout suc{"errno":0,"errMsg":"setTimeout:ok"} index.js:118 30 04 index.js:123 数据写入成功{"errno":0,"errMsg":"transceive:ok","data":{},"__wx_dont_hook_sdk_inner_variable_packkeys_otherwise_you_will_regret_and_occur_bug__":["data"]} index.js:124 -------NULL
2024-03-16