UW-101NFC计步器和HJA-311F计步器是felica plug卡。
我在android nfc中发送命令nfcF.transceive(cmd)提示Tag was lost 错误,下面是发送代码
byte[] rawCmd(NfcF nfcF, byte[] IDm, byte felicaCmd, byte[] payload) throws IOException, NfcException {
final int len = payload != null ? payload.length : 0;
final byte[] cmd = new byte[10 + len];
cmd[0] = (byte) (10 + len);
cmd[1] = felicaCmd;
System.arraycopy(IDm, 0, cmd, 2, IDm.length);
if (payload != null) {
System.arraycopy(payload, 0, cmd, 10, payload.length);
}
//byte[] cmd={0x08,0x00,0x00,0x00,0x00,0x10,0x00,0x18};
try {
nfcF.connect();
try {
byte[] response=nfcF.transceive(cmd);
return response;
} finally {
nfcF.close();
}
} catch (TagLostException e) {
return null; //Tag Lost
} catch (IOException e) {
throw new NfcException(e);
}
}
有谁遇到过此问题吗?
byte[0] cmd = 0x66; 0x08或0x18在byte[1]
试过了,不行。
使用sony的sdk