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, verboserepeatMaxdefaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout| 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 endingTimeout,
boolean verbose) |
IrToy(String portName,
int baudRate,
LocalSerialPort.FlowControl flowControl,
int timeout,
int maxLearnLength,
boolean verbose) |
| Modifier and Type | Method and Description |
|---|---|
void |
bootloaderMode() |
org.harctoolbox.ircore.ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
checkVersion() |
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.
|
org.harctoolbox.ircore.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(org.harctoolbox.ircore.IrSignal code,
int count,
Transmitter transmitter) |
void |
setBeginTimeout(int beginTimeout) |
void |
setCaptureMaxSize(int captureMaxSize) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndingTimeout(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, setVerboseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTransmitterisValid, setTimeout, setVerbosepublic static final String defaultPortName
public static final int defaultBaudRate
public static final LocalSerialPort.FlowControl defaultFlowControl
public IrToy()
throws gnu.io.NoSuchPortException,
gnu.io.PortInUseException,
gnu.io.UnsupportedCommOperationException,
IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName, int timeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName, int baudRate, int timeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName, int beginTimeout, int captureMaxSize, int endingTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName, int baud, int beginTimeout, int captureSize, int endingTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic IrToy(String portName, int baudRate, LocalSerialPort.FlowControl flowControl, int timeout, int maxLearnLength, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic static void main(String[] args)
args - the command line argumentspublic void setPin(int pin,
boolean state)
throws IOException
pin - state - IOExceptionpublic void open()
throws IOException,
HarcHardwareException
IHarcHardwareopen in interface IHarcHardwareopen in class IrSerial<LocalSerialPortRaw>IOExceptionHarcHardwareExceptionpublic void checkVersion()
throws HarcHardwareException,
IOException
HarcHardwareExceptionIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class IrSerial<LocalSerialPortRaw>IOExceptionpublic void reset(int times)
throws IOException
IOExceptionpublic org.harctoolbox.ircore.ModulatedIrSequence capture()
throws HarcHardwareException,
IOException
ICapturecapture in interface ICaptureHarcHardwareException - if the device is not in valid/open state.IOExceptionpublic boolean stopCapture()
ICapturestopCapture in interface ICapturepublic org.harctoolbox.ircore.IrSequence receive()
throws HarcHardwareException,
IOException
IReceivereceive in interface IReceiveHarcHardwareException - if the device is not in valid/open state.IOExceptionpublic boolean stopReceive()
IReceivestopReceive in interface IReceivepublic String selftest() throws IOException
IOExceptionpublic void bootloaderMode()
throws IOException
IOExceptionpublic String getProtocolVersion()
public void setLedMute(boolean status)
throws IOException
IOExceptionpublic void setLed(boolean status)
throws IOException
IOExceptionpublic String getVersion()
IHarcHardwaregetVersion in interface IHarcHardwaregetVersion in class IrSerial<LocalSerialPortRaw>public void setBeginTimeout(int beginTimeout)
throws IOException
setBeginTimeout in interface IIrReaderIOExceptionpublic void setCaptureMaxSize(int captureMaxSize)
setCaptureMaxSize in interface IIrReaderpublic void setEndingTimeout(int timeout)
setEndingTimeout in interface IIrReaderpublic boolean sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
Transmitter transmitter)
throws IOException,
HarcHardwareException
sendIr in interface IRawIrSenderIOExceptionNoSuchTransmitterExceptionHarcHardwareExceptionpublic boolean sendCcf(String ccf, int count, Transmitter transmitter) throws IOException, HarcHardwareException, org.harctoolbox.ircore.Pronto.NonProntoFormatException, org.harctoolbox.ircore.InvalidArgumentException
IOExceptionHarcHardwareExceptionorg.harctoolbox.ircore.Pronto.NonProntoFormatExceptionorg.harctoolbox.ircore.InvalidArgumentExceptionpublic boolean sendCcfRepeat(String ccf, Transmitter transmitter)
ccf - transmitter - public void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwareCopyright © 2020. All rights reserved.