ST25RU3993 - read complete memory bank
Hi all,
how can I read a complete memory bank of a tag with the ST25RU3993 ?
The problem is that I don't know the number of received bytes.
Thanks in advance
Michael
Hi all,
how can I read a complete memory bank of a tag with the ST25RU3993 ?
The problem is that I don't know the number of received bytes.
Thanks in advance
Michael
Hi Michael,
The read API (STUHFL_T_RET_CODE Gen2_Read(STUHFL_T_Read *readData);) can only read 16 bytes (MAX_READ_DATA_LEN) at a time.
The parameter readData.bytes2Read is provided to specify how much bytes have to be read
and it returns how much where duly read.
So with the following piece of code you can read the full area content (here assuming you read User bank and pwd is 00000000):
STUHFL_T_RET_CODE ret;
STUHFL_T_Read readData;
readData.memBank = GEN2_MEMORY_BANK_USER;
readData.bytes2Read = MAX_READ_DATA_LEN;
readData.wordPtr = 0;
memset(readData.pwd, 0, 4);
do {
ret = Gen2_Read(&readData);
// do whatever needed with readData.data
readData.wordPtr += MAX_READ_DATA_LEN/2;
} while ((ret==ERR_NONE) && (readData.bytes2Read == MAX_READ_DATA_LEN));
I assumed you wanted to read Gen2 tags, procedure is equivalent for Gb29768 (using Gb29768_Read())
Best regards,
Cedric.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.