* Print results as C variables to be used for sendXXX() * uint16_t address = 0x44; * uint16_t command = 0x11; * uint32_t rawData = 0x44BB11EE; * @param aSerial The Print object on which to write, for Arduino you can use &Serial. */
| 2389 | * @param aSerial The Print object on which to write, for Arduino you can use &Serial. |
| 2390 | */ |
| 2391 | void IRrecv::printIRResultAsCVariables(Print *aSerial) { |
| 2392 | // Now dump "known" codes |
| 2393 | if (decodedIRData.protocol != UNKNOWN) { |
| 2394 | |
| 2395 | /* |
| 2396 | * New decoders have address and command |
| 2397 | */ |
| 2398 | aSerial->print(F("uint16_t")); |
| 2399 | aSerial->print(F(" address = 0x")); |
| 2400 | aSerial->print(decodedIRData.address, HEX); |
| 2401 | aSerial->println(';'); |
| 2402 | |
| 2403 | aSerial->print(F("uint16_t")); |
| 2404 | aSerial->print(F(" command = 0x")); |
| 2405 | aSerial->print(decodedIRData.command, HEX); |
| 2406 | aSerial->println(';'); |
| 2407 | |
| 2408 | // All protocols have raw data |
| 2409 | #if __INT_WIDTH__ < 32 |
| 2410 | aSerial->print(F("uint32_t rawIRTimings = 0x")); |
| 2411 | #else |
| 2412 | aSerial->print(F("uint64_t rawIRTimings = 0x")); |
| 2413 | #endif |
| 2414 | #if (__INT_WIDTH__ < 32) |
| 2415 | aSerial->print(decodedIRData.decodedRawData, HEX); |
| 2416 | #else |
| 2417 | PrintULL::print(aSerial, decodedIRData.decodedRawData, HEX); |
| 2418 | #endif |
| 2419 | aSerial->println(';'); |
| 2420 | } |
| 2421 | } |
| 2422 | |
| 2423 | #if defined(__AVR__) |
| 2424 | const __FlashStringHelper* IRrecv::getProtocolString() { |