Good morning Jonathan,
Thank you for your quick response. Here is the commands I use for set read&write protection flow:
- Set the password
byte[] command = new byte[pass.length + 2];
command[0] = -94;
command[1] = (byte) 0x2B;
for(int i = 0;i < pass.length ; i++){
command[i+2] = pass[i];
}
answer = nfca.transceive(command);
- Set password acknowledge
answer = nfca.transceive(new byte[] {
-94, // WRITE
(byte) 0x2C, // pack page address
pack[0], pack[1], // bytes 0-1 are PACK value
(byte) 0, (byte) 0
});
- Set authentication pointer
answer = nfca.transceive(new byte[] {
(byte) 0x30, // READ
(byte) 0x29 // page address
});
answer = nfca.transceive(new byte[] {
-94, // WRITE
(byte) 0x29, // page address
answer[0], answer[1], answer[2], (byte)0x04});
- Set PWD_AUTH
boolean prot = readwrite; // false = PWD_AUTH for write only, true = PWD_AUTH for read and write
int authlim = 0; // 0 = unlimited tries
answer = nfca.transceive(new byte[] {
(byte) -94, // WRITE command
(byte) 0x2A, // Page address
(byte) ((answer[0] & 0x078) | (prot ? 0x080 : 0x000) | (authlim & 0x007)), 0, 0, 0 });
Thank you in advance,
Elisabet.