|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.phidgets.Phidget
com.phidgets.IRPhidget
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.
| Field Summary | |
static int |
RAWDATA_LONGSPACE
Represents a long space (greater then 327,670 microseconds) in raw data. |
| Constructor Summary | |
IRPhidget()
|
|
| Method Summary | |
void |
addCodeListener(CodeListener l)
Adds a code listener. |
void |
addLearnListener(LearnListener l)
Adds a code learn listener. |
void |
addRawDataListener(RawDataListener l)
Adds a rawData listener. |
IRCode |
getLastCode()
Returns the last received code. |
IRLearnedCode |
getLastLearnedCode()
Returns the last learned code. |
int |
readRaw(int[] buffer)
Reads raw data. |
int |
readRaw(int[] buffer,
int offset,
int count)
Reads raw data. |
void |
removeCodeListener(CodeListener l)
|
void |
removeLearnListener(LearnListener l)
|
void |
removeRawDataListener(RawDataListener l)
|
void |
transmit(IRCode code,
IRCodeInfo codeInfo)
Transmits a code. |
void |
transmitRaw(int[] data)
Transmits raw data. |
void |
transmitRaw(int[] data,
int gap)
Transmits raw data. |
void |
transmitRaw(int[] data,
int offset,
int count)
Transmits raw data. |
void |
transmitRaw(int[] data,
int offset,
int count,
int gap)
Transmits raw data. |
void |
transmitRaw(int[] data,
int offset,
int count,
int gap,
int carrierFrequency,
int dutyCycle)
Transmits raw data. |
void |
transmitRepeat()
Transmits a repeat. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int RAWDATA_LONGSPACE
readRaw
| Constructor Detail |
public IRPhidget()
throws PhidgetException
| Method Detail |
public void transmit(IRCode code,
IRCodeInfo codeInfo)
throws PhidgetException
code - the code to transmitcodeInfo - the code specification
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public void transmitRepeat()
throws PhidgetException
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public void transmitRaw(int[] data,
int offset,
int count,
int gap,
int carrierFrequency,
int dutyCycle)
throws PhidgetException
data - data in microseconds, must start and end with a pulseoffset - offset in the data array to start transmittingcount - number of elements of data to transmitgap - gap size in microsecondscarrierFrequency - carrier frequency in kHzdutyCycle - duty cycle in percent
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public final void transmitRaw(int[] data)
throws PhidgetException
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.
public final void transmitRaw(int[] data,
int gap)
throws PhidgetException
data - data in microseconds, must start and end with a pulsegap - gap size in microseconds
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public final void transmitRaw(int[] data,
int offset,
int count)
throws PhidgetException
data - data in microseconds, must start and end with a pulseoffset - offset in the data array to start transmittingcount - 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.
public final void transmitRaw(int[] data,
int offset,
int count,
int gap)
throws PhidgetException
data - data in microseconds, must start and end with a pulseoffset - offset in the data array to start transmittingcount - number of elements of data to transmitgap - gap size in microseconds
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public int readRaw(int[] buffer,
int offset,
int count)
throws PhidgetException
RAWDATA_LONGSPACE to detect gaps in IR data.
buffer - array into which data will be read.offset - offset in data to start writingcount - 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.
public final int readRaw(int[] buffer)
throws PhidgetException
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.
public IRCode getLastCode()
throws PhidgetException
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.
public IRLearnedCode getLastLearnedCode()
throws PhidgetException
PhidgetException - If this Phidget is not opened and attached.
See open for information on determining if a device is attached.public final void addCodeListener(CodeListener l)
There is no limit on the number of code handlers that can be registered for a particular Phidget.
l - An implemetation of the CodeListener interfacepublic final void removeCodeListener(CodeListener l)
public final void addLearnListener(LearnListener l)
There is no limit on the number of learn handlers that can be registered for a particular Phidget.
l - An implemetation of the LearnListener interfacepublic final void removeLearnListener(LearnListener l)
public final void addRawDataListener(RawDataListener l)
There is no limit on the number of rawData handlers that can be registered for a particular Phidget.
l - An implemetation of the RawDataListener interfacepublic final void removeRawDataListener(RawDataListener l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||