public class Pronto extends Object
Modifier and Type | Field and Description |
---|---|
static int |
charsInDigit
Number of characters in the hexadecimal digits of Pronto strings.
|
Constructor and Description |
---|
Pronto(IrSignal irSignal)
Constructor from IrSignal.
|
Modifier and Type | Method and Description |
---|---|
static IrSignal |
ccfSignal(int[] ccf)
Creates a new IrSignals by interpreting its argument as CCF signal.
|
static IrSignal |
ccfSignal(String ccfString)
Creates a new IrSignals by interpreting its argument as CCF string.
|
static IrSignal |
ccfSignal(String[] array,
int begin)
Creates a new IrSignals by interpreting its argument as CCF string.
|
static String |
formatInteger(int n)
Formats an integer like seen in CCF strings, in printf-ish, using "%04X".
|
double |
getFrequency()
Computes the carrier frequency in Hz.
|
static double |
getFrequency(int code)
Computes the carrier frequency in Hz.
|
static int |
getProntoCode(double f)
Returns frequency code from frequency in Hz (the second number in the CCF).
|
static double |
getPulseTime(int code)
Computes pulse time.
|
int[] |
initArray()
CCF array of initial sequence
|
static void |
main(String[] args) |
static int[] |
parseString(String ccfString)
Tries to parse the string as argument.
|
static int[] |
parseStringArray(String[] array,
int begin)
Tries to parse the strings as argument.
|
static int |
pulses(double us,
double frequency)
Computes number of cycles of the carrier the first argument will require.
|
int[] |
repeatArray()
CCF array of repeat sequence
|
static int[] |
shortCCF(String protocolName,
int device,
int subdevice,
int command)
Computes the "short" Pronto form of some signals, given by protocol number and parameter values.
|
static String |
shortCCFString(String protocolName,
int device,
int subdevice,
int command)
The string version of shortCCF(...).
|
int[] |
toArray()
CCF array of complete signal, i.e.
|
static int[] |
toArray(double frequency,
double[] sequence)
Computes a ccf array
|
static int[] |
toArray(double frequency,
double[] intro,
double[] repetition)
CCF array of complete signal, i.e.
|
String |
toPrintString()
Computes the ("long", raw) CCF string
|
static String |
toPrintString(int[] array)
Formats a CCF as string.
|
static String |
toPrintString(IrSignal irSignal)
Computes the ("long", raw) CCF string
|
public static final int charsInDigit
public Pronto(IrSignal irSignal) throws IncompatibleArgumentException
irSignal
- IncompatibleArgumentException
public static String formatInteger(int n)
n
- public static int getProntoCode(double f)
f
- Frequency in Hz.public static double getFrequency(int code)
code
- Pronto frequency codepublic double getFrequency()
public static double getPulseTime(int code)
code
- Pronto frequency codepublic static int pulses(double us, double frequency)
us
- duration in microsecondsfrequency
- public static int[] toArray(double frequency, double[] sequence)
frequency
- sequence
- public static IrSignal ccfSignal(int[] ccf) throws ParseException, IncompatibleArgumentException, UnassignedException, DomainViolationException, InvalidRepeatException
ccf
- CCF signalParseException
IncompatibleArgumentException
UnassignedException
DomainViolationException
InvalidRepeatException
public static IrSignal ccfSignal(String ccfString) throws IrpMasterException
ccfString
- CCF signalIrpMasterException
public static IrSignal ccfSignal(String[] array, int begin) throws IrpMasterException
array
- Strings representing hexadecimal numbersbegin
- Starting indexIrpMasterException
public static int[] parseString(String ccfString) throws NumberFormatException
ccfString
- Input string, to be parsed/tested.NumberFormatException
public static int[] parseStringArray(String[] array, int begin) throws NumberFormatException
array
- Input strings, to be parsed/tested.begin
- Starting indexNumberFormatException
public int[] initArray()
public int[] repeatArray()
public static int[] toArray(double frequency, double[] intro, double[] repetition)
frequency
- intro
- repetition
- public int[] toArray()
public String toPrintString()
public static String toPrintString(int[] array)
array
- CCF in form of an integer array.public static String toPrintString(IrSignal irSignal)
irSignal
- public static String shortCCFString(String protocolName, int device, int subdevice, int command) throws IncompatibleArgumentException
protocolName
- device
- subdevice
- command
- IncompatibleArgumentException
public static int[] shortCCF(String protocolName, int device, int subdevice, int command) throws IncompatibleArgumentException
protocolName
- Name of protcol, presently "rc5", "rc5x", "rc6", and "nec1".device
- subdevice
- command
- IncompatibleArgumentException
- for paramters outside of its allowed domain.public static void main(String[] args)
Copyright © 2015. All rights reserved.