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

Method decodeHashOld

src/IRReceive.hpp:1187–1207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187bool IRrecv::decodeHashOld(decode_results *aResults) {
1188 unsigned long hash = FNV_BASIS_32;
1189
1190// Require at least 6 samples to prevent triggering on noise
1191 if (aResults->rawlen < 6) {
1192 return false;
1193 }
1194
1195 for (uint8_t i = 3; i < aResults->rawlen; i++) {
1196 uint_fast8_t value = compare(aResults->rawbuf[i - 2], aResults->rawbuf[i]);
1197 // Add value into the hash
1198 hash = (hash * FNV_PRIME_32) ^ value;
1199 }
1200
1201 aResults->value = hash;
1202 aResults->bits = 32;
1203 aResults->decode_type = UNKNOWN;
1204 decodedIRData.protocol = UNKNOWN;
1205
1206 return true;
1207}
1208
1209/**********************************************************************************************************************
1210 * Match functions

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected