XSIID Sector select

Hi, I was wondering if anyone has implemented the NTAG i2C sector select command for the PN532.
I am trying to read from the second sector on my XSIID. None of the PN532 Arduino libraries, that I have seen, seem to support this.
Am I overlooking something?
Can someone point me to an implementation somewhere?

Non of the libraries I know of have the commands needed but should be simple enough to add the sector select command.

uint8_t PN532::SectorSelect (uint8_t sectorNumber)
{
/* Prepare the command */
pn532_packetbuffer[0] = PN532_COMMAND_INCOMMUNICATETHRU; //(0x42)
pn532_packetbuffer[1] = 1; /* Card number */
pn532_packetbuffer[2] = PN532_CMD_SECTOR_SELECT; //0xC2
pn532_packetbuffer[3] = 0xFF;

/* Send the command */
if (HAL(writeCommand)(pn532_packetbuffer, 4)) {
Serial.print("\n1st Sector Select Command Failed");
return 0;
}

/* Read the response packet */ 
HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer));

/* Prepare the 2nd command */ 
pn532_packetbuffer[0] = PN532_COMMAND_INCOMMUNICATETHRU; //(0x42)
pn532_packetbuffer[1] = 1; /* Card number */
pn532_packetbuffer[2] = sectorNumber; 
pn532_packetbuffer[3] = 0x00; 
pn532_packetbuffer[4] = 0x00; 
pn532_packetbuffer[5] = 0x00;

/* Send the 2nd command */
if (HAL(writeCommand)(pn532_packetbuffer, 6) > -2 ){
Serial.print("\n2nd Sector Select Command Failed");
return 0;
}

/* Read the response packet */
HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer));

Serial.print("\n2nd Sector Select Command Successful");
// Return OK signal
return 1;
}

That should work yo will have to wait some time I think 10ms between sending command and reading ACK

Another quick point Is that the sector select command response without a crc so you may get a crc error reported but It should not be material and can be ignored.

3 Likes