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

Method checkHeader

src/IRReceive.hpp:1216–1229  ·  view source on GitHub ↗

* returns true if values do match */

Source from the content-addressed store, hash-verified

1214 * returns true if values do match
1215 */
1216bool IRrecv::checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants) {
1217// Check header "mark" and "space"
1218 if (!matchMark(irparams.rawbuf[1], aProtocolConstants->DistanceWidthTimingInfo.HeaderMarkMicros)) {
1219 TRACE_PRINT(::getProtocolString(aProtocolConstants->ProtocolIndex));
1220 TRACE_PRINTLN(F(": Header mark length is wrong"));
1221 return false;
1222 }
1223 if (!matchSpace(irparams.rawbuf[2], aProtocolConstants->DistanceWidthTimingInfo.HeaderSpaceMicros)) {
1224 TRACE_PRINT(::getProtocolString(aProtocolConstants->ProtocolIndex));
1225 TRACE_PRINTLN(F(": Header space length is wrong"));
1226 return false;
1227 }
1228 return true;
1229}
1230
1231bool IRrecv::checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM) {
1232// Check header "mark" and "space"

Callers

nothing calls this directly

Calls 3

matchMarkFunction · 0.85
getProtocolStringFunction · 0.85
matchSpaceFunction · 0.85

Tested by

no test coverage detected