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

Method decodeLGMSB

src/ir_LG.hpp:252–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252bool IRrecv::decodeLGMSB(decode_results *aResults) {
253 unsigned int offset = 1; // Skip first space
254
255// Check we have enough data (60) - +4 for initial gap, start bit mark and space + stop bit mark
256 if (aResults->rawlen != (2 * LG_BITS) + 4) {
257 return false;
258 }
259
260// Initial mark/space
261 if (!matchMark(aResults->rawbuf[offset], LG_HEADER_MARK)) {
262 return false;
263 }
264 offset++;
265
266 if (!matchSpace(aResults->rawbuf[offset], LG_HEADER_SPACE)) {
267 return false;
268 }
269 offset++;
270
271 decodePulseDistanceWidthData(LG_BITS, offset, LG_BIT_MARK, LG_ONE_SPACE, 0, PROTOCOL_IS_MSB_FIRST);
272
273// Stop bit
274 if (!matchMark(aResults->rawbuf[offset + (2 * LG_BITS)], LG_BIT_MARK)) {
275 DEBUG_PRINTLN(F("Stop bit mark length is wrong"));
276 return false;
277 }
278
279// Success
280 aResults->value = decodedIRData.decodedRawData;
281 aResults->bits = LG_BITS;
282 aResults->decode_type = LG;
283 decodedIRData.protocol = LG;
284 return true;
285}
286
287//+=============================================================================
288void IRsend::sendLG(unsigned long data, int nbits) {

Callers

nothing calls this directly

Calls 2

matchMarkFunction · 0.85
matchSpaceFunction · 0.85

Tested by

no test coverage detected