serial
Class SerialIR

java.lang.Object
  |
  +--serial.SerialIR

public class SerialIR
extends Object

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): 0x010x030x050x090x0B0x0D 0x110x130x150x190x1B0x1D 0x210x250x290x2B0x2D 0x310x350x390x3B
The numbers listed as commands are: 0x26, 0x0F, and 0x10. I have no idea which addresses are storable overall, but these are the only ones listed, and no ranges are given.

The usage of this class is intended as follows:

The information necessary for this program was found in the SmartLinc BIRD Serial to IR Linc User Manual


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

SerialIR

public SerialIR()
Method Detail

open

public void open(String in_device)
          throws IOException,
                 javax.comm.NoSuchPortException,
                 javax.comm.PortInUseException
Connects this object with a device.
Parameters:
in_device - the name of the serial device to speak to. (e.g. "/dev/ttyrg")

signalPulse

public void signalPulse(int bank,
                        int address)
                 throws IOException
Sends a pre-timed IR signal, and then stops. This cancels any previous continuous signal.
Parameters:
bank - (0-3) the bank to load the signal from
address - the signal address

signalStart

public void signalStart(int bank,
                        int address)
                 throws IOException
Begins a continuous IR signal. This also cancels any previous continuous signal.
Parameters:
bank - (0-3) the bank to load the signal from
address - the signal address

signalStop

public void signalStop()
                throws IOException
Stops any ongoing continuous signal.

overlay

public void overlay(int bank,
                    String dev)
             throws IOException,
                    NumberFormatException
Loads a preprogrammed signal set into a bank.
Parameters:
bank - (0-3) the bank
dev - a three-character string consisting entirely of the characters '0'-'9', representing a device code (see BIRD manual)

teachBegin

public void teachBegin(int bank)
                throws IOException
Starts the teaching cycle. After this is called, the teaching remote can be positioned.
Parameters:
bank - the bank to be programmed

teachSelect

public void teachSelect(int bank,
                        int address)
                 throws IOException
Selects the address to be programmed. Call after the remote has been positioned and the user is ready to begin programming.
Parameters:
bank - the bank
address - the address to be programmed

teachEnd

public void teachEnd(int bank)
              throws IOException
Ends the programming process. Call after the remote button has been pressed and held. When this is called, the BIRD stores whatever signal it is recieving.
Parameters:
bank - the bank

loadMemory

public void loadMemory(InputStream i)
                throws IOException
Loads a memory images (2048 bytes) from the given input stream to the BIRD
Parameters:
i - the InputStream

saveMemory

public void saveMemory(OutputStream o)
                throws IOException
Stores the BIRDs memory image (2048 bytes) to the given stream.
Parameters:
o - the OutputStream

close

public void close()
           throws IOException
Closes the port.

main

public static void main(String[] args)
Used for standalone debugging and hardware tests.