26 static constexpr unsigned int bitsInHexadecimal = 4U;
27 static constexpr unsigned int hexMask = 0xFU;
28 static constexpr uint16_t learnedToken = 0x0000U;
29 static constexpr uint16_t learnedNonModulatedToken = 0x0100U;
30 static constexpr uint32_t referenceFrequency = 4145146UL;
31 static constexpr uint16_t fallbackFrequencyCode = 0x0040U;
32 static constexpr frequency_t fallbackFrequency = 64767U;
33 static constexpr uint32_t microsecondsInSeconds = 1000000UL;
41 static uint16_t toFrequencyCode(
frequency_t frequency);
47 static size_t lengthHexString(
size_t introLength,
size_t repeatLength);
49 static char* prelude(
frequency_t frequency,
size_t introLength,
size_t repeatLength);
51 static char hexDigit(
unsigned int x);
53 static void appendChar(
char *result,
unsigned int& index,
char ch);
55 static void appendDuration(
char *result,
unsigned int& index, uint16_t duration,
microseconds_t timebase);
57 static void appendDigit(
char *result,
unsigned int& index,
unsigned int number);
59 static void appendNumber(
char *result,
unsigned int& index, uint16_t number);
63 static void appendSequence(
char *result,
unsigned int& index,
const IrSequence& irSequence,
microseconds_t timebase);
69 static void dumpNumber(Stream& stream, uint16_t number);
71 static void dumpDigit(Stream& stream,
unsigned int number);
89#if HAS_FLASH_READ || defined(DOXYGEN)
139 return toProntoHex(introData, introLength,
nullptr, 0, frequency);
172 return dump(stream, introSequence.
getDurations(), introSequence.
getLength(), repeatSequence.getDurations(), repeatSequence.getLength(), frequency);
This file defines some general data types that are used in the library.
uint16_t microseconds_t
Type for durations in micro seconds.
uint32_t frequency_t
Type for modulation frequency in Hz.
This class consists of a vector of durations.
static const IrSequence emptyInstance
const microseconds_t * getDurations() const
size_t getLength() const
Returns the number of durations.
This class models an IR signal with intro-, repeat-, and ending sequences.
frequency_t getFrequency() const
const IrSequence & getIntro() const
const IrSequence & getRepeat() const
static constexpr frequency_t defaultFrequency
Static class consisting of functions for parsing a Pronto Hex string (like 0000 006C 0022 0002 015B 0...
static constexpr unsigned int numbersInPreamble
static char * toProntoHex(const IrSignal &irSignal)
Function for generating a Pronto Hex string from the argument.
static void dump(Stream &stream, const IrSequence &introSequence, const IrSequence &repeatSequence=IrSequence::emptyInstance, frequency_t frequency=IrSignal::defaultFrequency)
Function for printing data as Pronto Hex string on the stream given as argument.
static IrSignal * parse(const uint16_t *data, size_t size)
Function for parsing its input data into an IrSignal.
static char * toProntoHex(const IrSequence &introSequence, const IrSequence &repeatSequence=IrSequence::emptyInstance, frequency_t frequency=IrSignal::defaultFrequency)
Function for generating a Pronto Hex string from the arguments.
static void dump(Stream &stream, const IrSignal &irSignal)
Function for printing data as Pronto Hex string on the stream given as argument.
static char * toProntoHex(const microseconds_t *introData, size_t introLength, frequency_t frequency=IrSignal::defaultFrequency)
Function for generating a Pronto Hex string from the arguments.
static constexpr unsigned int digitsInProntoNumber
static IrSignal * parse_PF(const uint_farptr_t str)
Function for parsing its input data into an IrSignal.