So should i use the below code snippet as example for writing custom commands to NFC Tag ?
void PCD_ISO15693_scenario (void)
{
#define BLK_NB_ISO15693 8
#define DATA_WRITE_ISO15693 0x11, 0x22, 0x33, 0x44
bool status;
unsigned char Resp[256];
unsigned char RespSize;
unsigned char ReadBlock[] = {0x02, 0x20, BLK_NB_ISO15693};
unsigned char WriteBlock[] = {0x02, 0x21, BLK_NB_ISO15693, DATA_WRITE_ISO15693};
status = NxpNci_ReaderTagCmd(ReadBlock, sizeof(ReadBlock), Resp, &RespSize);
if((status == NFC_ERROR) || (Resp[RespSize-1] != 0x00))
{
PRINTF(" Read block %d failed with error 0x%02x\n", ReadBlock[2], Resp[RespSize-1]);
return;
}
PRINTF(" Read block %d:", ReadBlock[2]); PRINT_BUF(" ", (Resp+1), RespSize-2);
/* Write */
status = NxpNci_ReaderTagCmd(WriteBlock, sizeof(WriteBlock), Resp, &RespSize);
if((status == NFC_ERROR) || (Resp[RespSize-1] != 0))
{
PRINTF(" Write block %d failed with error 0x%02x\n", WriteBlock[2], Resp[RespSize-1]);
return;
}
PRINTF(" Block %d written\n", WriteBlock[2]);
/* Read back */
status = NxpNci_ReaderTagCmd(ReadBlock, sizeof(ReadBlock), Resp, &RespSize);
if((status == NFC_ERROR) || (Resp[RespSize-1] != 0x00))
{
PRINTF(" Read block %d failed with error 0x%02x\n", ReadBlock[2], Resp[RespSize-1]);
return;
}
PRINTF(" Read block %d:", ReadBlock[2]); PRINT_BUF(" ", (Resp+1), RespSize-2);
}