MCPcopy Create free account
hub / github.com/crankyoldgit/IRremoteESP8266 / resultToHumanReadableBasic

Function resultToHumanReadableBasic

src/IRutils.cpp:398–420  ·  view source on GitHub ↗

Dump out the decode_results structure into a human readable format. @param[in] results A ptr to a decode_results structure. @return A String containing the output.

Source from the content-addressed store, hash-verified

396/// @param[in] results A ptr to a decode_results structure.
397/// @return A String containing the output.
398String resultToHumanReadableBasic(const decode_results * const results) {
399 String output = "";
400 // Reserve some space for the string to reduce heap fragmentation.
401 // "Protocol : LONGEST_PROTOCOL_NAME (Repeat)\n"
402 // "Code : 0x (NNNN Bits)\n" = 70 chars
403 output.reserve(2 * kStateSizeMax + 70); // Should cover most cases.
404 // Show Encoding standard
405 output += kProtocolStr;
406 output += F(" : ");
407 output += typeToString(results->decode_type, results->repeat);
408 output += '\n';
409
410 // Show Code & length
411 output += kCodeStr;
412 output += F(" : ");
413 output += resultToHexidecimal(results);
414 output += kSpaceLBraceStr;
415 output += uint64ToString(results->bits);
416 output += ' ';
417 output += kBitsStr;
418 output += F(")\n");
419 return output;
420}
421
422/// Convert a decode_results into an array suitable for `sendRaw()`.
423/// @param[in] decode A ptr to a decode_results structure that contains a mesg.

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 3

typeToStringFunction · 0.85
resultToHexidecimalFunction · 0.85
uint64ToStringFunction · 0.85

Tested by 2

TESTFunction · 0.68
TESTFunction · 0.68