com.sap.ip.me.api.pios.rfid
Class RfidTag
java.lang.Object
com.sap.ip.me.api.pios.rfid.RfidTag
- public abstract class RfidTag
- extends java.lang.Object
The RfidTag object represents a unique tag and provides the user with a way
to relate a unique tag id with a tag type.
It provides the user with the byte representation of the tag id and the
RfidTagType object describing the type of tag it pertains to.
Example: Open RFID connection, call identify method and print all the
identified tags by the reader.
Connector connector = Connector.getInstance();
DriverInfo[] rfidDrivers = connector.listDrivers(ConnectionType.RFID);
RfidParameters rfidParams = new RfidParameters(rfidDrivers[0]);
RfidConnection rfidConnection = (RfidConnection)connector.open(rfidParams);
RfidTag[] tagList = rfidConnection.identify();
if(tagList.length > 0) {
//Loop thru all the tags identified and display tag id in decimal representation
for(int pos = 0; pos < tagList.length; pos++) {
RfidTagType tagType = tagList[pos].getTagType(); //Obtain the tag type object for this tag id. Refer to RfidTagType for more information.
System.out.print("Type : " + tagType.getName() + " ID: ");
byte[] tagID = tagList[pos].getTagID();
for(int i = 0; i < tagID.length; i ++) {
System.out.print(tagID[i] + " ");
}
System.out.println();
}
}
else {
System.out.print("No tags were identified.");
}
- Since:
- MI 2.5
- Author:
- Abaco
- See Also:
RfidTagType
,
RfidConnection
Method Summary |
abstract byte[] |
getTagID()
Returns a byte array containing the tag id. |
abstract RfidTagType |
getTagType()
Returns an RfidTagType object containing the tag type information. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RfidTag
public RfidTag()
getTagID
public abstract byte[] getTagID()
- Returns a byte array containing the tag id.
- Returns:
- A byte array containing the tag id.
getTagType
public abstract RfidTagType getTagType()
- Returns an RfidTagType object containing the tag type information.
- Returns:
- An RfidTagType object containing the tag type information.
- See Also:
RfidTagType
Copyright © 2005 SAP AG. All Rights Reserved.