MCPcopy Create free account
hub / github.com/Arduino-IRremote/Arduino-IRremote / checkHeader_P

Method checkHeader_P

src/IRReceive.hpp:1231–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229}
1230
1231bool IRrecv::checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM) {
1232// Check header "mark" and "space"
1233 if (!matchMark(irparams.rawbuf[1], pgm_read_word(&aProtocolConstantsPGM->DistanceWidthTimingInfo.HeaderMarkMicros))) {
1234 TRACE_PRINT(::getProtocolString((decode_type_t ) pgm_read_byte(&aProtocolConstantsPGM->ProtocolIndex)));
1235 TRACE_PRINTLN(F(": Header mark length is wrong"));
1236 return false;
1237 }
1238 if (!matchSpace(irparams.rawbuf[2], pgm_read_word(&aProtocolConstantsPGM->DistanceWidthTimingInfo.HeaderSpaceMicros))) {
1239 TRACE_PRINT(::getProtocolString((decode_type_t ) pgm_read_byte(&aProtocolConstantsPGM->ProtocolIndex)));
1240 TRACE_PRINTLN(F(": Header space length is wrong"));
1241 return false;
1242 }
1243 return true;
1244}
1245
1246/*
1247 * Does not check for same address and command, because it is almost not possible to press 2 different buttons on the remote within around 100 ms.

Callers

nothing calls this directly

Calls 3

matchMarkFunction · 0.85
getProtocolStringFunction · 0.85
matchSpaceFunction · 0.85

Tested by

no test coverage detected