|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--serial.SerialIR
The SerialIR class is designed to control the B.I.R.D. "infrared driver" which recieves commands through a serial port and translates them into IR signals which are emitted from tiny "flasher" devices.
The IR signals are referenced by Bank and Address. There are four banks, numbered 0-3. For each bank, there are a number of addresses, somewhat randomly numbered. Not all addresses are for IR signals, and in fact some of them are commands to the BIRD. The signal addresses listed in the manual are (in hexadecimal):
The usage of this class is intended as follows:
ir = new SerialIR()
ir.open("/dev/whatever")
signalStart(), signalStop(), signalPulse(), overlay(), teachBegin(), teachSelect(), teachEnd(), loadMemory(), or saveMemory()
functions.
ir.close()
Constructor Summary | |
SerialIR()
|
Method Summary | |
void |
close()
Closes the port. |
void |
loadMemory(InputStream i)
Loads a memory images (2048 bytes) from the given input stream to the BIRD |
static void |
main(String[] args)
Used for standalone debugging and hardware tests. |
void |
open(String in_device)
Connects this object with a device. |
void |
overlay(int bank,
String dev)
Loads a preprogrammed signal set into a bank. |
void |
saveMemory(OutputStream o)
Stores the BIRDs memory image (2048 bytes) to the given stream. |
void |
signalPulse(int bank,
int address)
Sends a pre-timed IR signal, and then stops. |
void |
signalStart(int bank,
int address)
Begins a continuous IR signal. |
void |
signalStop()
Stops any ongoing continuous signal. |
void |
teachBegin(int bank)
Starts the teaching cycle. |
void |
teachEnd(int bank)
Ends the programming process. |
void |
teachSelect(int bank,
int address)
Selects the address to be programmed. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SerialIR()
Method Detail |
public void open(String in_device) throws IOException, javax.comm.NoSuchPortException, javax.comm.PortInUseException
in_device
- the name of the serial device to speak to. (e.g. "/dev/ttyrg")public void signalPulse(int bank, int address) throws IOException
bank
- (0-3) the bank to load the signal fromaddress
- the signal addresspublic void signalStart(int bank, int address) throws IOException
bank
- (0-3) the bank to load the signal fromaddress
- the signal addresspublic void signalStop() throws IOException
public void overlay(int bank, String dev) throws IOException, NumberFormatException
bank
- (0-3) the bankdev
- a three-character string consisting entirely of the characters '0'-'9', representing a device code (see BIRD manual)public void teachBegin(int bank) throws IOException
bank
- the bank to be programmedpublic void teachSelect(int bank, int address) throws IOException
bank
- the bankaddress
- the address to be programmedpublic void teachEnd(int bank) throws IOException
bank
- the bankpublic void loadMemory(InputStream i) throws IOException
i
- the InputStreampublic void saveMemory(OutputStream o) throws IOException
o
- the OutputStreampublic void close() throws IOException
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |