Public Member Functions | |
final void | addCodeListener (CodeListener l) |
final void | addLearnListener (LearnListener l) |
final void | addRawDataListener (RawDataListener l) |
native IRCode | getLastCode () throws PhidgetException |
native IRLearnedCode | getLastLearnedCode () throws PhidgetException |
IRPhidget () throws PhidgetException | |
native int | readRaw (int[]buffer, int offset, int count) throws PhidgetException |
final int | readRaw (int[]buffer) throws PhidgetException |
final void | removeCodeListener (CodeListener l) |
final void | removeLearnListener (LearnListener l) |
final void | removeRawDataListener (RawDataListener l) |
native void | transmit (IRCode code, IRCodeInfo codeInfo) throws PhidgetException |
native void | transmitRaw (int[]data, int offset, int count, int gap, int carrierFrequency, int dutyCycle) throws PhidgetException |
final void | transmitRaw (int[]data) throws PhidgetException |
final void | transmitRaw (int[]data, int gap) throws PhidgetException |
final void | transmitRaw (int[]data, int offset, int count) throws PhidgetException |
final void | transmitRaw (int[]data, int offset, int count, int gap) throws PhidgetException |
native void | transmitRepeat () throws PhidgetException |
Static Public Attributes | |
static final int | RAWDATA_LONGSPACE = 0x7fffffff |
Private Member Functions | |
native void | enableCodeEvents (boolean b) |
final void | enableDeviceSpecificEvents (boolean b) |
native void | enableLearnEvents (boolean b) |
native void | enableRawDataEvents (boolean b) |
void | fireCode (CodeEvent e) |
void | fireLearn (LearnEvent e) |
void | fireRawData (RawDataEvent e) |
Static Private Member Functions | |
static native long | create () throws PhidgetException |
Private Attributes | |
LinkedList | codeListeners = new LinkedList () |
LinkedList | learnListeners = new LinkedList () |
long | nativeCodeHandler = 0 |
long | nativeLearnHandler = 0 |
long | nativeRawDataHandler = 0 |
LinkedList | rawDataListeners = new LinkedList () |
This class represents a Phidget IR. All methods to send and receive IR data are implemented in this class.
The Phidget IR Receiver-Transmitter can send and receive Consumer-IR signals. Ability to learn and re-transmit codes, as well as low-level access to raw data, is provided.
Definition at line 19 of file IRPhidget.java.
com.phidgets.IRPhidget.IRPhidget | ( | ) | throws PhidgetException [inline] |
Definition at line 21 of file IRPhidget.java.
final void com.phidgets.IRPhidget.addCodeListener | ( | CodeListener | l | ) | [inline] |
Adds a code listener. The code handler is a method that will be called when a new code is seen by the reader. The event is fired on each code, including repetitions.
There is no limit on the number of code handlers that can be registered for a particular Phidget.
l | An implemetation of the CodeListener interface |
Definition at line 155 of file IRPhidget.java.
final void com.phidgets.IRPhidget.addLearnListener | ( | LearnListener | l | ) | [inline] |
Adds a code learn listener. The learn handler is a method that will be called when a new code is learned by the reader. This requires that the code be repeated several times.
There is no limit on the number of learn handlers that can be registered for a particular Phidget.
l | An implemetation of the LearnListener interface |
Definition at line 186 of file IRPhidget.java.
final void com.phidgets.IRPhidget.addRawDataListener | ( | RawDataListener | l | ) | [inline] |
Adds a rawData listener. The rawData handler is a method that will be called when a raw IR data is received.
There is no limit on the number of rawData handlers that can be registered for a particular Phidget.
l | An implemetation of the RawDataListener interface |
Definition at line 216 of file IRPhidget.java.
static native long com.phidgets.IRPhidget.create | ( | ) | throws PhidgetException [static, private] |
native void com.phidgets.IRPhidget.enableCodeEvents | ( | boolean | b | ) | [private] |
final void com.phidgets.IRPhidget.enableDeviceSpecificEvents | ( | boolean | b | ) | [inline, private] |
Reimplemented from com.phidgets.Phidget.
Definition at line 141 of file IRPhidget.java.
native void com.phidgets.IRPhidget.enableLearnEvents | ( | boolean | b | ) | [private] |
native void com.phidgets.IRPhidget.enableRawDataEvents | ( | boolean | b | ) | [private] |
void com.phidgets.IRPhidget.fireCode | ( | CodeEvent | e | ) | [inline, private] |
Definition at line 169 of file IRPhidget.java.
void com.phidgets.IRPhidget.fireLearn | ( | LearnEvent | e | ) | [inline, private] |
Definition at line 200 of file IRPhidget.java.
void com.phidgets.IRPhidget.fireRawData | ( | RawDataEvent | e | ) | [inline, private] |
Definition at line 230 of file IRPhidget.java.
native IRCode com.phidgets.IRPhidget.getLastCode | ( | ) | throws PhidgetException |
Returns the last received code. This is updated right after the code event returns.
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
native IRLearnedCode com.phidgets.IRPhidget.getLastLearnedCode | ( | ) | throws PhidgetException |
Returns the last learned code. This is updated right after the learn event returns.
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
native int com.phidgets.IRPhidget.readRaw | ( | int[] | buffer, |
int | offset, | ||
int | count | ||
) | throws PhidgetException |
Reads raw data. Use RAWDATA_LONGSPACE to detect gaps in IR data.
buffer | array into which data will be read. |
offset | offset in data to start writing |
count | maximum ammount of data to read |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
final int com.phidgets.IRPhidget.readRaw | ( | int[] | buffer | ) | throws PhidgetException [inline] |
Reads raw data. Use RAWDATA_LONGSPACE to detect gaps in IR data.
buffer | array into which data will be read. |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
Definition at line 122 of file IRPhidget.java.
final void com.phidgets.IRPhidget.removeCodeListener | ( | CodeListener | l | ) | [inline] |
Definition at line 163 of file IRPhidget.java.
final void com.phidgets.IRPhidget.removeLearnListener | ( | LearnListener | l | ) | [inline] |
Definition at line 194 of file IRPhidget.java.
final void com.phidgets.IRPhidget.removeRawDataListener | ( | RawDataListener | l | ) | [inline] |
Definition at line 224 of file IRPhidget.java.
native void com.phidgets.IRPhidget.transmit | ( | IRCode | code, |
IRCodeInfo | codeInfo | ||
) | throws PhidgetException |
Transmits a code.
code | the code to transmit |
codeInfo | the code specification |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
native void com.phidgets.IRPhidget.transmitRaw | ( | int[] | data, |
int | offset, | ||
int | count, | ||
int | gap, | ||
int | carrierFrequency, | ||
int | dutyCycle | ||
) | throws PhidgetException |
Transmits raw data.
data | data in microseconds, must start and end with a pulse |
offset | offset in the data array to start transmitting |
count | number of elements of data to transmit |
gap | gap size in microseconds |
carrierFrequency | carrier frequency in kHz |
dutyCycle | duty cycle in percent |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
final void com.phidgets.IRPhidget.transmitRaw | ( | int[] | data | ) | throws PhidgetException [inline] |
Transmits raw data.
data | data in microseconds, must start and end with a pulse |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
Definition at line 65 of file IRPhidget.java.
final void com.phidgets.IRPhidget.transmitRaw | ( | int[] | data, |
int | gap | ||
) | throws PhidgetException [inline] |
Transmits raw data.
data | data in microseconds, must start and end with a pulse |
gap | gap size in microseconds |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
Definition at line 76 of file IRPhidget.java.
final void com.phidgets.IRPhidget.transmitRaw | ( | int[] | data, |
int | offset, | ||
int | count | ||
) | throws PhidgetException [inline] |
Transmits raw data.
data | data in microseconds, must start and end with a pulse |
offset | offset in the data array to start transmitting |
count | number of elements of data to transmit |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
Definition at line 88 of file IRPhidget.java.
final void com.phidgets.IRPhidget.transmitRaw | ( | int[] | data, |
int | offset, | ||
int | count, | ||
int | gap | ||
) | throws PhidgetException [inline] |
Transmits raw data.
data | data in microseconds, must start and end with a pulse |
offset | offset in the data array to start transmitting |
count | number of elements of data to transmit |
gap | gap size in microseconds |
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
Definition at line 101 of file IRPhidget.java.
native void com.phidgets.IRPhidget.transmitRepeat | ( | ) | throws PhidgetException |
Transmits a repeat. This needs to be called within the gap time of a transmit to be meaningful.
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
LinkedList com.phidgets.IRPhidget.codeListeners = new LinkedList () [private] |
Definition at line 161 of file IRPhidget.java.
LinkedList com.phidgets.IRPhidget.learnListeners = new LinkedList () [private] |
Definition at line 192 of file IRPhidget.java.
long com.phidgets.IRPhidget.nativeCodeHandler = 0 [private] |
Definition at line 162 of file IRPhidget.java.
long com.phidgets.IRPhidget.nativeLearnHandler = 0 [private] |
Definition at line 193 of file IRPhidget.java.
long com.phidgets.IRPhidget.nativeRawDataHandler = 0 [private] |
Definition at line 223 of file IRPhidget.java.
final int com.phidgets.IRPhidget.RAWDATA_LONGSPACE = 0x7fffffff [static] |
Represents a long space (greater then 327,670 microseconds) in raw data. This can be considered a period of no IR activity. This is used with readRaw
Definition at line 31 of file IRPhidget.java.
LinkedList com.phidgets.IRPhidget.rawDataListeners = new LinkedList () [private] |
Definition at line 222 of file IRPhidget.java.