From 46bd2ba42d186a81d7ad7e4a55e03dd63b2d042f Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sun, 3 Mar 2013 19:30:43 +0000 Subject: Imported Upstream version 2.1.8.20121218 --- Java/com/phidgets/RFIDPhidget.java | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'Java/com/phidgets/RFIDPhidget.java') diff --git a/Java/com/phidgets/RFIDPhidget.java b/Java/com/phidgets/RFIDPhidget.java index 20a0ee2..26f38a3 100644 --- a/Java/com/phidgets/RFIDPhidget.java +++ b/Java/com/phidgets/RFIDPhidget.java @@ -1,6 +1,6 @@ /* - * Copyright 2012 Phidgets Inc. All rights reserved. + * Copyright 2006 Phidgets Inc. All rights reserved. */ package com.phidgets; @@ -12,10 +12,7 @@ import com.phidgets.event.*; * to read tags and set outputs on the RFID reader are implemented in this class. *

* The Phidget RFID reader can read one tag at a time. Both tag and tagloss event handlers are provided, - * as well as control over the antenna so that multiple readers can exist in close proximity without interference. - * See your device's User Guide for more specific API details, - * technical information, and revision details. The User Guide, along with other resources, can be found on - * the product page for your device. + * as well as control over the antenna so that multiple readers can exists in close proximity without interference. * * @author Phidgets Inc. */ @@ -26,6 +23,20 @@ public final class RFIDPhidget extends Phidget super (create ()); } private static native long create () throws PhidgetException; + + /** + * EM4100 (EM4102) 40-bit. This is used with {@link #getLastTagProtocol() getSgetLastTagProtocolcreenSize} and {@link #write(String, int, boolean) write} + */ + public static final int PHIDGET_RFID_PROTOCOL_EM4100 = 1; + /** + * ISO11785 FDX-B encoding (Animal ID). This is used with {@link #getLastTagProtocol() getSgetLastTagProtocolcreenSize} and {@link #write(String, int, boolean) write} + */ + public static final int PHIDGET_RFID_PROTOCOL_ISO11785_FDX_B = 2; + /** + * PhidgetsTAG Protocol 24 character ASCII. This is used with {@link #getLastTagProtocol() getSgetLastTagProtocolcreenSize} and {@link #write(String, int, boolean) write} + */ + public static final int PHIDGET_RFID_PROTOCOL_PHIDGETS = 3; + /** * Returns the number of outputs. These are the outputs provided by the terminal block. * Older RFID readers do not have these outputs, and this method will return 0. @@ -89,6 +100,14 @@ public final class RFIDPhidget extends Phidget * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. */ public native String getLastTag () throws PhidgetException; + /** + * Returns the protocol of the last tag read. This method will only return a valid protocol after a tag has been seen. + * This method can be used even after a tag has been removed from the reader + * @return protocol + * @throws PhidgetException If this Phidget is not opened and attached. + * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. + */ + public native int getLastTagProtocol () throws PhidgetException; /** * Returns the state of whether or not a tag is being read by the reader. * True indicated that a tag is on (or near) the reader, false indicates that one is not. @@ -97,6 +116,15 @@ public final class RFIDPhidget extends Phidget * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. */ public native boolean getTagStatus () throws PhidgetException; + /** + * Writes a tag. + * @param tag tag string + * @param protocol tag protocol + * @param lock lock tag from futher writes + * @throws PhidgetException If this Phidget is not opened and attached, if the string is too malformed, or the protocol is invalid. + * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. + */ + public native void write (String tag, int protocol, boolean lock) throws PhidgetException; private final void enableDeviceSpecificEvents (boolean b) { -- cgit v1.2.3