Package org.harctoolbox.irp
Class Decoder
java.lang.Object
org.harctoolbox.irp.Decoder
This class makes a decoder of an IrpDatabase, or optionally a subset thereof.
(The subset is essentially to make debugging more comfortable.)
There are essentially two member functions, called
decode, operating
on IrSignal or ModulatedIrSequence
respectively.
These have slightly different semantics.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classstatic final classstatic final classstatic final classstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionDecoder()Mainly for testing and debugging.Decoder(IrpDatabase irpDatabase) Decoder(IrpDatabase irpDatabase, List<String> names) This is the main constructor. -
Method Summary
Modifier and TypeMethodDescriptiondecode(ModulatedIrSequence irSequence, Decoder.DecoderParameters userSuppliedDecoderParameters) Delivers a List of Map of Decodes from a ModulatedIrSequence.decodeIrSignal(IrSignal irSignal) decodeIrSignal(IrSignal irSignal, Decoder.DecoderParameters parameters) Delivers a Map of Decodes from an IrSignal.decodeIrSignalWithFallback(IrSignal irSignal, Decoder.DecoderParameters decoderParams) decodeLoose(IrSignal irSignal, Decoder.DecoderParameters decoderParams) static Stringstatic voidAllows to invoke the decoding from the command line.static voidsetDebugProtocolRegExp(String regexp) For debugging only.
-
Constructor Details
-
Decoder
- Throws:
IrpParseException
-
Decoder
- Throws:
IrpParseExceptionIOExceptionSAXException
-
Decoder
Mainly for testing and debugging.- Parameters:
names-- Throws:
IOExceptionIrpParseExceptionSAXException
-
Decoder
This is the main constructor.- Parameters:
irpDatabase- will be expanded.names- If non-null and non-empty, include only the protocols with these names.- Throws:
IrpParseException
-
-
Method Details
-
setDebugProtocolRegExp
For debugging only.- Parameters:
regexp-
-
getDebugProtocolRegExp
-
main
Allows to invoke the decoding from the command line.- Parameters:
args- Pronto hex type IR signal.
-
decode
public Decoder.DecodeTree decode(ModulatedIrSequence irSequence, Decoder.DecoderParameters userSuppliedDecoderParameters) Delivers a List of Map of Decodes from a ModulatedIrSequence.- Parameters:
irSequence-userSuppliedDecoderParameters-- Returns:
- List of decodes.
-
decodeIrSignal
public Decoder.SimpleDecodesSet decodeIrSignal(IrSignal irSignal, Decoder.DecoderParameters parameters) Delivers a Map of Decodes from an IrSignal. Ifstrict == true, the intro, repeat, and ending sequences are required to match exactly. Otherwise, the irSignal's intro may match a Protocol's repeat, and a missing ending sequence is considered to match a Protocol's non-empty ending. on return, a dictionary (Map) is returned, containing all possible decodes of the given input signal. UnlessallDecodes == true, decodes are eliminated from this list according to the NamedProtocol'sprefer-overproperty.- Parameters:
irSignal- Input dataparameters-- Returns:
- Map of decodes with protocol name as key.
-
decodeIrSignal
-
decodeLoose
public Decoder.AbstractDecodesCollection<? extends ElementaryDecode> decodeLoose(IrSignal irSignal, Decoder.DecoderParameters decoderParams) -
decodeIrSignalWithFallback
public Decoder.AbstractDecodesCollection<? extends ElementaryDecode> decodeIrSignalWithFallback(IrSignal irSignal, Decoder.DecoderParameters decoderParams)
-