public class NFC5Protocol extends NFCProtocol
LWM2M_CARD_AID_BYTES
Constructor and Description |
---|
NFC5Protocol(android.nfc.Tag tag) |
Modifier and Type | Method and Description |
---|---|
void |
_connect() |
void |
_disconnect() |
HostProtocol |
getType() |
byte[] |
read() |
byte |
readDynConfig(byte configId,
byte flag)
Send a read dynamic register command to the ST25
|
byte[] |
readMsg(byte offset,
int sizeInBytes,
byte flag)
Send a Read message command to the st25
|
int |
readMsgLength(byte flag) |
void |
sendAsync(byte[] responseMessage,
<any> event) |
java.lang.String |
toString() |
byte[] |
tranceiveNFC(byte[] command) |
byte[] |
transceiveISO15693(byte[] data)
Transceive method adapted for the ST25
#1: send a write command to the ST25
#2: poll on MB_CTRL register until host put a msg
#3: get the message length
#4: send a read command to the ST25
|
void |
write(byte[] message) |
byte[] |
writeDynConfig(byte configId,
byte newAttributeValue,
byte flag)
Write in dyn registes of the ST25
|
byte[] |
writeMsg(int sizeInBytes,
byte[] buffer,
byte flag)
Send a Write message command to the st25
|
create, getNFCVersion, isSameTag
public static final byte STM_MANUFACTURER_CODE
public static final byte MB_CTRL_DYN
public static final byte STATUS_MB_ENABLE_MASK
public static final byte STATUS_MB_HOST_PUT_MSG_MASK
public static final byte STATUS_MB_RF_PUT_MSG_MASK
public static final byte STATUS_MB_HOST_MISS_MSG_MASK
public static final byte STATUS_MB_RF_MISS_MSG_MASK
public static final byte ISO15693_CUSTOM_ST25DV_CMD_WRITE_MB_MSG
public static final byte ISO15693_CUSTOM_ST25DV_CMD_READ_MB_MSG_LENGTH
public static final byte ISO15693_CUSTOM_ST25DV_CMD_READ_MB_MSG
public static final byte ISO15693_CUSTOM_ST_CMD_READ_CONFIG
public static final byte ISO15693_CUSTOM_ST_CMD_WRITE_CONFIG
public static final byte ISO15693_CUSTOM_ST_CMD_READ_DYN_CONFIG
public static final byte ISO15693_CUSTOM_ST_CMD_WRITE_DYN_CONFIG
public static final byte ISO15693_CUSTOM_ST25DV_CMD_FAST_WRITE_MB_MSG
public static final byte ISO15693_CUSTOM_ST25DV_CMD_FAST_READ_MB_MSG
public static final byte ISO15693_CUSTOM_ST25DV_CMD_FAST_READ_MB_MSG_LENGTH
public static final byte ISO15693_CUSTOM_ST_CMD_FAST_READ_DYN_CONFIG
public static final byte ISO15693_CUSTOM_ST_CMD_FAST_WRITE_DYN_CONFIG
public static final byte FLAG_SELECTED_STATE_HR
public static final byte FLAG_HIGH_DATA_RATE
public static final byte ENABLE_MB
public static final byte DISABLE_MB
public byte[] tranceiveNFC(byte[] command) throws java.io.IOException, TimeOutException
java.io.IOException
TimeOutException
public void _connect() throws java.io.IOException
java.io.IOException
public void _disconnect() throws java.lang.Exception
java.lang.Exception
public void write(byte[] message) throws java.lang.Exception
java.lang.Exception
public byte[] read() throws java.lang.Exception
java.lang.Exception
public void sendAsync(byte[] responseMessage, <any> event)
public HostProtocol getType()
public byte readDynConfig(byte configId, byte flag) throws java.io.IOException
configId
- : register RF addressflag:
- configuration for RF communicationjava.io.IOException
- when I/O exceptionpublic int readMsgLength(byte flag) throws java.io.IOException, TimeOutException
java.io.IOException
TimeOutException
public byte[] writeMsg(int sizeInBytes, byte[] buffer, byte flag) throws java.io.IOException
sizeInBytes
- to sendbuffer
- to sendflag
- the flagjava.io.IOException
- when I/O exceptionpublic byte[] readMsg(byte offset, int sizeInBytes, byte flag) throws java.io.IOException
sizeInBytes
- = message length -1offset
- position in received buffer to copy the messsageflag
- the flagjava.io.IOException
- when I/O exceptionpublic byte[] transceiveISO15693(byte[] data) throws java.io.IOException, TimeOutException
#1: send a write command to the ST25 #2: poll on MB_CTRL register until host put a msg #3: get the message length #4: send a read command to the ST25
data
- to send to the modulejava.io.IOException
- if it failsTimeOutException
- if it failspublic byte[] writeDynConfig(byte configId, byte newAttributeValue, byte flag) throws java.io.IOException, TimeOutException
configId
- : command corresponding to registernewAttributeValue
- : value to set to the registerflag
- flagjava.io.IOException
- if failsTimeOutException
- if failspublic java.lang.String toString()