Hello
Your first request refers to mailbox using fastCommands..... "Send fastWriteMsg command: 22 ca 02 bb 5b 3a 0f 00 ...."
The writeMailboxMessage of the file in snapshot extracted from ST25AndroidApp use standard command and not fast, fast command are only supported by some readers, android do not support fast commands.
The FastTransferTask class use a mST25DVTag object implementing FastTransferModeInterface with following methods:
public byte writeMailboxMessage(byte[] buffer) throws STException;
public byte writeMailboxMessage(int size, byte[] buffer) throws STException;
public byte writeMailboxMessage(int size, byte[] buffer, byte flag) throws STException;
public byte[] readMailboxMessage(int mbAddress, int size) throws STException;
public byte[] readMailboxMessage(int mbAddress, int size, byte flag) throws STException;
public int readMailboxMessageLength() throws STException;
===================================================================================
public byte fastWriteMailboxMessage(byte[] buffer) throws STException;
public byte fastWriteMailboxMessage(int size, byte[] buffer) throws STException;
public byte fastWriteMailboxMessage(int size, byte[] buffer, byte flag) throws STException;
public byte[] fastReadMailboxMessage(int mbAddress, int size) throws STException;
public byte[] fastReadMailboxMessage(int mbAddress, int size, byte flag) throws STException;
public int fastReadMailboxMessageLength() throws STException;
Use only the first part and not fastxxxx methods. fastxxxx methods are not usable with android phone readers. Refers to DataSheet for Normal and fast command code.
Normal command use :
/**
* STMicroelectronics ISO15693 Write MailBox Message custom command code for Mailbox enabled series
*/
public static final byte ISO15693_CUSTOM_ST_CMD_MB_WRITE_MSG = (byte) 0xAA;
Fast command use : (the one you use.....)
/**
* STMicroelectronics ISO15693 Fast Write MailBox Message custom command code for Mailbox enabled series
*/
public static final byte ISO15693_CUSTOM_ST_CMD_MB_FAST_WRITE_MSG = (byte) 0xCA;
Summary: (in android environment use only following method, not the fast ones)
public byte writeMailboxMessage(byte[] buffer) throws STException;
public byte writeMailboxMessage(int size, byte[] buffer) throws STException;
public byte writeMailboxMessage(int size, byte[] buffer, byte flag) throws STException;
public byte[] readMailboxMessage(int mbAddress, int size) throws STException;
public byte[] readMailboxMessage(int mbAddress, int size, byte flag) throws STException;
public int readMailboxMessageLength() throws STException;
I hope this answer clarify the point.
Regards,FB