com.sap.ip.me.api.pios.rfid
Class RfidTagData

java.lang.Object
  extended bycom.sap.ip.me.api.pios.rfid.RfidTagData

public abstract class RfidTagData
extends java.lang.Object

The RfidTagData object represents the data read from a tag after a successfully call to the read method. Provides the user with the byte representation of the data read and information such as tag id and tag type.

Example: Open RFID connection, call identify method and read the first tag identified.
 
 
 	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) { 
			  
		RfidTagUserArea[] areas = tagList[0].getTagType().getUserReadableAreas();
			 
		if (areas.length > 0) {
						
			RfidTagData data = rfidConnection.read(tagList[0],areas[0].getStartPos(), 
							areas[0].getEndPos() - areas[0].getStartPos() + 1); 

			  
			if(data != null) { //if data successfully read.
			  
				System.out.println(new String(data.getTagData())); // print data read.
			}
		}
		else {
						
			System.out.println("Tag type is read only!");
						
		}
	} 
	else {
					
		System.out.println("No tags in range.");
					
	}

  rfidConnection.close();
  
 
 

Since:
MI 2.5
Author:
Abaco
See Also:
RfidTag, RfidConnection

Constructor Summary
RfidTagData()
           
 
Method Summary
abstract  RfidTag getTag()
          Returns an object containing tag information.
abstract  byte[] getTagData()
          Returns the byte representation of the data read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RfidTagData

public RfidTagData()
Method Detail

getTag

public abstract RfidTag getTag()
Returns an object containing tag information.

Returns:
An object containing tag information.
See Also:
RfidTag

getTagData

public abstract byte[] getTagData()
Returns the byte representation of the data read.

Returns:
A byte array with the data read.


Copyright © 2005 SAP AG. All Rights Reserved.