2021-02-24 01:02 AM
We have a problem, we are trying to upload a new firmware version over NFC, using the mailbox. Our bootloader is tight on space, so we came up with a simple protocol for it; When attempting to write to the mailbox by calling mNfcTag.writeMailboxMessage(data) we notice that 4 bytes are prepended to the packet in the mIso15693CustomCommand class writeMsg() method:
public byte writeMsg(byte sizeInBytes, byte[] buffer, byte flag, byte[] uid) throws STException {
int msgSize = Helper.convertByteToUnsignedInt(sizeInBytes);
if (buffer != null && buffer.length != 0 && buffer.length >= msgSize + 1) {
int headerSize = this.getIso15693CustomHeaderSize(flag);
byte[] frame = new byte[headerSize + 1 + msgSize + 1];
frame[0] = flag;
frame[1] = -86;
frame[2] = 2;
if (this.uidNeeded(flag)) {
this.addUidToFrame(frame, 3, uid);
}
frame[headerSize] = sizeInBytes;
System.arraycopy(buffer, 0, frame, headerSize + 1, msgSize + 1);
byte[] response = this.transceive("writeMsg", frame);
return response[0];
} else {
throw new STException(STExceptionCode.BAD_PARAMETER);
}
}
However, we don't want these bytes in our implementation, looking through the class, I worked out how the code flowed through ultimately to the transceive() method call, and noticed that I could obtain direct access by calling mNfcTag.getReaderInterface().transceive().
The problem is, that when I do this a TAG_NOT_IN_THE_FIELD is returned from the transceive() call, even though the tag is definitely in the field, and indeed the test for Tag.Connected() passes Why is this? What, if anything am I doing wrong?
Solved! Go to Solution.
2021-02-24 03:37 AM
Hi DNye.1,
I think these 3 header bytes are part of the protocol and cannot be omitted. They are the flag byte (ISO15693 protocol), Command Byte (-86=AAh= Write Message) and IC Mfg Code (0x02).
Please refer to the data sheet of ST25DV, documentation of "Write Message" command.
Regards, Ulysses
2021-02-24 03:37 AM
Hi DNye.1,
I think these 3 header bytes are part of the protocol and cannot be omitted. They are the flag byte (ISO15693 protocol), Command Byte (-86=AAh= Write Message) and IC Mfg Code (0x02).
Please refer to the data sheet of ST25DV, documentation of "Write Message" command.
Regards, Ulysses