public final class IrToy extends IrSerial<LocalSerialPortRaw> implements IRawIrSender, ICapture, IReceive
Modifier and Type | Field and Description |
---|---|
static int |
defaultBaudRate |
static LocalSerialPort.FlowControl |
defaultFlowControl |
static String |
defaultPortName |
serialPort, verbose
repeatMax
defaultBeginTimeout, defaultCaptureMaxSize, defaultEndTimeout
Constructor and Description |
---|
IrToy() |
IrToy(String portName) |
IrToy(String portName,
int timeout,
boolean verbose) |
IrToy(String portName,
int baudRate,
int timeout,
boolean verbose) |
IrToy(String portName,
int beginTimeout,
int captureMaxSize,
int endingTimeout,
boolean verbose) |
IrToy(String portName,
int baud,
int beginTimeout,
int captureSize,
int endTimeout,
boolean verbose) |
IrToy(String portName,
int baudRate,
LocalSerialPort.FlowControl flowControl,
int timeout,
int maxLearnLength,
boolean verbose) |
Modifier and Type | Method and Description |
---|---|
void |
bootloaderMode() |
ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
close() |
String |
getProtocolVersion() |
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
static void |
main(String[] args) |
void |
open()
Opens the device with previously set parameters.
|
IrSequence |
receive()
Listens to the device and returns a sequence.
|
void |
reset(int times) |
String |
selftest() |
boolean |
sendCcf(String ccf,
int count,
Transmitter transmitter) |
boolean |
sendCcfRepeat(String ccf,
Transmitter transmitter)
Not supported due to hardware restrictions.
|
boolean |
sendIr(IrSignal code,
int count,
Transmitter transmitter) |
void |
setBeginTimeout(int beginTimeout) |
void |
setCaptureMaxSize(int captureMaxSize) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndTimeout(int timeout) |
void |
setLed(boolean status) |
void |
setLedMute(boolean status) |
void |
setPin(int pin,
boolean state)
pin 2: RA2
pin 3: RA3
pin 4: RA4
pin 5: RA5
pin 11: RB3
pin 13: RB5
|
boolean |
stopCapture()
Signals the capturing device that it should stop capturing.
|
boolean |
stopReceive()
Signals the receiving device that it should stop receiving.
|
getTransmitter, isValid, setBaudRate, setDataSize, setFlowControl, setParity, setPortName, setStopBits, setTimeout, setVerbosity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTransmitter
isValid, setTimeout, setVerbosity
public static final String defaultPortName
public static final int defaultBaudRate
public static final LocalSerialPort.FlowControl defaultFlowControl
public IrToy() throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName, int timeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName, int baudRate, int timeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName, int beginTimeout, int captureMaxSize, int endingTimeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName, int baud, int beginTimeout, int captureSize, int endTimeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public IrToy(String portName, int baudRate, LocalSerialPort.FlowControl flowControl, int timeout, int maxLearnLength, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public static void main(String[] args)
args
- the command line argumentspublic void setPin(int pin, boolean state) throws IOException
pin
- state
- IOException
public void open() throws IOException, HarcHardwareException
IHarcHardware
open
in interface IHarcHardware
open
in class IrSerial<LocalSerialPortRaw>
IOException
HarcHardwareException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class IrSerial<LocalSerialPortRaw>
IOException
public void reset(int times) throws IOException
IOException
public ModulatedIrSequence capture() throws HarcHardwareException, IOException
ICapture
capture
in interface ICapture
HarcHardwareException
- if the device is not in valid/open state.IOException
public boolean stopCapture()
ICapture
stopCapture
in interface ICapture
public IrSequence receive() throws HarcHardwareException, IOException
IReceive
receive
in interface IReceive
HarcHardwareException
- if the device is not in valid/open state.IOException
public boolean stopReceive()
IReceive
stopReceive
in interface IReceive
public String selftest() throws IOException
IOException
public void bootloaderMode() throws IOException
IOException
public String getProtocolVersion()
public void setLedMute(boolean status) throws IOException
IOException
public void setLed(boolean status) throws IOException
IOException
public String getVersion()
IHarcHardware
getVersion
in interface IHarcHardware
getVersion
in class IrSerial<LocalSerialPortRaw>
public void setBeginTimeout(int beginTimeout) throws IOException
setBeginTimeout
in interface IIrReader
IOException
public void setCaptureMaxSize(int captureMaxSize)
setCaptureMaxSize
in interface IIrReader
public void setEndTimeout(int timeout)
setEndTimeout
in interface IIrReader
public boolean sendIr(IrSignal code, int count, Transmitter transmitter) throws IrpMasterException, IOException, HarcHardwareException
sendIr
in interface IRawIrSender
IrpMasterException
IOException
NoSuchTransmitterException
HarcHardwareException
public boolean sendCcf(String ccf, int count, Transmitter transmitter) throws IOException, IrpMasterException, HarcHardwareException
public boolean sendCcfRepeat(String ccf, Transmitter transmitter)
ccf
- transmitter
- public void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
Copyright © 2016. All rights reserved.