package demo;

import com.jlrfid.service.GetReadData;
import com.jlrfid.service.MainHandler;
import com.jlrfid.service.RFIDException;

public class LoopReadDemo implements GetReadData{

	/**
	 * @param args
	 * @throws RFIDException 
	 */
	public static void main(String[] args) throws RFIDException {
		// TODO Auto-generated method stub

		MainHandler handler = new MainHandler();
		if(handler.dllInit("R2k.dll")){
			if(handler.deviceInit("",4, 115200)){
				//System.out.println(handler.StopInv());
				handler.BeginInv(new LoopReadDemo());
			}
		}
	}

	public void getReadData(String data, int antNo) {
		if ("F0".equals(data)) {
			System.out.println("Antenna 1 finished inventory");
		}else if ("F1".equals(data)) {
			System.out.println("Antenna 2 finished inventory");
		}else if ("F2".equals(data)) {
			System.out.println("Antenna 3 finished inventory");
		}else if ("F3".equals(data)) {
			System.out.println("Antenna 4 finished inventory");
		}else if(!"".equals(data)){
			System.out.println("data" + data + "antenna" + antNo);
		}
	}

}
