Program and Lock a Tag
ID
In this example the RFID reader assigns a new tag ID to any programmable tag inside its range and locks the tag with a password. The program does as explained below:

For this example, it is assumed that tag ID is 12-bytes long and the password has a length of one character.
...
1. Gets the RFID parameters from the first driver and, using them, opens the connection to the RFID reader.
2. Checks if the driver supports the "program tag ID" and "lock tag ID with password" attributes.
3. Assigns the new tag ID to any tag inside the reader's range and locks it.
import com.sap.ip.me.api.pios.PIOSException;
import com.sap.ip.me.api.pios.connection.*;
import com.sap.ip.me.api.pios.rfid.*;
public class ExampleProgramTagID {
public static void main(String[] args) {
RfidConnection rfidConnection = null;
try {
//----------------------(1)--------------------
Connector connector = Connector.getInstance();
DriverInfo[] rfidDrivers =
connector.listDrivers(ConnectionType.RFID);
if (rfidDrivers.length > 0) {
RfidParameters rfidParams = new RfidParameters(rfidDrivers[0]);
rfidConnection = (RfidConnection) connector.open(rfidParams);
//----------------------(2)--------------------
if (rfidDrivers[0]
.isAttributeSupported(
RfidConnection.Attributes.PROGRAM_TAG_ID)
&& rfidDrivers[0].isAttributeSupported(
RfidConnection.Attributes.LOCK_TAG_ID_WITH_PSWD)) {
//----------------------(3)--------------------
rfidConnection.programTagID(
new byte[] { -1, 2, -3, 4, 15, 26, 47, -88, 9,
10, 11, -50 });
byte[] pwd = "z".getBytes();
rfidConnection.lockTagID(pwd);
rfidConnection.close();
} else {
System.out.println(
"The required attributes are not supported by this driver.");
}
} else {
System.out.println("There are no RFID drivers.");
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
rfidConnection.close();
} catch (PIOSException pex) {
pex.printStackTrace();
}
}
}
}