IRremoteESP8266
Functions
IRXmpUtils Namespace Reference

Functions

uint8_t getSectionChecksum (const uint32_t data, const uint16_t nbits)
 Get the current checksum value from an XMP data section. More...
 
uint8_t calcSectionChecksum (const uint32_t data, const uint16_t nbits)
 Calculate the correct checksum value for an XMP data section. More...
 
uint64_t updateChecksums (const uint64_t data, const uint16_t nbits)
 Recalculate a XMP message code ensuring it has the checksums valid. More...
 
uint16_t calcRepeatOffset (const uint16_t nbits)
 Calculate the bit offset the repeat nibble in an XMP code. More...
 
bool isRepeat (const uint64_t data, const uint16_t nbits)
 Test if an XMP message code is a repeat or not. More...
 
uint64_t adjustRepeat (const uint64_t data, const uint16_t nbits, const uint8_t repeat_code)
 Adjust an XMP message code to make it a valid repeat or non-repeat code. More...
 

Function Documentation

◆ adjustRepeat()

uint64_t IRXmpUtils::adjustRepeat ( const uint64_t  data,
const uint16_t  nbits,
const uint8_t  repeat_code 
)

Adjust an XMP message code to make it a valid repeat or non-repeat code.

Parameters
[in]dataThe value of the XMP message code.
[in]nbitsThe number of data bits in the entire message code.
[in]repeat_codeThe value of the XMP repeat nibble to use. A value of 8 is the normal value for a repeat. 9 has also been seen. A value of 0 will convert the code to a non-repeat code.
Returns
The valud of the modified XMP code.

◆ calcRepeatOffset()

uint16_t IRXmpUtils::calcRepeatOffset ( const uint16_t  nbits)

Calculate the bit offset the repeat nibble in an XMP code.

Parameters
[in]nbitsThe number of data bits in the entire message code.
Returns
The offset to the start of the XMP repeat nibble.

◆ calcSectionChecksum()

uint8_t IRXmpUtils::calcSectionChecksum ( const uint32_t  data,
const uint16_t  nbits 
)

Calculate the correct checksum value for an XMP data section.

Parameters
[in]dataThe value of the data section.
[in]nbitsThe number of data bits in the section.
Returns
The value of the correct checksum.

◆ getSectionChecksum()

uint8_t IRXmpUtils::getSectionChecksum ( const uint32_t  data,
const uint16_t  nbits 
)

Get the current checksum value from an XMP data section.

Parameters
[in]dataThe value of the data section.
[in]nbitsThe number of data bits in the section.
Returns
The value of the stored checksum.
Warning
Returns 0 if we can't obtain a valid checksum.

◆ isRepeat()

bool IRXmpUtils::isRepeat ( const uint64_t  data,
const uint16_t  nbits 
)

Test if an XMP message code is a repeat or not.

Parameters
[in]dataThe value of the XMP message code.
[in]nbitsThe number of data bits in the entire message code.
Returns
true, if it looks like a repeat, false if not.

◆ updateChecksums()

uint64_t IRXmpUtils::updateChecksums ( const uint64_t  data,
const uint16_t  nbits 
)

Recalculate a XMP message code ensuring it has the checksums valid.

Parameters
[in]dataThe value of the XMP message code.
[in]nbitsThe number of data bits in the entire message code.
Returns
The corrected XMP message with valid checksum sections.