diff --git a/lib/IRremoteESP8266-2.7.3/CPPLINT.cfg b/lib/IRremoteESP8266-2.7.4/CPPLINT.cfg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/CPPLINT.cfg rename to lib/IRremoteESP8266-2.7.4/CPPLINT.cfg diff --git a/lib/IRremoteESP8266-2.7.3/LICENSE.txt b/lib/IRremoteESP8266-2.7.4/LICENSE.txt similarity index 100% rename from lib/IRremoteESP8266-2.7.3/LICENSE.txt rename to lib/IRremoteESP8266-2.7.4/LICENSE.txt diff --git a/lib/IRremoteESP8266-2.7.3/README.md b/lib/IRremoteESP8266-2.7.4/README.md similarity index 98% rename from lib/IRremoteESP8266-2.7.3/README.md rename to lib/IRremoteESP8266-2.7.4/README.md index 9ca606af8..093b15cc1 100644 --- a/lib/IRremoteESP8266-2.7.3/README.md +++ b/lib/IRremoteESP8266-2.7.4/README.md @@ -9,8 +9,8 @@ This library enables you to **send _and_ receive** infra-red signals on an [ESP8266](https://github.com/esp8266/Arduino) or an [ESP32](https://github.com/espressif/arduino-esp32) using the [Arduino framework](https://www.arduino.cc/) using common 940nm IR LEDs and common IR receiver modules. e.g. TSOP{17,22,24,36,38,44,48}* demodulators etc. -## v2.7.3 Now Available -Version 2.7.3 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes. +## v2.7.4 Now Available +Version 2.7.4 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes. #### Upgrading from pre-v2.0 Usage of the library has been slightly changed in v2.0. You will need to change your usage to work with v2.0 and beyond. You can read more about the changes required on our [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page. diff --git a/lib/IRremoteESP8266-2.7.3/README_fr.md b/lib/IRremoteESP8266-2.7.4/README_fr.md similarity index 98% rename from lib/IRremoteESP8266-2.7.3/README_fr.md rename to lib/IRremoteESP8266-2.7.4/README_fr.md index ca31b3b7b..f95bcc945 100644 --- a/lib/IRremoteESP8266-2.7.3/README_fr.md +++ b/lib/IRremoteESP8266-2.7.4/README_fr.md @@ -9,8 +9,8 @@ Cette librairie vous permetra de **recevoir et d'envoyer des signaux** infrarouge sur le protocole [ESP8266](https://github.com/esp8266/Arduino) ou sur le protocole [ESP32](https://github.com/espressif/arduino-esp32) en utilisant le [Arduino framework](https://www.arduino.cc/) qui utilise la norme 940nm IR LEDs et le module basique de reception d'onde IR. Exemple : TSOP{17,22,24,36,38,44,48}* modules etc. -## v2.7.3 disponible -Version 2.7.3 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants. +## v2.7.4 disponible +Version 2.7.4 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants. #### mise à jour depuis pre-v2.0 L'utilisation de la librairie à un peu changer depuis la version in v2.0. Si vous voulez l'utiliser vous devrez changer votre utilisation aussi. Vous pouvez vous renseigner sur les précondition d'utilisation ici : [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page. diff --git a/lib/IRremoteESP8266-2.7.3/ReleaseNotes.md b/lib/IRremoteESP8266-2.7.4/ReleaseNotes.md similarity index 96% rename from lib/IRremoteESP8266-2.7.3/ReleaseNotes.md rename to lib/IRremoteESP8266-2.7.4/ReleaseNotes.md index a7218fc07..4c6b1a967 100644 --- a/lib/IRremoteESP8266-2.7.3/ReleaseNotes.md +++ b/lib/IRremoteESP8266-2.7.4/ReleaseNotes.md @@ -1,5 +1,25 @@ # Release Notes +## _v2.7.4 (20200226)_ + +**[Bug Fixes]** +- IRMQTTServer: Fix bug when receiving an IR A/C message and not re-transmitting it. (#1035, #1038) +- Coolix: `setRaw()` doesn't update power state. (#1040, #1041) + +**[Features]** +- Electra: Add improved feature support. (#1033, #1051) +- Add support for Epson protocol. (#1034, #1050) +- Add options to `decode()` to aid detection. Improve NEC detection. (#1042, #1046) +- SamsungAc: Add support for Light & Ion (VirusDoctor). (#1045, #1048, #1049) +- Add Italian (it-IT) locale/language support. (#1047) (kudos @egueli) +- gc_decode: Add repeat support for pronto codes. (#1034, #1043) + +**[Misc]** +- Update supported SamsungAc devices (#1045) +- Coolix: Subtle protocol timing adjustments (#1036, #1037) +- Add supported Electra device model info (#1033) + + ## _v2.7.3 (20200130)_ **[Features]** diff --git a/lib/IRremoteESP8266-2.7.3/SupportedProtocols.md b/lib/IRremoteESP8266-2.7.4/SupportedProtocols.md similarity index 95% rename from lib/IRremoteESP8266-2.7.3/SupportedProtocols.md rename to lib/IRremoteESP8266-2.7.4/SupportedProtocols.md index c9b2f85c7..04661c3bb 100644 --- a/lib/IRremoteESP8266-2.7.3/SupportedProtocols.md +++ b/lib/IRremoteESP8266-2.7.4/SupportedProtocols.md @@ -1,6 +1,6 @@ + Last generated: Wed Feb 26 16:31:08 2020 ---> # IR Protocols supported by this library | Protocol | Brand | Model | A/C Model | Detailed A/C Support | @@ -16,6 +16,8 @@ | [Denon](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Denon.cpp) | **Unknown** | | | - | | [Dish](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Dish.cpp) | **DISH NETWORK** | echostar 301 | | - | | [Electra](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.cpp) | **[AUX](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.h)** | KFR-35GW/BpNFW=3 A/C
YKR-T/011 remote | | Yes | +| [Electra](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.cpp) | **[Electra](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Electra.h)** | Classic INV 17 / AXW12DCS A/C
YKR-M/003E remote | | Yes | +| [Epson](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Epson.cpp) | **Unknown** | | | - | | [Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.cpp) | **[Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.h)** | AGTV14LAC A/C
AR-DB1 remote
AR-DL10 remote
AR-RAC1E remote
AR-RAE1E remote
AR-RAH2E remote
AR-REB1E remote
AR-RY4 remote
AST9RSGCW A/C
ASTB09LBC A/C
ASU30C1 A/C
ASYG30LFCA A/C
ASYG7LMCA A/C | ARDB1
ARJW2
ARRAH2E
ARREB1E
ARRY4 | Yes | | [Fujitsu](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.cpp) | **[Fujitsu General](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Fujitsu.h)** | AR-JW2 remote | ARDB1
ARJW2
ARRAH2E
ARREB1E
ARRY4 | Yes | | [GICable](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_GICable.cpp) | **Unknown** | | | - | @@ -54,7 +56,7 @@ | [Pronto](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Pronto.cpp) | **Unknown** | | | - | | [RC5_RC6](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_RC5_RC6.cpp) | **Unknown** | | | - | | [RCMM](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_RCMM.cpp) | **Microsoft** | XBOX 360 | | - | -| [Samsung](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Samsung.cpp) | **[Samsung](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Samsung.h)** | AR12HSSDBWKNEU A/C
AR12KSFPEWQNET A/C
IEC-R03 remote
UA55H6300 TV | | Yes | +| [Samsung](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Samsung.cpp) | **[Samsung](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Samsung.h)** | AR09FSSDAWKNFA A/C
AR12HSSDBWKNEU A/C
AR12KSFPEWQNET A/C
DB63-03556X003 remote
IEC-R03 remote
UA55H6300 TV | | Yes | | [Sanyo](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sanyo.cpp) | **Unknown** | | | - | | [Sharp](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sharp.cpp) | **[Sharp](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sharp.h)** | AY-ZP40KR A/C
LC-52D62U TV | | Yes | | [Sherwood](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Sherwood.cpp) | **Sherwood** | RC-138 remote
RD6505(B) Receiver | | - | @@ -94,6 +96,7 @@ - DENON - DISH - ELECTRA_AC +- EPSON - FUJITSU_AC - GICABLE - GOODWEATHER diff --git a/lib/IRremoteESP8266-2.7.3/examples/CommonAcControl/CommonAcControl.ino b/lib/IRremoteESP8266-2.7.4/examples/CommonAcControl/CommonAcControl.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/CommonAcControl/CommonAcControl.ino rename to lib/IRremoteESP8266-2.7.4/examples/CommonAcControl/CommonAcControl.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/CommonAcControl/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/CommonAcControl/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/CommonAcControl/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/CommonAcControl/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/ControlSamsungAC/ControlSamsungAC.ino b/lib/IRremoteESP8266-2.7.4/examples/ControlSamsungAC/ControlSamsungAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/ControlSamsungAC/ControlSamsungAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/ControlSamsungAC/ControlSamsungAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/ControlSamsungAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/ControlSamsungAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/ControlSamsungAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/ControlSamsungAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/DumbIRRepeater/DumbIRRepeater.ino b/lib/IRremoteESP8266-2.7.4/examples/DumbIRRepeater/DumbIRRepeater.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/DumbIRRepeater/DumbIRRepeater.ino rename to lib/IRremoteESP8266-2.7.4/examples/DumbIRRepeater/DumbIRRepeater.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/DumbIRRepeater/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/DumbIRRepeater/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/DumbIRRepeater/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/DumbIRRepeater/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRGCSendDemo/IRGCSendDemo.ino b/lib/IRremoteESP8266-2.7.4/examples/IRGCSendDemo/IRGCSendDemo.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRGCSendDemo/IRGCSendDemo.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRGCSendDemo/IRGCSendDemo.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRGCSendDemo/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRGCSendDemo/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRGCSendDemo/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRGCSendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRGCTCPServer/IRGCTCPServer.ino b/lib/IRremoteESP8266-2.7.4/examples/IRGCTCPServer/IRGCTCPServer.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRGCTCPServer/IRGCTCPServer.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRGCTCPServer/IRGCTCPServer.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRGCTCPServer/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRGCTCPServer/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRGCTCPServer/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRGCTCPServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.h b/lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.h similarity index 99% rename from lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.h rename to lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.h index 0693a4908..b363d98b9 100644 --- a/lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.h +++ b/lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.h @@ -239,7 +239,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes // ----------------- End of User Configuration Section ------------------------- // Constants -#define _MY_VERSION_ "v1.4.5" +#define _MY_VERSION_ "v1.4.6" const uint8_t kRebootTime = 15; // Seconds const uint8_t kQuickDisplayTime = 2; // Seconds diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.ino b/lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.ino similarity index 99% rename from lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.ino index 1824c660a..efcf25431 100644 --- a/lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/IRMQTTServer.ino +++ b/lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/IRMQTTServer.ino @@ -2679,7 +2679,7 @@ uint64_t getUInt64fromHex(char const *str) { // code: Numeric payload of the IR message. Most protocols use this. // code_str: The unparsed code to be sent. Used by complex protocol encodings. // bits: Nr. of bits in the protocol. 0 means use the protocol's default. -// repeat: Nr. of times the message is to be repeated. (Not all protcols.) +// repeat: Nr. of times the message is to be repeated. (Not all protocols.) // Returns: // bool: Successfully sent or not. bool sendIRCode(IRsend *irsend, decode_type_t const ir_type, @@ -3071,6 +3071,10 @@ bool sendClimate(const String topic_prefix, const bool retain, lastClimateIr.reset(); irClimateCounter++; } + // Mark the "next" value as old/previous. + if (ac != NULL) { + ac->markAsSent(); + } return success; } @@ -3098,20 +3102,20 @@ bool decodeCommonAc(const decode_results *decode) { } #if IGNORE_DECODED_AC_PROTOCOL if (climate[0]->next.protocol != decode_type_t::UNKNOWN) { - // Use the previous protcol/model if set. + // Use the previous protocol/model if set. state.protocol = climate[0]->next.protocol; state.model = climate[0]->next.model; } #endif // IGNORE_DECODED_AC_PROTOCOL -// Continue to use the previously prefered temperature units. -// i.e. Keep using Celsius or Fahrenheit. -if (climate[0]->next.celsius != state.celsius) { - // We've got a mismatch, so we need to convert. - state.degrees = climate[0]->next.celsius ? fahrenheitToCelsius(state.degrees) - : celsiusToFahrenheit(state.degrees); - state.celsius = climate[0]->next.celsius; -} -climate[0]->next = state; // Copy over the new climate state. + // Continue to use the previously prefered temperature units. + // i.e. Keep using Celsius or Fahrenheit. + if (climate[0]->next.celsius != state.celsius) { + // We've got a mismatch, so we need to convert. + state.degrees = climate[0]->next.celsius ? + fahrenheitToCelsius(state.degrees) : celsiusToFahrenheit(state.degrees); + state.celsius = climate[0]->next.celsius; + } + climate[0]->next = state; // Copy over the new climate state. #if MQTT_ENABLE sendClimate(genStatTopic(0), true, false, REPLAY_DECODED_AC_MESSAGE, REPLAY_DECODED_AC_MESSAGE, climate[0]); diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRMQTTServer/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRMQTTServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRServer/IRServer.ino b/lib/IRremoteESP8266-2.7.4/examples/IRServer/IRServer.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRServer/IRServer.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRServer/IRServer.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRServer/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRServer/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRServer/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRServer/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDemo/IRrecvDemo.ino b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDemo/IRrecvDemo.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDemo/IRrecvDemo.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDemo/IRrecvDemo.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDemo/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDemo/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDemo/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDump/IRrecvDump.ino b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDump/IRrecvDump.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDump/IRrecvDump.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDump/IRrecvDump.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDump/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDump/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDump/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDump/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDumpV2/IRrecvDumpV2.ino similarity index 99% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDumpV2/IRrecvDumpV2.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDumpV2/IRrecvDumpV2.ino index beed6c746..8ea98b687 100644 --- a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDumpV2/IRrecvDumpV2.ino +++ b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDumpV2/IRrecvDumpV2.ino @@ -17,7 +17,7 @@ * Version 0.4 July, 2018 * - Minor improvements and more A/C unit support. * Version 0.3 November, 2017 - * - Support for A/C decoding for some protcols. + * - Support for A/C decoding for some protocols. * Version 0.2 April, 2017 * - Decode from a copy of the data so we can start capturing faster thus * reduce the likelihood of miscaptures. diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRrecvDumpV2/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRrecvDumpV2/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRrecvDumpV2/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRrecvDumpV2/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRsendDemo/IRsendDemo.ino b/lib/IRremoteESP8266-2.7.4/examples/IRsendDemo/IRsendDemo.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRsendDemo/IRsendDemo.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRsendDemo/IRsendDemo.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRsendDemo/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRsendDemo/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRsendDemo/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRsendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRsendProntoDemo/IRsendProntoDemo.ino b/lib/IRremoteESP8266-2.7.4/examples/IRsendProntoDemo/IRsendProntoDemo.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRsendProntoDemo/IRsendProntoDemo.ino rename to lib/IRremoteESP8266-2.7.4/examples/IRsendProntoDemo/IRsendProntoDemo.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/IRsendProntoDemo/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/IRsendProntoDemo/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/IRsendProntoDemo/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/IRsendProntoDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino b/lib/IRremoteESP8266-2.7.4/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino rename to lib/IRremoteESP8266-2.7.4/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/JVCPanasonicSendDemo/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/JVCPanasonicSendDemo/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/JVCPanasonicSendDemo/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/JVCPanasonicSendDemo/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/LGACSend/LGACSend.ino b/lib/IRremoteESP8266-2.7.4/examples/LGACSend/LGACSend.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/LGACSend/LGACSend.ino rename to lib/IRremoteESP8266-2.7.4/examples/LGACSend/LGACSend.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/LGACSend/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/LGACSend/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/LGACSend/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/LGACSend/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/SmartIRRepeater/SmartIRRepeater.ino b/lib/IRremoteESP8266-2.7.4/examples/SmartIRRepeater/SmartIRRepeater.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/SmartIRRepeater/SmartIRRepeater.ino rename to lib/IRremoteESP8266-2.7.4/examples/SmartIRRepeater/SmartIRRepeater.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/SmartIRRepeater/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/SmartIRRepeater/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/SmartIRRepeater/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/SmartIRRepeater/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnArgoAC/TurnOnArgoAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnArgoAC/TurnOnArgoAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnArgoAC/TurnOnArgoAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnArgoAC/TurnOnArgoAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnArgoAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnArgoAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnArgoAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnArgoAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnDaikinAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnDaikinAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnDaikinAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnDaikinAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnFujitsuAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnFujitsuAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnFujitsuAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnFujitsuAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnKelvinatorAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnKelvinatorAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnKelvinatorAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnKelvinatorAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiHeavyAc/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiHeavyAc/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnMitsubishiHeavyAc/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnMitsubishiHeavyAc/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnPanasonicAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnPanasonicAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnPanasonicAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnPanasonicAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnToshibaAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnToshibaAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnToshibaAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnToshibaAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino b/lib/IRremoteESP8266-2.7.4/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/TurnOnTrotecAC/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/TurnOnTrotecAC/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/TurnOnTrotecAC/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/TurnOnTrotecAC/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/README.md b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/README.md similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/README.md rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/README.md diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/Web-AC-control.ino b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/Web-AC-control.ino similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/Web-AC-control.ino rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/Web-AC-control.ino diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/platformio.ini b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/platformio.ini similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/platformio.ini rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/platformio.ini diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/printscreen.png b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/printscreen.png similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/printscreen.png rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/printscreen.png diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/favicon.ico b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/favicon.ico similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/favicon.ico rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/favicon.ico diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_1_off.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_1_off.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_1_off.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_1_off.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_1_on.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_1_on.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_1_on.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_1_on.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_2_off.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_2_off.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_2_off.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_2_off.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_2_on.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_2_on.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_2_on.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_2_on.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_3_off.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_3_off.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_3_off.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_3_off.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_3_on.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_3_on.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_3_on.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_3_on.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_4_off.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_4_off.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_4_off.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_4_off.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_4_on.svg b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_4_on.svg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/level_4_on.svg rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/level_4_on.svg diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/ui.html b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/ui.html similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/ui.html rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/ui.html diff --git a/lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/ui.js b/lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/ui.js similarity index 100% rename from lib/IRremoteESP8266-2.7.3/examples/Web-AC-control/upload/ui.js rename to lib/IRremoteESP8266-2.7.4/examples/Web-AC-control/upload/ui.js diff --git a/lib/IRremoteESP8266-2.7.3/keywords.txt b/lib/IRremoteESP8266-2.7.4/keywords.txt similarity index 99% rename from lib/IRremoteESP8266-2.7.3/keywords.txt rename to lib/IRremoteESP8266-2.7.4/keywords.txt index 65b0d8b2e..077c0bc74 100644 --- a/lib/IRremoteESP8266-2.7.3/keywords.txt +++ b/lib/IRremoteESP8266-2.7.4/keywords.txt @@ -133,6 +133,7 @@ convertSwingV KEYWORD2 coolix KEYWORD2 copyIrParams KEYWORD2 countBits KEYWORD2 +crudeNoiseFilter KEYWORD2 daikin KEYWORD2 daikin128 KEYWORD2 daikin152 KEYWORD2 @@ -156,6 +157,7 @@ decodeDaikin2 KEYWORD2 decodeDaikin216 KEYWORD2 decodeDenon KEYWORD2 decodeElectraAC KEYWORD2 +decodeEpson KEYWORD2 decodeFujitsuAC KEYWORD2 decodeGICable KEYWORD2 decodeGoodweather KEYWORD2 @@ -252,6 +254,7 @@ getCorrectedRawLength KEYWORD2 getCurrTime KEYWORD2 getCurrentDay KEYWORD2 getCurrentTime KEYWORD2 +getDisplay KEYWORD2 getEcono KEYWORD2 getEye KEYWORD2 getEyeAuto KEYWORD2 @@ -355,6 +358,7 @@ ledOff KEYWORD2 ledOn KEYWORD2 lg KEYWORD2 mark KEYWORD2 +markAsSent KEYWORD2 match KEYWORD2 matchAtLeast KEYWORD2 matchBytes KEYWORD2 @@ -406,6 +410,7 @@ sendDaikin216 KEYWORD2 sendData KEYWORD2 sendDenon KEYWORD2 sendElectraAC KEYWORD2 +sendEpson KEYWORD2 sendExtended KEYWORD2 sendFujitsuAC KEYWORD2 sendGC KEYWORD2 @@ -484,6 +489,7 @@ setCommand KEYWORD2 setCurrTime KEYWORD2 setCurrentDay KEYWORD2 setCurrentTime KEYWORD2 +setDisplay KEYWORD2 setEcono KEYWORD2 setEye KEYWORD2 setEyeAuto KEYWORD2 @@ -666,6 +672,7 @@ DECODE_DAIKIN216 LITERAL1 DECODE_DENON LITERAL1 DECODE_DISH LITERAL1 DECODE_ELECTRA_AC LITERAL1 +DECODE_EPSON LITERAL1 DECODE_FUJITSU_AC LITERAL1 DECODE_GICABLE LITERAL1 DECODE_GLOBALCACHE LITERAL1 @@ -728,6 +735,8 @@ DG11J191 LITERAL1 DISH LITERAL1 DISH_BITS LITERAL1 ELECTRA_AC LITERAL1 +ENABLE_NOISE_FILTER_OPTION LITERAL1 +EPSON LITERAL1 FUJITSU_AC LITERAL1 FUJITSU_AC_BITS LITERAL1 FUJITSU_AC_CMD_STAY_ON LITERAL1 @@ -964,6 +973,7 @@ SEND_DAIKIN216 LITERAL1 SEND_DENON LITERAL1 SEND_DISH LITERAL1 SEND_ELECTRA_AC LITERAL1 +SEND_EPSON LITERAL1 SEND_FUJITSU_AC LITERAL1 SEND_GICABLE LITERAL1 SEND_GLOBALCACHE LITERAL1 @@ -1634,6 +1644,7 @@ kEconoStr LITERAL1 kElectraAcAuto LITERAL1 kElectraAcBitMark LITERAL1 kElectraAcBits LITERAL1 +kElectraAcCleanOffset LITERAL1 kElectraAcCool LITERAL1 kElectraAcDry LITERAL1 kElectraAcFan LITERAL1 @@ -1646,6 +1657,9 @@ kElectraAcFanSize LITERAL1 kElectraAcHdrMark LITERAL1 kElectraAcHdrSpace LITERAL1 kElectraAcHeat LITERAL1 +kElectraAcLightToggleMask LITERAL1 +kElectraAcLightToggleOff LITERAL1 +kElectraAcLightToggleOn LITERAL1 kElectraAcMaxTemp LITERAL1 kElectraAcMessageGap LITERAL1 kElectraAcMinRepeat LITERAL1 @@ -1662,7 +1676,10 @@ kElectraAcSwingVOffset LITERAL1 kElectraAcTempDelta LITERAL1 kElectraAcTempOffset LITERAL1 kElectraAcTempSize LITERAL1 +kElectraAcTurboOffset LITERAL1 kElectraAcZeroSpace LITERAL1 +kEpsonBits LITERAL1 +kEpsonMinRepeat LITERAL1 kEyeAutoStr LITERAL1 kEyeStr LITERAL1 kFalseStr LITERAL1 @@ -2763,6 +2780,7 @@ kSamsungAcClean10Offset LITERAL1 kSamsungAcClean11Offset LITERAL1 kSamsungAcCool LITERAL1 kSamsungAcDefaultRepeat LITERAL1 +kSamsungAcDisplayOffset LITERAL1 kSamsungAcDry LITERAL1 kSamsungAcExtendedBits LITERAL1 kSamsungAcExtendedStateLength LITERAL1 @@ -2778,6 +2796,7 @@ kSamsungAcFanTurbo LITERAL1 kSamsungAcHdrMark LITERAL1 kSamsungAcHdrSpace LITERAL1 kSamsungAcHeat LITERAL1 +kSamsungAcIonOffset LITERAL1 kSamsungAcMaxTemp LITERAL1 kSamsungAcMinTemp LITERAL1 kSamsungAcModeOffset LITERAL1 diff --git a/lib/IRremoteESP8266-2.7.3/library.json b/lib/IRremoteESP8266-2.7.4/library.json similarity index 97% rename from lib/IRremoteESP8266-2.7.3/library.json rename to lib/IRremoteESP8266-2.7.4/library.json index b28b1b218..f135c19e7 100644 --- a/lib/IRremoteESP8266-2.7.3/library.json +++ b/lib/IRremoteESP8266-2.7.4/library.json @@ -1,6 +1,6 @@ { "name": "IRremoteESP8266", - "version": "2.7.3", + "version": "2.7.4", "keywords": "infrared, ir, remote, esp8266, esp32", "description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)", "repository": diff --git a/lib/IRremoteESP8266-2.7.3/library.properties b/lib/IRremoteESP8266-2.7.4/library.properties similarity index 83% rename from lib/IRremoteESP8266-2.7.3/library.properties rename to lib/IRremoteESP8266-2.7.4/library.properties index b22e7f8cc..e98cd3f3b 100644 --- a/lib/IRremoteESP8266-2.7.3/library.properties +++ b/lib/IRremoteESP8266-2.7.4/library.properties @@ -1,7 +1,7 @@ name=IRremoteESP8266 -version=2.7.3 +version=2.7.4 author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff -maintainer=Mark Szabo, David Conran, Sebastien Warin, Roi Dayan, Massimiliano Pinto +maintainer=David Conran, Mark Szabo, Sebastien Warin, Roi Dayan, Massimiliano Pinto sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32) paragraph=This library enables you to send and receive infra-red signals on an ESP8266 or an ESP32. category=Device Control diff --git a/lib/IRremoteESP8266-2.7.3/pylintrc b/lib/IRremoteESP8266-2.7.4/pylintrc similarity index 100% rename from lib/IRremoteESP8266-2.7.3/pylintrc rename to lib/IRremoteESP8266-2.7.4/pylintrc diff --git a/lib/IRremoteESP8266-2.7.3/src/CPPLINT.cfg b/lib/IRremoteESP8266-2.7.4/src/CPPLINT.cfg similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/CPPLINT.cfg rename to lib/IRremoteESP8266-2.7.4/src/CPPLINT.cfg diff --git a/lib/IRremoteESP8266-2.7.3/src/IRac.cpp b/lib/IRremoteESP8266-2.7.4/src/IRac.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/src/IRac.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRac.cpp index b2dc6f63e..d3be30b80 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRac.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/IRac.cpp @@ -45,7 +45,7 @@ IRac::IRac(const uint16_t pin, const bool inverted, const bool use_modulation) { _inverted = inverted; _modulation = use_modulation; initState(&next); - _prev = next; + this->markAsSent(); } void IRac::initState(stdAc::state_t *state, @@ -466,7 +466,8 @@ void IRac::electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const stdAc::swingh_t swingh) { + const stdAc::swingh_t swingh, const bool turbo, + const bool lighttoggle, const bool clean) { ac->begin(); ac->setPower(on); ac->setMode(ac->convertMode(mode)); @@ -475,11 +476,12 @@ void IRac::electra(IRElectraAc *ac, ac->setSwingV(swingv != stdAc::swingv_t::kOff); ac->setSwingH(swingh != stdAc::swingh_t::kOff); // No Quiet setting available. - // No Turbo setting available. + ac->setTurbo(turbo); + ac->setLightToggle(lighttoggle); // No Light setting available. // No Econo setting available. // No Filter setting available. - // No Clean setting available. + ac->setClean(clean); // No Beep setting available. // No Sleep setting available. // No Clock setting available. @@ -968,7 +970,8 @@ void IRac::samsung(IRSamsungAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const bool quiet, const bool turbo, const bool clean, + const bool quiet, const bool turbo, const bool light, + const bool filter, const bool clean, const bool beep, const bool prevpower, const bool forcepower) { ac->begin(); @@ -981,9 +984,9 @@ void IRac::samsung(IRSamsungAc *ac, // No Horizontal swing setting available. ac->setQuiet(quiet); ac->setPowerful(turbo); - // No Light setting available. + ac->setDisplay(light); // No Econo setting available. - // No Filter setting available. + ac->setIon(filter); ac->setClean(clean); ac->setBeep(beep); // No Sleep setting available. @@ -1219,6 +1222,9 @@ stdAc::state_t IRac::handleToggles(const stdAc::state_t desired, result.power = desired.power ^ prev->power; result.light = desired.light ^ prev->light; break; + case decode_type_t::ELECTRA_AC: + result.light = desired.light ^ prev->light; + break; case decode_type_t::MIDEA: case decode_type_t::HITACHI_AC424: if ((desired.swingv == stdAc::swingv_t::kOff) ^ @@ -1389,7 +1395,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { { IRElectraAc ac(_pin, _inverted, _modulation); electra(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.swingh); + send.swingh, send.turbo, send.light, send.clean); break; } #endif // SEND_ELECTRA_AC @@ -1557,7 +1563,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { { IRSamsungAc ac(_pin, _inverted, _modulation); samsung(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.quiet, send.turbo, send.clean, send.beep, prev->power); + send.quiet, send.turbo, send.light, send.filter, send.clean, + send.beep, prev->power); break; } #endif // SEND_SAMSUNG_AC @@ -1628,13 +1635,18 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { return true; // Success. } +// Update the previous state to the current one. +void IRac::markAsSent(void) { + _prev = next; +} + // Send an A/C message based soley on our internal state. // // Returns: // boolean: True, if accepted/converted/attempted. False, if unsupported. bool IRac::sendAc(void) { bool success = this->sendAc(next, &_prev); - _prev = next; + if (success) this->markAsSent(); return success; } @@ -2232,7 +2244,6 @@ namespace IRAcUtils { #if DECODE_COOLIX case decode_type_t::COOLIX: { IRCoolixAC ac(kGpioUnused); - ac.on(); ac.setRaw(decode->value); // Uses value instead of state. *result = ac.toCommon(prev); break; diff --git a/lib/IRremoteESP8266-2.7.3/src/IRac.h b/lib/IRremoteESP8266-2.7.4/src/IRac.h similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/IRac.h rename to lib/IRremoteESP8266-2.7.4/src/IRac.h index 4945bfac9..f38865e50 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRac.h +++ b/lib/IRremoteESP8266-2.7.4/src/IRac.h @@ -54,6 +54,7 @@ class IRac { const bool beep, const int16_t sleep, const int16_t clock); static void initState(stdAc::state_t *state); + void markAsSent(void); bool sendAc(void); bool sendAc(const stdAc::state_t desired, const stdAc::state_t *prev = NULL); bool sendAc(const decode_type_t vendor, const int16_t model, @@ -170,7 +171,8 @@ void electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const stdAc::swingh_t swingh); + const stdAc::swingh_t swingh, const bool turbo, + const bool lighttoggle, const bool clean); #endif // SEND_ELECTRA_AC #if SEND_FUJITSU_AC void fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model, @@ -299,7 +301,8 @@ void electra(IRElectraAc *ac, void samsung(IRSamsungAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const bool quiet, const bool turbo, const bool clean, + const bool quiet, const bool turbo, const bool light, + const bool filter, const bool clean, const bool beep, const bool prevpower = true, const bool forcepower = true); #endif // SEND_SAMSUNG_AC diff --git a/lib/IRremoteESP8266-2.7.3/src/IRrecv.cpp b/lib/IRremoteESP8266-2.7.4/src/IRrecv.cpp similarity index 72% rename from lib/IRremoteESP8266-2.7.3/src/IRrecv.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRrecv.cpp index c2c1b5394..e629fc218 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRrecv.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/IRrecv.cpp @@ -307,6 +307,37 @@ void IRrecv::setTolerance(const uint8_t percent) { // Get the base tolerance percentage for matching incoming IR messages. uint8_t IRrecv::getTolerance(void) { return _tolerance; } +#if ENABLE_NOISE_FILTER_OPTION +// Remove or merge pulses in the capture buffer that are too short. +// Args: +// results: Ptr to the decode_results we are going to filter/modify. +// floor: Only allow values in the buffer large than this. (in micro seconds) +void IRrecv::crudeNoiseFilter(decode_results *results, const uint16_t floor) { + if (floor == 0) return; // Nothing to do. + const uint16_t kTickFloor = floor / kRawTick; + const uint16_t kBufSize = getBufSize(); + uint16_t offset = kStartOffset; + while (offset < results->rawlen && offset + 2 < kBufSize) { + uint16_t curr = results->rawbuf[offset]; + uint16_t next = results->rawbuf[offset + 1]; + uint16_t addition = curr + next; + if (curr < kTickFloor) { // Is it too short? + // Shuffle the buffer down. i.e. Remove the mark & space pair. + // Note: `memcpy()` can't be used as rawbuf is `volatile`. + for (uint16_t i = offset + 2; i <= results->rawlen && i < kBufSize; i++) + results->rawbuf[i - 2] = results->rawbuf[i]; + if (offset > 1) { // There is a previous pair we can add to. + // Merge this pair into into the previous space. + results->rawbuf[offset - 1] += addition; + } + results->rawlen -= 2; // Adjust the length. + } else { + offset++; // Move along. + } + } +} +#endif // ENABLE_NOISE_FILTER_OPTION + // Decodes the received IR message. // If the interrupt state is saved, we will immediately resume waiting // for the next IR message to avoid missing messages. @@ -317,9 +348,41 @@ uint8_t IRrecv::getTolerance(void) { return _tolerance; } // results: A pointer to where the decoded IR message will be stored. // save: A pointer to an irparams_t instance in which to save // the interrupt's memory/state. NULL means don't save it. +// max_skip: Maximum Nr. of pulses at the begining of a capture we can skip +// when attempting to find a protocol we can successfully decode. +// This parameter can dramatically improve detection of protocols +// when there is light IR interference just before an incoming IR +// message, however, it comes at a steep performace price. +// CAUTION: Increasing this value will dramatically (linnearly) +// increase the cpu time & usage to decode protocols. +// e.g. 0 -> 1 will be a 2x increase in cpu usage/time. +// 0 -> 2 will be a 3x increase etc. +// If you are going to do this, consider disabling +// protocol decoding for protocols you are not expecting. +// (Default is 0. No skipping.) +// noise_floor: Pulses below this size (in usecs) will be removed or merged +// prior to any decoding. This is to try to remove noise/poor +// readings & slighly increase the chances of a successful +// decode but at the cost of data fidelity & integrity. +// (Defaults to 0 usecs. i.e. Don't filter; which is safe!) +// DANGER: **Here Be Dragons!** +// If you set the `filter_floor` value too high, it **WILL** +// break decoding of some protocols. You have been warned! +// **Any** non-zero value has the potential to **cook** the +// captured raw data. i.e. The data is going to lie to you. +// It may obscure hardware, circuit, & environment issues thus +// making it impossible to support you accurately or +// confidently. +// Values of <= 50 usecs will probably be safe. +// 51 - 100 usecs **might** be okay. +// 100 - 150 usecs is "Danger, Will Robinson!". +// 150 - 200 usecs expect broken protocols. +// At 200+ usecs, you **have** protocols you can't decode!! +// // Returns: // A boolean indicating if an IR message is ready or not. -bool IRrecv::decode(decode_results *results, irparams_t *save) { +bool IRrecv::decode(decode_results *results, irparams_t *save, + uint8_t max_skip, uint16_t noise_floor) { // Proceed only if an IR message been received. #ifndef UNIT_TEST if (irparams.rcvstate != kStopState) return false; @@ -365,320 +428,342 @@ bool IRrecv::decode(decode_results *results, irparams_t *save) { results->command = 0; results->repeat = false; +#if ENABLE_NOISE_FILTER_OPTION + crudeNoiseFilter(results, noise_floor); +#endif // ENABLE_NOISE_FILTER_OPTION + // Keep looking for protocols until we've run out of entries to skip or we + // find a valid protocol message. + for (uint16_t offset = kStartOffset; + offset <= (max_skip * 2) + kStartOffset; + offset += 2) { #if DECODE_AIWA_RC_T501 - DPRINTLN("Attempting Aiwa RC T501 decode"); - // Try decodeAiwaRCT501() before decodeSanyoLC7461() & decodeNEC() - // because the protocols are similar. This protocol is more specific than - // those ones, so should got before them. - if (decodeAiwaRCT501(results)) return true; + DPRINTLN("Attempting Aiwa RC T501 decode"); + // Try decodeAiwaRCT501() before decodeSanyoLC7461() & decodeNEC() + // because the protocols are similar. This protocol is more specific than + // those ones, so should go before them. + if (decodeAiwaRCT501(results, offset)) return true; #endif #if DECODE_SANYO - DPRINTLN("Attempting Sanyo LC7461 decode"); - // Try decodeSanyoLC7461() before decodeNEC() because the protocols are - // similar in timings & structure, but the Sanyo one is much longer than the - // NEC protocol (42 vs 32 bits) so this one should be tried first to try to - // reduce false detection as a NEC packet. - if (decodeSanyoLC7461(results)) return true; + DPRINTLN("Attempting Sanyo LC7461 decode"); + // Try decodeSanyoLC7461() before decodeNEC() because the protocols are + // similar in timings & structure, but the Sanyo one is much longer than the + // NEC protocol (42 vs 32 bits) so this one should be tried first to try to + // reduce false detection as a NEC packet. + if (decodeSanyoLC7461(results, offset)) return true; #endif #if DECODE_CARRIER_AC - DPRINTLN("Attempting Carrier AC decode"); - // Try decodeCarrierAC() before decodeNEC() because the protocols are - // similar in timings & structure, but the Carrier one is much longer than the - // NEC protocol (3x32 bits vs 1x32 bits) so this one should be tried first to - // try to reduce false detection as a NEC packet. - if (decodeCarrierAC(results)) return true; + DPRINTLN("Attempting Carrier AC decode"); + // Try decodeCarrierAC() before decodeNEC() because the protocols are + // similar in timings & structure, but the Carrier one is much longer than + // the NEC protocol (3x32 bits vs 1x32 bits) so this one should be tried + // first to try to reduce false detection as a NEC packet. + if (decodeCarrierAC(results, offset)) return true; #endif #if DECODE_PIONEER - DPRINTLN("Attempting Pioneer decode"); - // Try decodePioneer() before decodeNEC() because the protocols are - // similar in timings & structure, but the Pioneer one is much longer than the - // NEC protocol (2x32 bits vs 1x32 bits) so this one should be tried first to - // try to reduce false detection as a NEC packet. - if (decodePioneer(results)) return true; + DPRINTLN("Attempting Pioneer decode"); + // Try decodePioneer() before decodeNEC() because the protocols are + // similar in timings & structure, but the Pioneer one is much longer than + // the NEC protocol (2x32 bits vs 1x32 bits) so this one should be tried + // first to try to reduce false detection as a NEC packet. + if (decodePioneer(results, offset)) return true; +#endif +#if DECODE_EPSON + DPRINTLN("Attempting Epson decode"); + // Try decodeEpson() before decodeNEC() because the protocols are + // similar in timings & structure, but the Epson one is much longer than the + // NEC protocol (3x32 identical bits vs 1x32 bits) so this one should be tried + // first to try to reduce false detection as a NEC packet. + if (decodeEpson(results, offset)) return true; #endif #if DECODE_NEC - DPRINTLN("Attempting NEC decode"); - if (decodeNEC(results)) return true; + DPRINTLN("Attempting NEC decode"); + if (decodeNEC(results, offset)) return true; #endif #if DECODE_SONY - DPRINTLN("Attempting Sony decode"); - if (decodeSony(results)) return true; + DPRINTLN("Attempting Sony decode"); + if (decodeSony(results, offset)) return true; #endif #if DECODE_MITSUBISHI - DPRINTLN("Attempting Mitsubishi decode"); - if (decodeMitsubishi(results)) return true; + DPRINTLN("Attempting Mitsubishi decode"); + if (decodeMitsubishi(results, offset)) return true; #endif #if DECODE_MITSUBISHI_AC - DPRINTLN("Attempting Mitsubishi AC decode"); - if (decodeMitsubishiAC(results)) return true; + DPRINTLN("Attempting Mitsubishi AC decode"); + if (decodeMitsubishiAC(results, offset)) return true; #endif #if DECODE_MITSUBISHI2 - DPRINTLN("Attempting Mitsubishi2 decode"); - if (decodeMitsubishi2(results)) return true; + DPRINTLN("Attempting Mitsubishi2 decode"); + if (decodeMitsubishi2(results, offset)) return true; #endif #if DECODE_RC5 - DPRINTLN("Attempting RC5 decode"); - if (decodeRC5(results)) return true; + DPRINTLN("Attempting RC5 decode"); + if (decodeRC5(results, offset)) return true; #endif #if DECODE_RC6 - DPRINTLN("Attempting RC6 decode"); - if (decodeRC6(results)) return true; + DPRINTLN("Attempting RC6 decode"); + if (decodeRC6(results, offset)) return true; #endif #if DECODE_RCMM - DPRINTLN("Attempting RC-MM decode"); - if (decodeRCMM(results)) return true; + DPRINTLN("Attempting RC-MM decode"); + if (decodeRCMM(results, offset)) return true; #endif #if DECODE_FUJITSU_AC - // Fujitsu A/C needs to precede Panasonic and Denon as it has a short - // message which looks exactly the same as a Panasonic/Denon message. - DPRINTLN("Attempting Fujitsu A/C decode"); - if (decodeFujitsuAC(results)) return true; + // Fujitsu A/C needs to precede Panasonic and Denon as it has a short + // message which looks exactly the same as a Panasonic/Denon message. + DPRINTLN("Attempting Fujitsu A/C decode"); + if (decodeFujitsuAC(results, offset)) return true; #endif #if DECODE_DENON - // Denon needs to precede Panasonic as it is a special case of Panasonic. - DPRINTLN("Attempting Denon decode"); - if (decodeDenon(results, kDenon48Bits) || decodeDenon(results, kDenonBits) || - decodeDenon(results, kDenonLegacyBits)) - return true; + // Denon needs to precede Panasonic as it is a special case of Panasonic. + DPRINTLN("Attempting Denon decode"); + if (decodeDenon(results, offset, kDenon48Bits) || + decodeDenon(results, offset, kDenonBits) || + decodeDenon(results, offset, kDenonLegacyBits)) + return true; #endif #if DECODE_PANASONIC - DPRINTLN("Attempting Panasonic decode"); - if (decodePanasonic(results)) return true; + DPRINTLN("Attempting Panasonic decode"); + if (decodePanasonic(results, offset)) return true; #endif #if DECODE_LG - DPRINTLN("Attempting LG (28-bit) decode"); - if (decodeLG(results, kLgBits, true)) return true; - DPRINTLN("Attempting LG (32-bit) decode"); - // LG32 should be tried before Samsung - if (decodeLG(results, kLg32Bits, true)) return true; + DPRINTLN("Attempting LG (28-bit) decode"); + if (decodeLG(results, offset, kLgBits, true)) return true; + DPRINTLN("Attempting LG (32-bit) decode"); + // LG32 should be tried before Samsung + if (decodeLG(results, offset, kLg32Bits, true)) return true; #endif #if DECODE_GICABLE - // Note: Needs to happen before JVC decode, because it looks similar except - // with a required NEC-like repeat code. - DPRINTLN("Attempting GICable decode"); - if (decodeGICable(results)) return true; + // Note: Needs to happen before JVC decode, because it looks similar except + // with a required NEC-like repeat code. + DPRINTLN("Attempting GICable decode"); + if (decodeGICable(results, offset)) return true; #endif #if DECODE_JVC - DPRINTLN("Attempting JVC decode"); - if (decodeJVC(results)) return true; + DPRINTLN("Attempting JVC decode"); + if (decodeJVC(results, offset)) return true; #endif #if DECODE_SAMSUNG - DPRINTLN("Attempting SAMSUNG decode"); - if (decodeSAMSUNG(results)) return true; + DPRINTLN("Attempting SAMSUNG decode"); + if (decodeSAMSUNG(results, offset)) return true; #endif #if DECODE_SAMSUNG36 - DPRINTLN("Attempting Samsung36 decode"); - if (decodeSamsung36(results)) return true; + DPRINTLN("Attempting Samsung36 decode"); + if (decodeSamsung36(results, offset)) return true; #endif #if DECODE_WHYNTER - DPRINTLN("Attempting Whynter decode"); - if (decodeWhynter(results)) return true; + DPRINTLN("Attempting Whynter decode"); + if (decodeWhynter(results, offset)) return true; #endif #if DECODE_DISH - DPRINTLN("Attempting DISH decode"); - if (decodeDISH(results)) return true; + DPRINTLN("Attempting DISH decode"); + if (decodeDISH(results, offset)) return true; #endif #if DECODE_SHARP - DPRINTLN("Attempting Sharp decode"); - if (decodeSharp(results)) return true; + DPRINTLN("Attempting Sharp decode"); + if (decodeSharp(results, offset)) return true; #endif #if DECODE_COOLIX - DPRINTLN("Attempting Coolix decode"); - if (decodeCOOLIX(results)) return true; + DPRINTLN("Attempting Coolix decode"); + if (decodeCOOLIX(results, offset)) return true; #endif #if DECODE_NIKAI - DPRINTLN("Attempting Nikai decode"); - if (decodeNikai(results)) return true; + DPRINTLN("Attempting Nikai decode"); + if (decodeNikai(results, offset)) return true; #endif #if DECODE_KELVINATOR - // Kelvinator based-devices use a similar code to Gree ones, to avoid false - // matches this needs to happen before decodeGree(). - DPRINTLN("Attempting Kelvinator decode"); - if (decodeKelvinator(results)) return true; + // Kelvinator based-devices use a similar code to Gree ones, to avoid false + // matches this needs to happen before decodeGree(). + DPRINTLN("Attempting Kelvinator decode"); + if (decodeKelvinator(results, offset)) return true; #endif #if DECODE_DAIKIN - DPRINTLN("Attempting Daikin decode"); - if (decodeDaikin(results)) return true; + DPRINTLN("Attempting Daikin decode"); + if (decodeDaikin(results, offset)) return true; #endif #if DECODE_DAIKIN2 - DPRINTLN("Attempting Daikin2 decode"); - if (decodeDaikin2(results)) return true; + DPRINTLN("Attempting Daikin2 decode"); + if (decodeDaikin2(results, offset)) return true; #endif #if DECODE_DAIKIN216 - DPRINTLN("Attempting Daikin216 decode"); - if (decodeDaikin216(results)) return true; + DPRINTLN("Attempting Daikin216 decode"); + if (decodeDaikin216(results, offset)) return true; #endif #if DECODE_TOSHIBA_AC - DPRINTLN("Attempting Toshiba AC decode"); - if (decodeToshibaAC(results)) return true; + DPRINTLN("Attempting Toshiba AC decode"); + if (decodeToshibaAC(results, offset)) return true; #endif #if DECODE_MIDEA - DPRINTLN("Attempting Midea decode"); - if (decodeMidea(results)) return true; + DPRINTLN("Attempting Midea decode"); + if (decodeMidea(results, offset)) return true; #endif #if DECODE_MAGIQUEST - DPRINTLN("Attempting Magiquest decode"); - if (decodeMagiQuest(results)) return true; + DPRINTLN("Attempting Magiquest decode"); + if (decodeMagiQuest(results, offset)) return true; #endif -/* NOTE: Disabled due to poor quality. + /* NOTE: Disabled due to poor quality. #if DECODE_SANYO - // The Sanyo S866500B decoder is very poor quality & depricated. - // *IF* you are going to enable it, do it near last to avoid false positive - // matches. - DPRINTLN("Attempting Sanyo SA8650B decode"); - if (decodeSanyo(results)) - return true; + // The Sanyo S866500B decoder is very poor quality & depricated. + // *IF* you are going to enable it, do it near last to avoid false positive + // matches. + DPRINTLN("Attempting Sanyo SA8650B decode"); + if (decodeSanyo(results, offset)) + return true; #endif -*/ + */ #if DECODE_NEC - // Some devices send NEC-like codes that don't follow the true NEC spec. - // This should detect those. e.g. Apple TV remote etc. - // This needs to be done after all other codes that use strict and some - // other protocols that are NEC-like as well, as turning off strict may - // cause this to match other valid protocols. - DPRINTLN("Attempting NEC (non-strict) decode"); - if (decodeNEC(results, kNECBits, false)) { - results->decode_type = NEC_LIKE; - return true; - } + // Some devices send NEC-like codes that don't follow the true NEC spec. + // This should detect those. e.g. Apple TV remote etc. + // This needs to be done after all other codes that use strict and some + // other protocols that are NEC-like as well, as turning off strict may + // cause this to match other valid protocols. + DPRINTLN("Attempting NEC (non-strict) decode"); + if (decodeNEC(results, offset, kNECBits, false)) { + results->decode_type = NEC_LIKE; + return true; + } #endif #if DECODE_LASERTAG - DPRINTLN("Attempting Lasertag decode"); - if (decodeLasertag(results)) return true; + DPRINTLN("Attempting Lasertag decode"); + if (decodeLasertag(results, offset)) return true; #endif #if DECODE_GREE - // Gree based-devices use a similar code to Kelvinator ones, to avoid false - // matches this needs to happen after decodeKelvinator(). - DPRINTLN("Attempting Gree decode"); - if (decodeGree(results)) return true; + // Gree based-devices use a similar code to Kelvinator ones, to avoid false + // matches this needs to happen after decodeKelvinator(). + DPRINTLN("Attempting Gree decode"); + if (decodeGree(results, offset)) return true; #endif #if DECODE_HAIER_AC - DPRINTLN("Attempting Haier AC decode"); - if (decodeHaierAC(results)) return true; + DPRINTLN("Attempting Haier AC decode"); + if (decodeHaierAC(results, offset)) return true; #endif #if DECODE_HAIER_AC_YRW02 - DPRINTLN("Attempting Haier AC YR-W02 decode"); - if (decodeHaierACYRW02(results)) return true; + DPRINTLN("Attempting Haier AC YR-W02 decode"); + if (decodeHaierACYRW02(results, offset)) return true; #endif #if DECODE_HITACHI_AC424 - // HitachiAc424 should be checked before HitachiAC & HitachiAC2 - DPRINTLN("Attempting Hitachi AC 424 decode"); - if (decodeHitachiAc424(results, kHitachiAc424Bits)) return true; + // HitachiAc424 should be checked before HitachiAC & HitachiAC2 + DPRINTLN("Attempting Hitachi AC 424 decode"); + if (decodeHitachiAc424(results, offset, kHitachiAc424Bits)) return true; #endif // DECODE_HITACHI_AC2 #if DECODE_HITACHI_AC2 - // HitachiAC2 should be checked before HitachiAC - DPRINTLN("Attempting Hitachi AC2 decode"); - if (decodeHitachiAC(results, kHitachiAc2Bits)) return true; + // HitachiAC2 should be checked before HitachiAC + DPRINTLN("Attempting Hitachi AC2 decode"); + if (decodeHitachiAC(results, offset, kHitachiAc2Bits)) return true; #endif // DECODE_HITACHI_AC2 #if DECODE_HITACHI_AC - DPRINTLN("Attempting Hitachi AC decode"); - if (decodeHitachiAC(results, kHitachiAcBits)) return true; + DPRINTLN("Attempting Hitachi AC decode"); + if (decodeHitachiAC(results, offset, kHitachiAcBits)) return true; #endif #if DECODE_HITACHI_AC1 - DPRINTLN("Attempting Hitachi AC1 decode"); - if (decodeHitachiAC(results, kHitachiAc1Bits)) return true; + DPRINTLN("Attempting Hitachi AC1 decode"); + if (decodeHitachiAC(results, offset, kHitachiAc1Bits)) return true; #endif #if DECODE_WHIRLPOOL_AC - DPRINTLN("Attempting Whirlpool AC decode"); - if (decodeWhirlpoolAC(results)) return true; + DPRINTLN("Attempting Whirlpool AC decode"); + if (decodeWhirlpoolAC(results, offset)) return true; #endif #if DECODE_SAMSUNG_AC - DPRINTLN("Attempting Samsung AC (extended) decode"); - // Check the extended size first, as it should fail fast due to longer length. - if (decodeSamsungAC(results, kSamsungAcExtendedBits, false)) return true; - // Now check for the more common length. - DPRINTLN("Attempting Samsung AC decode"); - if (decodeSamsungAC(results, kSamsungAcBits)) return true; + DPRINTLN("Attempting Samsung AC (extended) decode"); + // Check the extended size first, as it should fail fast due to longer + // length. + if (decodeSamsungAC(results, offset, kSamsungAcExtendedBits, false)) + return true; + // Now check for the more common length. + DPRINTLN("Attempting Samsung AC decode"); + if (decodeSamsungAC(results, offset, kSamsungAcBits)) return true; #endif #if DECODE_ELECTRA_AC - DPRINTLN("Attempting Electra AC decode"); - if (decodeElectraAC(results)) return true; + DPRINTLN("Attempting Electra AC decode"); + if (decodeElectraAC(results, offset)) return true; #endif #if DECODE_PANASONIC_AC - DPRINTLN("Attempting Panasonic AC decode"); - if (decodePanasonicAC(results)) return true; - DPRINTLN("Attempting Panasonic AC short decode"); - if (decodePanasonicAC(results, kPanasonicAcShortBits)) return true; + DPRINTLN("Attempting Panasonic AC decode"); + if (decodePanasonicAC(results, offset)) return true; + DPRINTLN("Attempting Panasonic AC short decode"); + if (decodePanasonicAC(results, offset, kPanasonicAcShortBits)) return true; #endif #if DECODE_LUTRON - DPRINTLN("Attempting Lutron decode"); - if (decodeLutron(results)) return true; + DPRINTLN("Attempting Lutron decode"); + if (decodeLutron(results, offset)) return true; #endif #if DECODE_MWM - DPRINTLN("Attempting MWM decode"); - if (decodeMWM(results)) return true; + DPRINTLN("Attempting MWM decode"); + if (decodeMWM(results, offset)) return true; #endif #if DECODE_VESTEL_AC - DPRINTLN("Attempting Vestel AC decode"); - if (decodeVestelAc(results)) return true; + DPRINTLN("Attempting Vestel AC decode"); + if (decodeVestelAc(results, offset)) return true; #endif #if DECODE_MITSUBISHI112 || DECODE_TCL112AC - // Mitsubish112 and Tcl112 share the same decoder. - DPRINTLN("Attempting Mitsubishi112/TCL112AC decode"); - if (decodeMitsubishi112(results)) return true; + // Mitsubish112 and Tcl112 share the same decoder. + DPRINTLN("Attempting Mitsubishi112/TCL112AC decode"); + if (decodeMitsubishi112(results, offset)) return true; #endif // DECODE_MITSUBISHI112 || DECODE_TCL112AC #if DECODE_TECO - DPRINTLN("Attempting Teco decode"); - if (decodeTeco(results)) return true; + DPRINTLN("Attempting Teco decode"); + if (decodeTeco(results, offset)) return true; #endif #if DECODE_LEGOPF - DPRINTLN("Attempting LEGOPF decode"); - if (decodeLegoPf(results)) return true; + DPRINTLN("Attempting LEGOPF decode"); + if (decodeLegoPf(results, offset)) return true; #endif #if DECODE_MITSUBISHIHEAVY - DPRINTLN("Attempting MITSUBISHIHEAVY (152 bit) decode"); - if (decodeMitsubishiHeavy(results, kMitsubishiHeavy152Bits)) return true; - DPRINTLN("Attempting MITSUBISHIHEAVY (88 bit) decode"); - if (decodeMitsubishiHeavy(results, kMitsubishiHeavy88Bits)) return true; + DPRINTLN("Attempting MITSUBISHIHEAVY (152 bit) decode"); + if (decodeMitsubishiHeavy(results, offset, kMitsubishiHeavy152Bits)) + return true; + DPRINTLN("Attempting MITSUBISHIHEAVY (88 bit) decode"); + if (decodeMitsubishiHeavy(results, offset, kMitsubishiHeavy88Bits)) + return true; #endif #if DECODE_ARGO - DPRINTLN("Attempting Argo decode"); - if (decodeArgo(results)) return true; + DPRINTLN("Attempting Argo decode"); + if (decodeArgo(results, offset)) return true; #endif // DECODE_ARGO #if DECODE_SHARP_AC - DPRINTLN("Attempting SHARP_AC decode"); - if (decodeSharpAc(results)) return true; + DPRINTLN("Attempting SHARP_AC decode"); + if (decodeSharpAc(results, offset)) return true; #endif #if DECODE_GOODWEATHER - DPRINTLN("Attempting GOODWEATHER decode"); - if (decodeGoodweather(results)) return true; + DPRINTLN("Attempting GOODWEATHER decode"); + if (decodeGoodweather(results, offset)) return true; #endif // DECODE_GOODWEATHER #if DECODE_INAX - DPRINTLN("Attempting Inax decode"); - if (decodeInax(results)) return true; + DPRINTLN("Attempting Inax decode"); + if (decodeInax(results, offset)) return true; #endif // DECODE_INAX #if DECODE_TROTEC - DPRINTLN("Attempting Trotec decode"); - if (decodeTrotec(results)) return true; + DPRINTLN("Attempting Trotec decode"); + if (decodeTrotec(results, offset)) return true; #endif // DECODE_TROTEC #if DECODE_DAIKIN160 - DPRINTLN("Attempting Daikin160 decode"); - if (decodeDaikin160(results)) return true; + DPRINTLN("Attempting Daikin160 decode"); + if (decodeDaikin160(results, offset)) return true; #endif // DECODE_DAIKIN160 #if DECODE_NEOCLIMA - DPRINTLN("Attempting Neoclima decode"); - if (decodeNeoclima(results)) return true; + DPRINTLN("Attempting Neoclima decode"); + if (decodeNeoclima(results, offset)) return true; #endif // DECODE_NEOCLIMA #if DECODE_DAIKIN176 - DPRINTLN("Attempting Daikin176 decode"); - if (decodeDaikin176(results)) return true; + DPRINTLN("Attempting Daikin176 decode"); + if (decodeDaikin176(results, offset)) return true; #endif // DECODE_DAIKIN176 #if DECODE_DAIKIN128 - DPRINTLN("Attempting Daikin128 decode"); - if (decodeDaikin128(results)) return true; + DPRINTLN("Attempting Daikin128 decode"); + if (decodeDaikin128(results, offset)) return true; #endif // DECODE_DAIKIN128 #if DECODE_AMCOR - DPRINTLN("Attempting Amcor decode"); - if (decodeAmcor(results)) return true; + DPRINTLN("Attempting Amcor decode"); + if (decodeAmcor(results, offset)) return true; #endif // DECODE_AMCOR #if DECODE_DAIKIN152 - DPRINTLN("Attempting Daikin152 decode"); - if (decodeDaikin152(results)) return true; + DPRINTLN("Attempting Daikin152 decode"); + if (decodeDaikin152(results, offset)) return true; #endif // DECODE_DAIKIN152 #if DECODE_MITSUBISHI136 - DPRINTLN("Attempting Mitsubishi136 decode"); - if (decodeMitsubishi136(results)) return true; + DPRINTLN("Attempting Mitsubishi136 decode"); + if (decodeMitsubishi136(results, offset)) return true; #endif // DECODE_MITSUBISHI136 + } // Typically new protocols are added above this line. #if DECODE_HASH // decodeHash returns a hash on any input. diff --git a/lib/IRremoteESP8266-2.7.3/src/IRrecv.h b/lib/IRremoteESP8266-2.7.4/src/IRrecv.h similarity index 63% rename from lib/IRremoteESP8266-2.7.3/src/IRrecv.h rename to lib/IRremoteESP8266-2.7.4/src/IRrecv.h index 2424f0463..60559981c 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRrecv.h +++ b/lib/IRremoteESP8266-2.7.4/src/IRrecv.h @@ -125,7 +125,8 @@ class IRrecv { ~IRrecv(void); // Destructor void setTolerance(const uint8_t percent = kTolerance); uint8_t getTolerance(void); - bool decode(decode_results *results, irparams_t *save = NULL); + bool decode(decode_results *results, irparams_t *save = NULL, + uint8_t max_skip = 0, uint16_t noise_floor = 0); void enableIRIn(const bool pullup = false); void disableIRIn(void); void resume(void); @@ -220,52 +221,64 @@ class IRrecv { const uint8_t tolerance = kUseDefTol, const int16_t excess = kMarkExcess, const bool MSBfirst = true); + void crudeNoiseFilter(decode_results *results, const uint16_t floor = 0); bool decodeHash(decode_results *results); #if (DECODE_NEC || DECODE_SHERWOOD || DECODE_AIWA_RC_T501 || SEND_SANYO) - bool decodeNEC(decode_results *results, uint16_t nbits = kNECBits, - bool strict = true); + bool decodeNEC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kNECBits, const bool strict = true); #endif #if DECODE_ARGO - bool decodeArgo(decode_results *results, const uint16_t nbits = kArgoBits, - const bool strict = true); + bool decodeArgo(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kArgoBits, const bool strict = true); #endif // DECODE_ARGO #if DECODE_SONY - bool decodeSony(decode_results *results, uint16_t nbits = kSonyMinBits, - bool strict = false); + bool decodeSony(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kSonyMinBits, + const bool strict = false); #endif #if DECODE_SANYO // DISABLED due to poor quality. - // bool decodeSanyo(decode_results *results, + // bool decodeSanyo(decode_results *results, uint16_t offset = kStartOffset, // uint16_t nbits = kSanyoSA8650BBits, // bool strict = false); bool decodeSanyoLC7461(decode_results *results, - uint16_t nbits = kSanyoLC7461Bits, bool strict = true); + uint16_t offset = kStartOffset, + const uint16_t nbits = kSanyoLC7461Bits, + bool strict = true); #endif #if DECODE_MITSUBISHI - bool decodeMitsubishi(decode_results *results, - uint16_t nbits = kMitsubishiBits, bool strict = true); + bool decodeMitsubishi(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kMitsubishiBits, + const bool strict = true); #endif #if DECODE_MITSUBISHI2 bool decodeMitsubishi2(decode_results *results, - uint16_t nbits = kMitsubishiBits, bool strict = true); + uint16_t offset = kStartOffset, + const uint16_t nbits = kMitsubishiBits, + const bool strict = true); #endif #if DECODE_MITSUBISHI_AC bool decodeMitsubishiAC(decode_results *results, - uint16_t nbits = kMitsubishiACBits, - bool strict = false); + uint16_t offset = kStartOffset, + const uint16_t nbits = kMitsubishiACBits, + const bool strict = false); #endif #if DECODE_MITSUBISHI136 bool decodeMitsubishi136(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kMitsubishi136Bits, const bool strict = true); #endif #if DECODE_MITSUBISHI112 bool decodeMitsubishi112(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kMitsubishi112Bits, const bool strict = true); #endif #if DECODE_MITSUBISHIHEAVY - bool decodeMitsubishiHeavy(decode_results *results, const uint16_t nbits, + bool decodeMitsubishiHeavy(decode_results *results, + uint16_t offset = kStartOffset, + const uint16_t nbits = kMitsubishiHeavy152Bits, const bool strict = true); #endif #if (DECODE_RC5 || DECODE_R6 || DECODE_LASERTAG || DECODE_MWM) @@ -275,236 +288,276 @@ class IRrecv { uint8_t maxwidth = 3); #endif #if DECODE_RC5 - bool decodeRC5(decode_results *results, uint16_t nbits = kRC5XBits, - bool strict = true); + bool decodeRC5(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kRC5XBits, + const bool strict = true); #endif #if DECODE_RC6 - bool decodeRC6(decode_results *results, uint16_t nbits = kRC6Mode0Bits, - bool strict = false); + bool decodeRC6(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kRC6Mode0Bits, + const bool strict = false); #endif #if DECODE_RCMM - bool decodeRCMM(decode_results *results, uint16_t nbits = kRCMMBits, - bool strict = false); + bool decodeRCMM(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kRCMMBits, + const bool strict = false); #endif #if (DECODE_PANASONIC || DECODE_DENON) - bool decodePanasonic(decode_results *results, + bool decodePanasonic(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kPanasonicBits, const bool strict = false, const uint32_t manufacturer = kPanasonicManufacturer); #endif #if DECODE_LG - bool decodeLG(decode_results *results, uint16_t nbits = kLgBits, - bool strict = false); + bool decodeLG(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kLgBits, + const bool strict = false); #endif #if DECODE_INAX - bool decodeInax(decode_results *results, const uint16_t nbits = kInaxBits, + bool decodeInax(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kInaxBits, const bool strict = true); #endif // DECODE_INAX #if DECODE_JVC - bool decodeJVC(decode_results *results, uint16_t nbits = kJvcBits, - bool strict = true); + bool decodeJVC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kJvcBits, + const bool strict = true); #endif #if DECODE_SAMSUNG - bool decodeSAMSUNG(decode_results *results, + bool decodeSAMSUNG(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kSamsungBits, const bool strict = true); #endif #if DECODE_SAMSUNG - bool decodeSamsung36(decode_results *results, + bool decodeSamsung36(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kSamsung36Bits, const bool strict = true); #endif #if DECODE_SAMSUNG_AC - bool decodeSamsungAC(decode_results *results, + bool decodeSamsungAC(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kSamsungAcBits, const bool strict = true); #endif #if DECODE_WHYNTER - bool decodeWhynter(decode_results *results, uint16_t nbits = kWhynterBits, - bool strict = true); + bool decodeWhynter(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kWhynterBits, + const bool strict = true); #endif #if DECODE_COOLIX - bool decodeCOOLIX(decode_results *results, uint16_t nbits = kCoolixBits, - bool strict = true); + bool decodeCOOLIX(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kCoolixBits, + const bool strict = true); #endif #if DECODE_DENON - bool decodeDenon(decode_results *results, uint16_t nbits = kDenonBits, - bool strict = true); + bool decodeDenon(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kDenonBits, + const bool strict = true); #endif #if DECODE_DISH - bool decodeDISH(decode_results *results, uint16_t nbits = kDishBits, - bool strict = true); + bool decodeDISH(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kDishBits, + const bool strict = true); #endif #if (DECODE_SHARP || DECODE_DENON) - bool decodeSharp(decode_results *results, const uint16_t nbits = kSharpBits, + bool decodeSharp(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kSharpBits, const bool strict = true, const bool expansion = true); #endif #if DECODE_SHARP_AC - bool decodeSharpAc(decode_results *results, + bool decodeSharpAc(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kSharpAcBits, const bool strict = true); #endif #if DECODE_AIWA_RC_T501 - bool decodeAiwaRCT501(decode_results *results, - uint16_t nbits = kAiwaRcT501Bits, bool strict = true); + bool decodeAiwaRCT501(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kAiwaRcT501Bits, + const bool strict = true); #endif #if DECODE_NIKAI - bool decodeNikai(decode_results *results, uint16_t nbits = kNikaiBits, - bool strict = true); + bool decodeNikai(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kNikaiBits, + const bool strict = true); #endif #if DECODE_MAGIQUEST - bool decodeMagiQuest(decode_results *results, uint16_t nbits = kMagiquestBits, - bool strict = true); + bool decodeMagiQuest(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kMagiquestBits, + const bool strict = true); #endif #if DECODE_KELVINATOR - bool decodeKelvinator(decode_results *results, - uint16_t nbits = kKelvinatorBits, bool strict = true); + bool decodeKelvinator(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kKelvinatorBits, + const bool strict = true); #endif #if DECODE_DAIKIN - bool decodeDaikin(decode_results *results, const uint16_t nbits = kDaikinBits, + bool decodeDaikin(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kDaikinBits, const bool strict = true); #endif #if DECODE_DAIKIN128 - bool decodeDaikin128(decode_results *results, + bool decodeDaikin128(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kDaikin128Bits, const bool strict = true); #endif // DECODE_DAIKIN128 #if DECODE_DAIKIN152 - bool decodeDaikin152(decode_results *results, + bool decodeDaikin152(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kDaikin152Bits, const bool strict = true); #endif // DECODE_DAIKIN152 #if DECODE_DAIKIN160 - bool decodeDaikin160(decode_results *results, + bool decodeDaikin160(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kDaikin160Bits, const bool strict = true); #endif // DECODE_DAIKIN160 #if DECODE_DAIKIN176 - bool decodeDaikin176(decode_results *results, + bool decodeDaikin176(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kDaikin176Bits, const bool strict = true); #endif // DECODE_DAIKIN176 #if DECODE_DAIKIN2 - bool decodeDaikin2(decode_results *results, uint16_t nbits = kDaikin2Bits, - bool strict = true); + bool decodeDaikin2(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kDaikin2Bits, + const bool strict = true); #endif #if DECODE_DAIKIN216 - bool decodeDaikin216(decode_results *results, + bool decodeDaikin216(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kDaikin216Bits, const bool strict = true); #endif #if DECODE_TOSHIBA_AC - bool decodeToshibaAC(decode_results *results, + bool decodeToshibaAC(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbytes = kToshibaACBits, const bool strict = true); #endif #if DECODE_TROTEC - bool decodeTrotec(decode_results *results, const uint16_t nbits = kTrotecBits, + bool decodeTrotec(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kTrotecBits, const bool strict = true); #endif // DECODE_TROTEC #if DECODE_MIDEA - bool decodeMidea(decode_results *results, uint16_t nbits = kMideaBits, - bool strict = true); + bool decodeMidea(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kMideaBits, + const bool strict = true); #endif #if DECODE_FUJITSU_AC - bool decodeFujitsuAC(decode_results *results, uint16_t nbits = kFujitsuAcBits, - bool strict = false); + bool decodeFujitsuAC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kFujitsuAcBits, + const bool strict = false); #endif #if DECODE_LASERTAG - bool decodeLasertag(decode_results *results, uint16_t nbits = kLasertagBits, - bool strict = true); + bool decodeLasertag(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kLasertagBits, + const bool strict = true); #endif #if DECODE_CARRIER_AC - bool decodeCarrierAC(decode_results *results, uint16_t nbits = kCarrierAcBits, - bool strict = true); + bool decodeCarrierAC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kCarrierAcBits, + const bool strict = true); #endif #if DECODE_GOODWEATHER bool decodeGoodweather(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kGoodweatherBits, const bool strict = true); #endif // DECODE_GOODWEATHER #if DECODE_GREE - bool decodeGree(decode_results *results, uint16_t nbits = kGreeBits, - bool strict = true); + bool decodeGree(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kGreeBits, + const bool strict = true); #endif #if (DECODE_HAIER_AC | DECODE_HAIER_AC_YRW02) - bool decodeHaierAC(decode_results *results, uint16_t nbits = kHaierACBits, - bool strict = true); + bool decodeHaierAC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kHaierACBits, + const bool strict = true); #endif #if DECODE_HAIER_AC_YRW02 bool decodeHaierACYRW02(decode_results *results, - uint16_t nbits = kHaierACYRW02Bits, - bool strict = true); + uint16_t offset = kStartOffset, + const uint16_t nbits = kHaierACYRW02Bits, + const bool strict = true); #endif #if (DECODE_HITACHI_AC || DECODE_HITACHI_AC2) - bool decodeHitachiAC(decode_results *results, + bool decodeHitachiAC(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kHitachiAcBits, const bool strict = true); #endif #if DECODE_HITACHI_AC1 - bool decodeHitachiAC1(decode_results *results, + bool decodeHitachiAC1(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kHitachiAc1Bits, const bool strict = true); #endif #if DECODE_HITACHI_AC424 bool decodeHitachiAc424(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kHitachiAc424Bits, const bool strict = true); #endif // DECODE_HITACHI_AC424 #if DECODE_GICABLE - bool decodeGICable(decode_results *results, uint16_t nbits = kGicableBits, - bool strict = true); + bool decodeGICable(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kGicableBits, + const bool strict = true); #endif #if DECODE_WHIRLPOOL_AC bool decodeWhirlpoolAC(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kWhirlpoolAcBits, const bool strict = true); #endif #if DECODE_LUTRON - bool decodeLutron(decode_results *results, uint16_t nbits = kLutronBits, - bool strict = true); + bool decodeLutron(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kLutronBits, + const bool strict = true); #endif #if DECODE_ELECTRA_AC - bool decodeElectraAC(decode_results *results, uint16_t nbits = kElectraAcBits, - bool strict = true); + bool decodeElectraAC(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kElectraAcBits, + const bool strict = true); #endif #if DECODE_PANASONIC_AC bool decodePanasonicAC(decode_results *results, + uint16_t offset = kStartOffset, const uint16_t nbits = kPanasonicAcBits, const bool strict = true); #endif #if DECODE_PIONEER - bool decodePioneer(decode_results *results, + bool decodePioneer(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kPioneerBits, const bool strict = true); #endif #if DECODE_MWM - bool decodeMWM(decode_results *results, uint16_t nbits = 24, - bool strict = true); + bool decodeMWM(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = 24, + const bool strict = true); #endif #if DECODE_VESTEL_AC - bool decodeVestelAc(decode_results *results, + bool decodeVestelAc(decode_results *results, uint16_t offset = kStartOffset, const uint16_t nbits = kVestelAcBits, const bool strict = true); #endif #if DECODE_TECO - bool decodeTeco(decode_results *results, const uint16_t nbits = kTecoBits, + bool decodeTeco(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kTecoBits, const bool strict = false); #endif #if DECODE_LEGOPF - bool decodeLegoPf(decode_results *results, const uint16_t nbits = kLegoPfBits, + bool decodeLegoPf(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kLegoPfBits, const bool strict = true); #endif #if DECODE_NEOCLIMA -bool decodeNeoclima(decode_results *results, - const uint16_t nbits = kNeoclimaBits, - const bool strict = true); + bool decodeNeoclima(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kNeoclimaBits, + const bool strict = true); #endif // DECODE_NEOCLIMA #if DECODE_AMCOR -bool decodeAmcor(decode_results *results, - const uint16_t nbits = kAmcorBits, - const bool strict = true); + bool decodeAmcor(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kAmcorBits, + const bool strict = true); #endif // DECODE_AMCOR +#if DECODE_EPSON + bool decodeEpson(decode_results *results, uint16_t offset = kStartOffset, + const uint16_t nbits = kEpsonBits, + const bool strict = true); +#endif // DECODE_EPSON }; #endif // IRRECV_H_ diff --git a/lib/IRremoteESP8266-2.7.3/src/IRremoteESP8266.h b/lib/IRremoteESP8266-2.7.4/src/IRremoteESP8266.h similarity index 96% rename from lib/IRremoteESP8266-2.7.3/src/IRremoteESP8266.h rename to lib/IRremoteESP8266-2.7.4/src/IRremoteESP8266.h index eb8a67f5c..a048e23fc 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRremoteESP8266.h +++ b/lib/IRremoteESP8266-2.7.4/src/IRremoteESP8266.h @@ -52,7 +52,7 @@ #endif // UNIT_TEST // Library Version -#define _IRREMOTEESP8266_VERSION_ "2.7.3" +#define _IRREMOTEESP8266_VERSION_ "2.7.4" // Set the language & locale for the library. See the `locale` dir for options. #ifndef _IR_LOCALE_ @@ -565,6 +565,13 @@ #define SEND_HITACHI_AC424 _IR_ENABLE_DEFAULT_ #endif // SEND_HITACHI_AC424 +#ifndef DECODE_EPSON +#define DECODE_EPSON _IR_ENABLE_DEFAULT_ +#endif // DECODE_EPSON +#ifndef SEND_EPSON +#define SEND_EPSON _IR_ENABLE_DEFAULT_ +#endif // SEND_EPSON + #if (DECODE_ARGO || DECODE_DAIKIN || DECODE_FUJITSU_AC || DECODE_GREE || \ DECODE_KELVINATOR || DECODE_MITSUBISHI_AC || DECODE_TOSHIBA_AC || \ DECODE_TROTEC || DECODE_HAIER_AC || DECODE_HITACHI_AC || \ @@ -589,6 +596,22 @@ #define ALLOW_DELAY_CALLS true #endif // ALLOW_DELAY_CALLS +// Enable a run-time settable high-pass filter on captured data **before** +// trying any protocol decoding. +// i.e. Try to remove/merge any really short pulses detected in the raw data. +// Note: Even when this option is enabled, it is _off_ by default, and requires +// a user who knows what they are doing to enable it. +// The option to disable this feature is here if your project is _really_ +// tight on resources. i.e. Saves a small handful of bytes and cpu time. +// WARNING: If you use this feature at runtime, you can no longer trust the +// **raw** data captured. It will now have been slightly **cooked**! +// DANGER: If you set the `noise_floor` value too high, it **WILL** break +// decoding of some protocols. You have been warned. Here Be Dragons! +// +// See: `irrecv::decode()` in IRrecv.cpp for more info. +#ifndef ENABLE_NOISE_FILTER_OPTION +#define ENABLE_NOISE_FILTER_OPTION true +#endif // ENABLE_NOISE_FILTER_OPTION /* * Always add to the end of the list and should never remove entries * or change order. Projects may save the type number for later usage @@ -671,8 +694,9 @@ enum decode_type_t { MITSUBISHI112, HITACHI_AC424, SONY_38K, + EPSON, // 75 // Add new entries before this one, and update it to point to the last entry. - kLastDecodeType = SONY_38K, + kLastDecodeType = EPSON, }; // Message lengths & required repeat values @@ -720,6 +744,8 @@ const uint16_t kDenon48Bits = 48; const uint16_t kDenonLegacyBits = 14; const uint16_t kDishBits = 16; const uint16_t kDishMinRepeat = 3; +const uint16_t kEpsonBits = 32; +const uint16_t kEpsonMinRepeat = 2; const uint16_t kElectraAcStateLength = 13; const uint16_t kElectraAcBits = kElectraAcStateLength * 8; const uint16_t kElectraAcMinRepeat = kNoRepeat; diff --git a/lib/IRremoteESP8266-2.7.3/src/IRsend.cpp b/lib/IRremoteESP8266-2.7.4/src/IRsend.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/src/IRsend.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRsend.cpp index 4bc16a75c..8bc12949b 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRsend.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/IRsend.cpp @@ -477,7 +477,8 @@ void IRsend::sendGeneric(const uint16_t headermark, const uint32_t headerspace, // // Ref: // examples/IRrecvDumpV2/IRrecvDumpV2.ino -void IRsend::sendRaw(uint16_t buf[], uint16_t len, uint16_t hz) { +void IRsend::sendRaw(const uint16_t buf[], const uint16_t len, + const uint16_t hz) { // Set IR carrier frequency enableIROut(hz); for (uint16_t i = 0; i < len; i++) { @@ -517,6 +518,8 @@ uint16_t IRsend::minRepeats(const decode_type_t protocol) { return kSonyMinRepeat; case SONY_38K: return kSonyMinRepeat + 1; + case EPSON: + return kEpsonMinRepeat; default: return kNoRepeat; } @@ -558,6 +561,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) { case LG2: return 28; case CARRIER_AC: + case EPSON: case NEC: case NEC_LIKE: case SAMSUNG: @@ -687,6 +691,11 @@ bool IRsend::send(const decode_type_t type, const uint64_t data, sendDISH(data, nbits, min_repeat); break; #endif +#if SEND_EPSON + case EPSON: + sendEpson(data, nbits, min_repeat); + break; +#endif #if SEND_GICABLE case GICABLE: sendGICable(data, nbits, min_repeat); diff --git a/lib/IRremoteESP8266-2.7.3/src/IRsend.h b/lib/IRremoteESP8266-2.7.4/src/IRsend.h similarity index 99% rename from lib/IRremoteESP8266-2.7.3/src/IRsend.h rename to lib/IRremoteESP8266-2.7.4/src/IRsend.h index ff801210d..902f22010 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRsend.h +++ b/lib/IRremoteESP8266-2.7.4/src/IRsend.h @@ -158,7 +158,7 @@ class IRsend { VIRTUAL uint16_t mark(uint16_t usec); VIRTUAL void space(uint32_t usec); int8_t calibrate(uint16_t hz = 38000U); - void sendRaw(uint16_t buf[], uint16_t len, uint16_t hz); + void sendRaw(const uint16_t buf[], const uint16_t len, const uint16_t hz); void sendData(uint16_t onemark, uint32_t onespace, uint16_t zeromark, uint32_t zerospace, uint64_t data, uint16_t nbits, bool MSBfirst = true); @@ -535,7 +535,10 @@ class IRsend { const uint16_t nbytes = kAmcorStateLength, const uint16_t repeat = kAmcorDefaultRepeat); #endif // SEND_AMCOR - +#if SEND_EPSON + void sendEpson(uint64_t data, uint16_t nbits = kEpsonBits, + uint16_t repeat = kEpsonMinRepeat); +#endif protected: #ifdef UNIT_TEST diff --git a/lib/IRremoteESP8266-2.7.3/src/IRtext.cpp b/lib/IRremoteESP8266-2.7.4/src/IRtext.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/IRtext.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRtext.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/IRtext.h b/lib/IRremoteESP8266-2.7.4/src/IRtext.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/IRtext.h rename to lib/IRremoteESP8266-2.7.4/src/IRtext.h diff --git a/lib/IRremoteESP8266-2.7.3/src/IRtimer.cpp b/lib/IRremoteESP8266-2.7.4/src/IRtimer.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/IRtimer.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRtimer.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/IRtimer.h b/lib/IRremoteESP8266-2.7.4/src/IRtimer.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/IRtimer.h rename to lib/IRremoteESP8266-2.7.4/src/IRtimer.h diff --git a/lib/IRremoteESP8266-2.7.3/src/IRutils.cpp b/lib/IRremoteESP8266-2.7.4/src/IRutils.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/src/IRutils.cpp rename to lib/IRremoteESP8266-2.7.4/src/IRutils.cpp index bbb9ed491..230b24809 100644 --- a/lib/IRremoteESP8266-2.7.3/src/IRutils.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/IRutils.cpp @@ -125,6 +125,8 @@ decode_type_t strToDecodeType(const char * const str) { return decode_type_t::DISH; else if (!strcasecmp(str, "ELECTRA_AC")) return decode_type_t::ELECTRA_AC; + else if (!strcasecmp(str, "EPSON")) + return decode_type_t::EPSON; else if (!strcasecmp(str, "FUJITSU_AC")) return decode_type_t::FUJITSU_AC; else if (!strcasecmp(str, "GICABLE")) @@ -310,6 +312,9 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) { case ELECTRA_AC: result = F("ELECTRA_AC"); break; + case EPSON: + result = F("EPSON"); + break; case FUJITSU_AC: result = F("FUJITSU_AC"); break; diff --git a/lib/IRremoteESP8266-2.7.3/src/IRutils.h b/lib/IRremoteESP8266-2.7.4/src/IRutils.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/IRutils.h rename to lib/IRremoteESP8266-2.7.4/src/IRutils.h diff --git a/lib/IRremoteESP8266-2.7.3/src/i18n.h b/lib/IRremoteESP8266-2.7.4/src/i18n.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/i18n.h rename to lib/IRremoteESP8266-2.7.4/src/i18n.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Aiwa.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Aiwa.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_Aiwa.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Aiwa.cpp index 70dbc85b2..95dffe1aa 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Aiwa.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Aiwa.cpp @@ -53,6 +53,8 @@ void IRsend::sendAiwaRCT501(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kAiwaRcT501Bits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -69,8 +71,8 @@ void IRsend::sendAiwaRCT501(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // http://www.sbprojects.com/knowledge/ir/nec.php -bool IRrecv::decodeAiwaRCT501(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeAiwaRCT501(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Compliance if (strict && nbits != kAiwaRcT501Bits) return false; // Doesn't match our protocol defn. @@ -82,7 +84,7 @@ bool IRrecv::decodeAiwaRCT501(decode_results *results, uint16_t nbits, return false; // We can't possibly match something that big. // Decode it as a much bigger (non-standard) NEC message, so we have to turn // off strict mode checking for NEC. - if (!decodeNEC(results, expected_nbits, false)) + if (!decodeNEC(results, offset, expected_nbits, false)) return false; // The NEC decode had a problem, so we should too. uint16_t actual_bits = results->bits; new_data = results->value; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Amcor.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Amcor.cpp similarity index 96% rename from lib/IRremoteESP8266-2.7.3/src/ir_Amcor.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Amcor.cpp index b36c6d15a..b29933906 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Amcor.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Amcor.cpp @@ -56,6 +56,8 @@ void IRsend::sendAmcor(const unsigned char data[], const uint16_t nbytes, // Decode the supplied Amcor HVAC message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kAmcorBits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -64,15 +66,13 @@ void IRsend::sendAmcor(const unsigned char data[], const uint16_t nbytes, // // Status: STABLE / Reported as working. // -bool IRrecv::decodeAmcor(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < 2 * nbits + kHeader - 1) +bool IRrecv::decodeAmcor(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= 2 * nbits + kHeader - 1 + offset) return false; // Can't possibly be a valid Amcor message. if (strict && nbits != kAmcorBits) return false; // We expect Amcor to be 64 bits of message. - uint16_t offset = kStartOffset; - uint16_t used; // Header + Data Block (64 bits) + Footer used = matchGeneric(results->rawbuf + offset, results->state, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Amcor.h b/lib/IRremoteESP8266-2.7.4/src/ir_Amcor.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Amcor.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Amcor.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Argo.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Argo.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Argo.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Argo.cpp index f1806ebcd..11e8336e3 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Argo.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Argo.cpp @@ -378,6 +378,8 @@ String IRArgoAC::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kArgoBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -388,12 +390,11 @@ String IRArgoAC::toString(void) { // Note: // This decoder is based soley off sendArgo(). We have no actual captures // to test this against. If you have one of these units, please let us know. -bool IRrecv::decodeArgo(decode_results *results, const uint16_t nbits, +bool IRrecv::decodeArgo(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kArgoBits) return false; - uint16_t offset = kStartOffset; - // Match Header + Data if (!matchGeneric(results->rawbuf + offset, results->state, results->rawlen - offset, nbits, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Argo.h b/lib/IRremoteESP8266-2.7.4/src/ir_Argo.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Argo.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Argo.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Carrier.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Carrier.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/src/ir_Carrier.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Carrier.cpp index e31ddd55f..7b2b00d58 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Carrier.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Carrier.cpp @@ -53,6 +53,8 @@ void IRsend::sendCarrierAC(uint64_t data, uint16_t nbits, uint16_t repeat) { // i.e. normal + inverted + normal // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kCarrierAcBits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -61,16 +63,15 @@ void IRsend::sendCarrierAC(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Status: ALPHA / Untested. // -bool IRrecv::decodeCarrierAC(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < ((2 * nbits + kHeader + kFooter) * 3) - 1) +bool IRrecv::decodeCarrierAC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < ((2 * nbits + kHeader + kFooter) * 3) - 1 + offset) return false; // Can't possibly be a valid Carrier message. if (strict && nbits != kCarrierAcBits) return false; // We expect Carrier to be 32 bits of message. uint64_t data = 0; uint64_t prev_data = 0; - uint16_t offset = kStartOffset; for (uint8_t i = 0; i < 3; i++) { prev_data = data; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Coolix.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Coolix.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Coolix.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Coolix.cpp index 8b184bf9f..a8d98301c 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Coolix.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Coolix.cpp @@ -130,6 +130,7 @@ void IRCoolixAC::send(const uint16_t repeat) { uint32_t IRCoolixAC::getRaw() { return remote_state; } void IRCoolixAC::setRaw(const uint32_t new_code) { + powerFlag = true; // Everything that is not the special power off mesg is On. if (!handleSpecialState(new_code)) { // it isn`t special so might affect Temp|mode|Fan if (new_code == kCoolixCmdFan) { @@ -578,17 +579,19 @@ String IRCoolixAC::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kCoolixBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: BETA / Probably working. -bool IRrecv::decodeCOOLIX(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeCOOLIX(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // The protocol sends the data normal + inverted, alternating on // each byte. Hence twice the number of expected data bits. - if (results->rawlen < 2 * 2 * nbits + kHeader + kFooter - 1) + if (results->rawlen <= 2 * 2 * nbits + kHeader + kFooter - 1 + offset) return false; // Can't possibly be a valid COOLIX message. if (strict && nbits != kCoolixBits) return false; // Not strictly a COOLIX message. @@ -597,7 +600,6 @@ bool IRrecv::decodeCOOLIX(decode_results *results, uint16_t nbits, uint64_t data = 0; uint64_t inverted = 0; - uint16_t offset = kStartOffset; if (nbits > sizeof(data) * 8) return false; // We can't possibly capture a Coolix packet that big. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Coolix.h b/lib/IRremoteESP8266-2.7.4/src/ir_Coolix.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Coolix.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Coolix.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Daikin.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Daikin.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Daikin.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Daikin.cpp index 678e43f88..4941fe977 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Daikin.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Daikin.cpp @@ -513,6 +513,8 @@ String IRDaikinESP::toString(void) { // Decode the supplied Daikin A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikinBits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -522,17 +524,17 @@ String IRDaikinESP::toString(void) { // // Ref: // https://github.com/mharizanov/Daikin-AC-remote-control-over-the-Internet/tree/master/IRremote -bool IRrecv::decodeDaikin(decode_results *results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodeDaikin(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Is there enough data to match successfully? if (results->rawlen < (2 * (nbits + kDaikinHeaderLength) + - kDaikinSections * (kHeader + kFooter) + kFooter - 1)) + kDaikinSections * (kHeader + kFooter) + kFooter - 1) + + offset) return false; // Compliance if (strict && nbits != kDaikinBits) return false; - uint16_t offset = kStartOffset; match_result_t data_result; // Header #1 - Doesn't count as data. @@ -1206,6 +1208,8 @@ String IRDaikin2::toString(void) { // Decode the supplied Daikin2 A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin2Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -1219,15 +1223,14 @@ String IRDaikin2::toString(void) { // // Ref: // https://github.com/mharizanov/Daikin-AC-remote-control-over-the-Internet/tree/master/IRremote -bool IRrecv::decodeDaikin2(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < 2 * (nbits + kHeader + kFooter) + kHeader - 1) +bool IRrecv::decodeDaikin2(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (nbits + kHeader + kFooter) + kHeader - 1 + offset) return false; // Compliance if (strict && nbits != kDaikin2Bits) return false; - uint16_t offset = kStartOffset; const uint8_t ksectionSize[kDaikin2Sections] = {kDaikin2Section1Length, kDaikin2Section2Length}; @@ -1552,6 +1555,8 @@ String IRDaikin216::toString(void) { // Decode the supplied Daikin 216 bit A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin216Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -1565,15 +1570,14 @@ String IRDaikin216::toString(void) { // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/689 // https://github.com/danny-source/Arduino_DY_IRDaikin -bool IRrecv::decodeDaikin216(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1) +bool IRrecv::decodeDaikin216(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1 + offset) return false; // Compliance if (strict && nbits != kDaikin216Bits) return false; - uint16_t offset = kStartOffset; const uint8_t ksectionSize[kDaikin216Sections] = {kDaikin216Section1Length, kDaikin216Section2Length}; // Sections @@ -1905,6 +1909,8 @@ String IRDaikin160::toString(void) { // Decode the supplied Daikin 160 bit A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin160Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -1917,15 +1923,14 @@ String IRDaikin160::toString(void) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/731 -bool IRrecv::decodeDaikin160(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1) +bool IRrecv::decodeDaikin160(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1 + offset) return false; // Compliance if (strict && nbits != kDaikin160Bits) return false; - uint16_t offset = kStartOffset; const uint8_t ksectionSize[kDaikin160Sections] = {kDaikin160Section1Length, kDaikin160Section2Length}; @@ -2268,6 +2273,8 @@ String IRDaikin176::toString(void) { // Decode the supplied Daikin 176 bit A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin176Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -2279,15 +2286,15 @@ String IRDaikin176::toString(void) { // Status: BETA / Probably works. // -bool IRrecv::decodeDaikin176(decode_results *results, const uint16_t nbits, +bool IRrecv::decodeDaikin176(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { - if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1) + if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1 + offset) return false; // Compliance if (strict && nbits != kDaikin176Bits) return false; - uint16_t offset = kStartOffset; const uint8_t ksectionSize[kDaikin176Sections] = {kDaikin176Section1Length, kDaikin176Section2Length}; @@ -2762,6 +2769,8 @@ stdAc::state_t IRDaikin128::toCommon(const stdAc::state_t *prev) { // Decode the supplied Daikin 128 bit A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin128Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -2773,17 +2782,15 @@ stdAc::state_t IRDaikin128::toCommon(const stdAc::state_t *prev) { // Status: STABLE / Known Working. // // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/827 -bool IRrecv::decodeDaikin128(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * (nbits + kHeader) + kFooter - 1) +bool IRrecv::decodeDaikin128(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (nbits + kHeader) + kFooter - 1 + offset) return false; if (nbits / 8 <= kDaikin128SectionLength) return false; // Compliance if (strict && nbits != kDaikin128Bits) return false; - uint16_t offset = kStartOffset; - // Leader for (uint8_t i = 0; i < 2; i++) { if (!matchMark(results->rawbuf[offset++], kDaikin128LeaderMark, @@ -2862,6 +2869,8 @@ void IRsend::sendDaikin152(const unsigned char data[], const uint16_t nbytes, // Decode the supplied Daikin 152 bit A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kDaikin152Bits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -2873,16 +2882,15 @@ void IRsend::sendDaikin152(const unsigned char data[], const uint16_t nbytes, // Status: STABLE / Known working. // // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/873 -bool IRrecv::decodeDaikin152(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * (5 + nbits + kFooter) + kHeader - 1) +bool IRrecv::decodeDaikin152(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (5 + nbits + kFooter) + kHeader - 1 + offset) return false; if (nbits / 8 < kDaikin152StateLength) return false; // Compliance if (strict && nbits != kDaikin152Bits) return false; - uint16_t offset = kStartOffset; uint16_t used; // Leader diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Daikin.h b/lib/IRremoteESP8266-2.7.4/src/ir_Daikin.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Daikin.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Daikin.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Denon.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Denon.cpp similarity index 89% rename from lib/IRremoteESP8266-2.7.3/src/ir_Denon.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Denon.cpp index 8a32ae261..bd4940714 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Denon.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Denon.cpp @@ -64,7 +64,10 @@ void IRsend::sendDenon(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Expected nr. of data bits. (Typically kDenonBits) +// strict: Flag to indicate if we strictly adhere to the specification. // Returns: // boolean: True if it can decode it, false if it can't. // @@ -72,7 +75,8 @@ void IRsend::sendDenon(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Denon.cpp -bool IRrecv::decodeDenon(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeDenon(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Compliance if (strict) { switch (nbits) { @@ -92,15 +96,14 @@ bool IRrecv::decodeDenon(decode_results *results, uint16_t nbits, bool strict) { // Ditto for Panasonic, it's the same except for a different // manufacturer code. - if (!decodeSharp(results, nbits, true, false) && - !decodePanasonic(results, nbits, true, kDenonManufacturer)) { + if (!decodeSharp(results, offset, nbits, true, false) && + !decodePanasonic(results, offset, nbits, true, kDenonManufacturer)) { // We couldn't decode it as expected, so try the old legacy method. // NOTE: I don't think this following protocol actually exists. // Looks like a partial version of the Sharp protocol. if (strict && nbits != kDenonLegacyBits) return false; uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Dish.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Dish.cpp similarity index 93% rename from lib/IRremoteESP8266-2.7.3/src/ir_Dish.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Dish.cpp index b217da763..834ceda04 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Dish.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Dish.cpp @@ -69,6 +69,8 @@ void IRsend::sendDISH(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. Typically kDishBits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -84,13 +86,11 @@ void IRsend::sendDISH(uint64_t data, uint16_t nbits, uint16_t repeat) { // http://www.hifi-remote.com/wiki/index.php?title=Dish // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx // https://github.com/marcosamarinho/IRremoteESP8266/blob/master/ir_Dish.cpp -bool IRrecv::decodeDISH(decode_results *results, uint16_t nbits, bool strict) { - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) - return false; // Not enough entries to be valid. +bool IRrecv::decodeDISH(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kDishBits) return false; // Not strictly compliant. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Electra.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Electra.cpp similarity index 88% rename from lib/IRremoteESP8266-2.7.3/src/ir_Electra.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Electra.cpp index e423bfa0a..16c753f35 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Electra.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Electra.cpp @@ -66,7 +66,7 @@ IRElectraAc::IRElectraAc(const uint16_t pin, const bool inverted, void IRElectraAc::stateReset(void) { for (uint8_t i = 1; i < kElectraAcStateLength - 2; i++) remote_state[i] = 0; remote_state[0] = 0xC3; - remote_state[11] = 0x08; + remote_state[11] = kElectraAcLightToggleOff; // [12] is the checksum. } @@ -233,6 +233,30 @@ bool IRElectraAc::getSwingH(void) { kElectraAcSwingSize); } +void IRElectraAc::setLightToggle(const bool on) { + remote_state[11] = on ? kElectraAcLightToggleOn : kElectraAcLightToggleOff; +} + +bool IRElectraAc::getLightToggle(void) { + return (remote_state[11] & kElectraAcLightToggleMask) == + kElectraAcLightToggleMask; +} + +void IRElectraAc::setClean(const bool on) { + setBit(&remote_state[9], kElectraAcCleanOffset, on); +} + +bool IRElectraAc::getClean(void) { + return GETBIT8(remote_state[9], kElectraAcCleanOffset); +} + +void IRElectraAc::setTurbo(const bool on) { + setBit(&remote_state[5], kElectraAcTurboOffset, on); +} + +bool IRElectraAc::getTurbo(void) { + return GETBIT8(remote_state[5], kElectraAcTurboOffset); +} // Convert the A/C state to it's common equivalent. stdAc::state_t IRElectraAc::toCommon(void) { stdAc::state_t result; @@ -246,13 +270,13 @@ stdAc::state_t IRElectraAc::toCommon(void) { : stdAc::swingv_t::kOff; result.swingh = this->getSwingH() ? stdAc::swingh_t::kAuto : stdAc::swingh_t::kOff; + result.light = this->getLightToggle(); + result.turbo = this->getTurbo(); + result.clean = this->getClean(); // Not supported. result.model = -1; // No models used. result.quiet = false; - result.turbo = false; result.econo = false; - result.clean = false; - result.light = false; result.filter = false; result.beep = false; result.sleep = -1; @@ -263,7 +287,7 @@ stdAc::state_t IRElectraAc::toCommon(void) { // Convert the internal state into a human readable string. String IRElectraAc::toString(void) { String result = ""; - result.reserve(80); // Reserve some heap for the string to reduce fragging. + result.reserve(130); // Reserve some heap for the string to reduce fragging. result += addBoolToString(getPower(), kPowerStr, false); result += addModeToString(getMode(), kElectraAcAuto, kElectraAcCool, kElectraAcHeat, kElectraAcDry, kElectraAcFan); @@ -273,6 +297,9 @@ String IRElectraAc::toString(void) { kElectraAcFanMed); result += addBoolToString(getSwingV(), kSwingVStr); result += addBoolToString(getSwingH(), kSwingHStr); + result += addLabeledString(getLightToggle() ? kToggleStr : "-", kLightStr); + result += addBoolToString(getClean(), kCleanStr); + result += addBoolToString(getTurbo(), kTurboStr); return result; } @@ -281,6 +308,8 @@ String IRElectraAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kElectraAcBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -288,14 +317,14 @@ String IRElectraAc::toString(void) { // // Status: STABLE / Known working. // -bool IRrecv::decodeElectraAC(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeElectraAC(decode_results *results, uint16_t offset, + const uint16_t nbits, + const bool strict) { if (strict) { if (nbits != kElectraAcBits) return false; // Not strictly a ELECTRA_AC message. } - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, results->state, results->rawlen - offset, nbits, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Electra.h b/lib/IRremoteESP8266-2.7.4/src/ir_Electra.h similarity index 81% rename from lib/IRremoteESP8266-2.7.3/src/ir_Electra.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Electra.h index a120bcd28..2d5fe09f5 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Electra.h +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Electra.h @@ -50,6 +50,10 @@ const uint8_t kElectraAcFanAuto = 0b101; const uint8_t kElectraAcFanLow = 0b011; const uint8_t kElectraAcFanMed = 0b010; const uint8_t kElectraAcFanHigh = 0b001; +// state[5] +// TurboMask = 0b01000000; +const uint8_t kElectraAcTurboOffset = 6; + // state[6] // Mode 0b11100000 const uint8_t kElectraAcModeOffset = 5; @@ -59,7 +63,18 @@ const uint8_t kElectraAcDry = 0b010; const uint8_t kElectraAcHeat = 0b100; const uint8_t kElectraAcFan = 0b110; // state[9] -const uint8_t kElectraAcPowerOffset = 5; +// +const uint8_t kElectraAcCleanOffset = 2; // Bit 0b00000100 +const uint8_t kElectraAcPowerOffset = 5; // Bit 0b00100000 +// state[11] +// +const uint8_t kElectraAcLightToggleOn = 0x15; +// Light has known ON values of 0x15 (0b00010101) or 0x19 (0b00011001) +// Thus common bits ON are: 0b00010001 (0x11) +// We will use this for the getLightToggle() test. +const uint8_t kElectraAcLightToggleMask = 0x11; +// and known OFF values of 0x08 (0b00001000) & 0x05 (0x00000101) +const uint8_t kElectraAcLightToggleOff = 0x08; // Classes @@ -88,6 +103,12 @@ class IRElectraAc { bool getSwingV(void); void setSwingH(const bool on); bool getSwingH(void); + void setClean(const bool on); + bool getClean(void); + void setLightToggle(const bool on); + bool getLightToggle(void); + void setTurbo(const bool on); + bool getTurbo(void); uint8_t* getRaw(void); void setRaw(const uint8_t new_code[], const uint16_t length = kElectraAcStateLength); diff --git a/lib/IRremoteESP8266-2.7.4/src/ir_Epson.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Epson.cpp new file mode 100644 index 000000000..40973a947 --- /dev/null +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Epson.cpp @@ -0,0 +1,114 @@ +// Copyright 2020 David Conran + +// Epson is an NEC-like protocol, except it doesn't use the NEC style repeat. + +#define __STDC_LIMIT_MACROS +#include +#include +#include "IRrecv.h" +#include "IRsend.h" +#include "IRutils.h" +#include "ir_NEC.h" + +#if SEND_EPSON +// Send an Epson formatted message. +// +// Args: +// data: The message to be sent. +// nbits: The number of bits of the message to be sent. Typically kEpsonBits. +// repeat: The number of times the command is to be repeated. +// +// Status: Beta / Probably works. +// +// Ref: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/1034 +void IRsend::sendEpson(uint64_t data, uint16_t nbits, uint16_t repeat) { + sendGeneric(kNecHdrMark, kNecHdrSpace, kNecBitMark, kNecOneSpace, kNecBitMark, + kNecZeroSpace, kNecBitMark, kNecMinGap, kNecMinCommandLength, + data, nbits, 38, true, repeat, 33); +} + +#endif // SEND_EPSON + +#if DECODE_EPSON +// Decode the supplied Epson message. +// +// Args: +// results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. +// nbits: The number of data bits to expect. Typically kNECBits. +// strict: Flag indicating if we should perform strict matching. +// Returns: +// boolean: True if it can decode it, false if it can't. +// +// Status: Beta / Probably works. +// +// Notes: +// Experimental data indicates there are at least three +// messages (first + 2 repeats). We only require the first + a single repeat +// to match. This helps us distinguish it from NEC messages which are near +// identical. +// +// Ref: +// https://github.com/crankyoldgit/IRremoteESP8266/issues/1034 +bool IRrecv::decodeEpson(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + const uint8_t kEpsonMinMesgsForDecode = 2; + + if (results->rawlen < kEpsonMinMesgsForDecode * (2 * nbits + kHeader + + kFooter) + offset - 1) + return false; // Can't possibly be a valid Epson message. + if (strict && nbits != kEpsonBits) + return false; // Not strictly an Epson message. + + uint64_t data = 0; + uint64_t first_data = 0; + bool first = true; + + for (uint8_t i = 0; i < kEpsonMinMesgsForDecode; i++) { + // Match Header + Data + Footer + uint16_t delta = matchGeneric(results->rawbuf + offset, &data, + results->rawlen - offset, nbits, + kNecHdrMark, kNecHdrSpace, + kNecBitMark, kNecOneSpace, + kNecBitMark, kNecZeroSpace, + kNecBitMark, kNecMinGap, true); + if (!delta) return false; + offset += delta; + if (first) + first_data = data; + else if (data != first_data) return false; + first = false; // No longer the first message. + } + // Compliance + // Calculate command and optionally enforce integrity checking. + uint8_t command = (data & 0xFF00) >> 8; + // Command is sent twice, once as plain and then inverted. + if ((command ^ 0xFF) != (data & 0xFF)) { + if (strict) return false; // Command integrity failed. + command = 0; // The command value isn't valid, so default to zero. + } + + // Success + results->bits = nbits; + results->value = data; + results->decode_type = EPSON; + // Epson command and address are technically in LSB first order so the + // final versions have to be reversed. + results->command = reverseBits(command, 8); + // Normal Epson (NEC) protocol has an 8 bit address sent, + // followed by it inverted. + uint8_t address = (data & 0xFF000000) >> 24; + uint8_t address_inverted = (data & 0x00FF0000) >> 16; + if (address == (address_inverted ^ 0xFF)) + // Inverted, so it is normal Epson (NEC) protocol. + results->address = reverseBits(address, 8); + else + // Not inverted, so must be Extended Epson (NEC) protocol, + // thus 16 bit address. + results->address = reverseBits((data >> 16) & UINT16_MAX, 16); + results->repeat = !first; + return true; +} +#endif // DECODE_EPSON diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Fujitsu.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Fujitsu.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Fujitsu.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Fujitsu.cpp index 4b0095b1e..583a441ba 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Fujitsu.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Fujitsu.cpp @@ -684,22 +684,25 @@ String IRFujitsuAC::toString(void) { // Places successful decode information in the results pointer. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kFujitsuAcBits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: // boolean: True if it can decode it, false if it can't. // -// Status: ALPHA / Untested. +// Status: STABLE / Working. // // Ref: // -bool IRrecv::decodeFujitsuAC(decode_results* results, uint16_t nbits, - bool strict) { - uint16_t offset = kStartOffset; +bool IRrecv::decodeFujitsuAC(decode_results* results, uint16_t offset, + const uint16_t nbits, + const bool strict) { uint16_t dataBitsSoFar = 0; // Have we got enough data to successfully decode? - if (results->rawlen < (2 * kFujitsuAcMinBits) + kHeader + kFooter - 1) + if (results->rawlen < (2 * kFujitsuAcMinBits) + kHeader + kFooter - 1 + + offset) return false; // Can't possibly be a valid message. // Compliance diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Fujitsu.h b/lib/IRremoteESP8266-2.7.4/src/ir_Fujitsu.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Fujitsu.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Fujitsu.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_GICable.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_GICable.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/src/ir_GICable.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_GICable.cpp index 6b3849b4c..ef68199cb 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_GICable.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_GICable.cpp @@ -58,19 +58,20 @@ void IRsend::sendGICable(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kGicableBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: Alpha / Not tested against a real device. -bool IRrecv::decodeGICable(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeGICable(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kGicableBits) return false; // Not strictly an GICABLE message. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer uint16_t used; used = matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_GlobalCache.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_GlobalCache.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_GlobalCache.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_GlobalCache.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Goodweather.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Goodweather.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Goodweather.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Goodweather.cpp index 4c5aa3513..8b7e0b76e 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Goodweather.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Goodweather.cpp @@ -370,23 +370,24 @@ String IRGoodweatherAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kGoodweatherBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: ALPHA / Untested. -bool IRrecv::decodeGoodweather(decode_results* results, +bool IRrecv::decodeGoodweather(decode_results* results, uint16_t offset, const uint16_t nbits, const bool strict) { - if (results->rawlen < 2 * (2 * nbits) + kHeader + 2 * kFooter - 1) + if (results->rawlen < 2 * (2 * nbits) + kHeader + 2 * kFooter - 1 + offset) return false; // Can't possibly be a valid Goodweather message. if (strict && nbits != kGoodweatherBits) return false; // Not strictly a Goodweather message. uint64_t dataSoFar = 0; uint16_t dataBitsSoFar = 0; - uint16_t offset = kStartOffset; match_result_t data_result; // Header diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Goodweather.h b/lib/IRremoteESP8266-2.7.4/src/ir_Goodweather.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Goodweather.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Goodweather.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Gree.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Gree.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Gree.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Gree.cpp index 2dbebe84b..735e3b88c 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Gree.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Gree.cpp @@ -513,21 +513,22 @@ String IRGreeAC::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kGreeBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // -// Status: ALPHA / Untested. -bool IRrecv::decodeGree(decode_results* results, uint16_t nbits, bool strict) { - if (results->rawlen < - 2 * (nbits + kGreeBlockFooterBits) + (kHeader + kFooter + 1)) +// Status: STABLE / Working. +bool IRrecv::decodeGree(decode_results* results, uint16_t offset, + const uint16_t nbits, bool const strict) { + if (results->rawlen <= + 2 * (nbits + kGreeBlockFooterBits) + (kHeader + kFooter + 1) - 1 + offset) return false; // Can't possibly be a valid Gree message. if (strict && nbits != kGreeBits) return false; // Not strictly a Gree message. - uint16_t offset = kStartOffset; - // There are two blocks back-to-back in a full Gree IR message // sequence. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Gree.h b/lib/IRremoteESP8266-2.7.4/src/ir_Gree.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Gree.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Gree.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Haier.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Haier.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Haier.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Haier.cpp index ac8be71ac..cac4320cf 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Haier.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Haier.cpp @@ -853,6 +853,8 @@ String IRHaierACYRW02::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kHaierACBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -860,18 +862,16 @@ String IRHaierACYRW02::toString(void) { // // Status: STABLE / Known to be working. // -bool IRrecv::decodeHaierAC(decode_results* results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeHaierAC(decode_results* results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict) { if (nbits != kHaierACBits) return false; // Not strictly a HAIER_AC message. } - if (results->rawlen < (2 * nbits + kHeader) + kFooter - 1) + if (results->rawlen <= (2 * nbits + kHeader) + kFooter - 1 + offset) return false; // Can't possibly be a valid HAIER_AC message. - uint16_t offset = kStartOffset; - // Pre-Header if (!matchMark(results->rawbuf[offset++], kHaierAcHdr)) return false; if (!matchSpace(results->rawbuf[offset++], kHaierAcHdr)) return false; @@ -903,6 +903,8 @@ bool IRrecv::decodeHaierAC(decode_results* results, uint16_t nbits, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kHaierACYRW02Bits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -910,15 +912,15 @@ bool IRrecv::decodeHaierAC(decode_results* results, uint16_t nbits, // // Status: BETA / Appears to be working. // -bool IRrecv::decodeHaierACYRW02(decode_results* results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeHaierACYRW02(decode_results* results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict) { if (nbits != kHaierACYRW02Bits) return false; // Not strictly a HAIER_AC_YRW02 message. } // The protocol is almost exactly the same as HAIER_AC - if (!decodeHaierAC(results, nbits, false)) return false; + if (!decodeHaierAC(results, offset, nbits, false)) return false; // Compliance if (strict) { diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Haier.h b/lib/IRremoteESP8266-2.7.4/src/ir_Haier.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Haier.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Haier.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Hitachi.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Hitachi.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Hitachi.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Hitachi.cpp index fcbcb5fec..02489d010 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Hitachi.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Hitachi.cpp @@ -359,13 +359,15 @@ String IRHitachiAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // Typically kHitachiAcBits, kHitachiAc1Bits, kHitachiAc2Bits // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // -// Status: ALPHA / Untested. +// Status: BETA / Probably works. // // Supported devices: // Hitachi A/C Series VI (Circa 2007) / Remote: LT0541-HTA @@ -373,11 +375,10 @@ String IRHitachiAc::toString(void) { // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/417 // https://github.com/crankyoldgit/IRremoteESP8266/issues/453 -bool IRrecv::decodeHitachiAC(decode_results *results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodeHitachiAC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { const uint8_t k_tolerance = _tolerance + 5; - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) - return false; // Can't possibly be a valid HitachiAC message. + if (strict) { switch (nbits) { case kHitachiAcBits: @@ -388,7 +389,6 @@ bool IRrecv::decodeHitachiAC(decode_results *results, const uint16_t nbits, return false; // Not strictly a Hitachi message. } } - uint16_t offset = kStartOffset; uint16_t hmark; uint32_t hspace; if (nbits == kHitachiAc1Bits) { @@ -475,6 +475,8 @@ void IRsend::sendHitachiAc424(const uint8_t data[], const uint16_t nbytes, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kHitachiAc424Bits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -489,14 +491,14 @@ void IRsend::sendHitachiAc424(const uint8_t data[], const uint16_t nbytes, // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/973 -bool IRrecv::decodeHitachiAc424(decode_results *results, const uint16_t nbits, +bool IRrecv::decodeHitachiAc424(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { - if (results->rawlen < 2 * nbits + kHeader + kHeader + kFooter - 1) + if (results->rawlen < 2 * nbits + kHeader + kHeader + kFooter - 1 + offset) return false; // Too short a message to match. if (strict && nbits != kHitachiAc424Bits) return false; - uint16_t offset = kStartOffset; uint16_t used; // Leader diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Hitachi.h b/lib/IRremoteESP8266-2.7.4/src/ir_Hitachi.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Hitachi.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Hitachi.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Inax.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Inax.cpp similarity index 90% rename from lib/IRremoteESP8266-2.7.3/src/ir_Inax.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Inax.cpp index 073580fae..9822e750b 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Inax.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Inax.cpp @@ -49,6 +49,8 @@ void IRsend::sendInax(const uint64_t data, const uint16_t nbits, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kInaxBits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -57,13 +59,12 @@ void IRsend::sendInax(const uint64_t data, const uint16_t nbits, // // Status: Stable / Known working. // -bool IRrecv::decodeInax(decode_results *results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodeInax(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kInaxBits) return false; // We expect Inax to be a certain sized message. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_JVC.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_JVC.cpp similarity index 93% rename from lib/IRremoteESP8266-2.7.3/src/ir_JVC.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_JVC.cpp index 7038e9d3e..128efdf08 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_JVC.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_JVC.cpp @@ -92,6 +92,8 @@ uint16_t IRsend::encodeJVC(uint8_t address, uint8_t command) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits of data to expect. Typically kJvcBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -103,14 +105,14 @@ uint16_t IRsend::encodeJVC(uint8_t address, uint8_t command) { // JVC repeat codes don't have a header. // Ref: // http://www.sbprojects.com/knowledge/ir/jvc.php -bool IRrecv::decodeJVC(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeJVC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kJvcBits) return false; // Must be called with the correct nr. of bits. - if (results->rawlen < 2 * nbits + kFooter - 1) + if (results->rawlen <= 2 * nbits + kFooter - 1 + offset) return false; // Can't possibly be a valid JVC message. uint64_t data = 0; - uint16_t offset = kStartOffset; bool isRepeat = true; // Header diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Kelvinator.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Kelvinator.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Kelvinator.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Kelvinator.cpp index 320458b30..4a4fac276 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Kelvinator.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Kelvinator.cpp @@ -414,22 +414,23 @@ String IRKelvinatorAC::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kKelvinatorBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: STABLE / Known working. -bool IRrecv::decodeKelvinator(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < - 2 * (nbits + kKelvinatorCmdFooterBits) + (kHeader + kFooter + 1) * 2 - 1) +bool IRrecv::decodeKelvinator(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= + 2 * (nbits + kKelvinatorCmdFooterBits) + (kHeader + kFooter + 1) * 2 - 1 + + offset) return false; // Can't possibly be a valid Kelvinator message. if (strict && nbits != kKelvinatorBits) return false; // Not strictly a Kelvinator message. - uint16_t offset = kStartOffset; - // There are two messages back-to-back in a full Kelvinator IR message // sequence. int8_t pos = 0; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Kelvinator.h b/lib/IRremoteESP8266-2.7.4/src/ir_Kelvinator.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Kelvinator.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Kelvinator.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_LG.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_LG.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_LG.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_LG.cpp index ce0a36d3d..b30dba082 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_LG.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_LG.cpp @@ -176,13 +176,15 @@ uint32_t IRsend::encodeLG(uint16_t address, uint16_t command) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kLgBits or kLg32Bits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: // boolean: True if it can decode it, false if it can't. // -// Status: BETA / Should work. +// Status: STABLE / Working. // // Note: // LG 32bit protocol appears near identical to the Samsung protocol. @@ -193,19 +195,18 @@ uint32_t IRsend::encodeLG(uint16_t address, uint16_t command) { // Ref: // https://funembedded.wordpress.com/2014/11/08/ir-remote-control-for-lg-conditioner-using-stm32f302-mcu-on-mbed-platform/ -bool IRrecv::decodeLG(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeLG(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (nbits >= kLg32Bits) { - if (results->rawlen < 2 * nbits + 2 * (kHeader + kFooter) - 1) + if (results->rawlen <= 2 * nbits + 2 * (kHeader + kFooter) - 1 + offset) return false; // Can't possibly be a valid LG32 message. } else { - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) + if (results->rawlen <= 2 * nbits + kHeader - 1 + offset) return false; // Can't possibly be a valid LG message. } if (strict && nbits != kLgBits && nbits != kLg32Bits) return false; // Doesn't comply with expected LG protocol. - uint64_t data = 0; - uint16_t offset = kStartOffset; bool isLg2 = false; // Header @@ -280,7 +281,6 @@ bool IRrecv::decodeLG(decode_results *results, uint16_t nbits, bool strict) { if (strict && (data & 0xF) != calcLGChecksum(command)) return false; // The last 4 bits sent are the expected checksum. - // Success if (isLg2) results->decode_type = LG2; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_LG.h b/lib/IRremoteESP8266-2.7.4/src/ir_LG.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_LG.h rename to lib/IRremoteESP8266-2.7.4/src/ir_LG.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Lasertag.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Lasertag.cpp similarity index 90% rename from lib/IRremoteESP8266-2.7.3/src/ir_Lasertag.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Lasertag.cpp index f52b7477a..14a059084 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Lasertag.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Lasertag.cpp @@ -56,6 +56,8 @@ void IRsend::sendLasertag(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -67,14 +69,13 @@ void IRsend::sendLasertag(uint64_t data, uint16_t nbits, uint16_t repeat) { // http://www.sbprojects.com/knowledge/ir/rc5.php // https://en.wikipedia.org/wiki/RC-5 // https://en.wikipedia.org/wiki/Manchester_code -bool IRrecv::decodeLasertag(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < kLasertagMinSamples) return false; +bool IRrecv::decodeLasertag(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= kLasertagMinSamples + offset) return false; // Compliance if (strict && nbits != kLasertagBits) return false; - uint16_t offset = kStartOffset; uint16_t used = 0; uint64_t data = 0; uint16_t actual_bits = 0; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Lego.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Lego.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_Lego.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Lego.cpp index 932a568d0..502352218 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Lego.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Lego.cpp @@ -67,20 +67,20 @@ void IRsend::sendLegoPf(const uint64_t data, const uint16_t nbits, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kLegoPfBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // -// Status: Alpha / Untested. -bool IRrecv::decodeLegoPf(decode_results* results, +// Status: BETA / Appears to work. +bool IRrecv::decodeLegoPf(decode_results* results, uint16_t offset, const uint16_t nbits, const bool strict) { // Check if can possibly be a valid LEGO message. - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) return false; if (strict && nbits != kLegoPfBits) return false; // Not what is expected uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Lutron.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Lutron.cpp similarity index 93% rename from lib/IRremoteESP8266-2.7.3/src/ir_Lutron.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Lutron.cpp index 7c9835047..094932e5d 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Lutron.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Lutron.cpp @@ -58,6 +58,8 @@ void IRsend::sendLutron(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kLutronBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -69,8 +71,8 @@ void IRsend::sendLutron(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/515 -bool IRrecv::decodeLutron(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeLutron(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Technically the smallest number of entries for the smallest message is '1'. // i.e. All the bits set to 1, would produce a single huge mark signal. // So no minimum length check is required. @@ -81,8 +83,7 @@ bool IRrecv::decodeLutron(decode_results *results, uint16_t nbits, int16_t bitsSoFar = -1; if (nbits > sizeof(data) * 8) return false; // To large to store the data. - for (uint16_t offset = kStartOffset; - bitsSoFar < nbits && offset < results->rawlen; offset++) { + for (; bitsSoFar < nbits && offset < results->rawlen; offset++) { uint16_t entry = results->rawbuf[offset]; // It has to be large enough to qualify as a bit. if (!matchAtLeast(entry, kLutronTick, 0, kLutronDelta)) { diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_MWM.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_MWM.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_MWM.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_MWM.cpp index b747b224b..eefc4a57e 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_MWM.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_MWM.cpp @@ -74,6 +74,8 @@ void IRsend::sendMWM(const uint8_t data[], const uint16_t nbytes, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -81,16 +83,16 @@ void IRsend::sendMWM(const uint8_t data[], const uint16_t nbytes, // // Status: Implemented. // -bool IRrecv::decodeMWM(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeMWM(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { DPRINTLN("DEBUG: decodeMWM"); // Compliance - if (results->rawlen < kMWMMinSamples) { + if (results->rawlen <= kMWMMinSamples + offset) { DPRINTLN("DEBUG: decodeMWM: too few samples"); return false; } - uint16_t offset = kStartOffset; uint16_t used = 0; uint64_t data = 0; uint16_t frame_bits = 0; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Magiquest.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Magiquest.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/src/ir_Magiquest.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Magiquest.cpp index 863aa0ec3..2c15612f4 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Magiquest.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Magiquest.cpp @@ -67,6 +67,8 @@ uint64_t IRsend::encodeMagiQuest(uint32_t wand_id, uint16_t magnitude) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion, inc. the 8 bit header. // Typically kMagiquestBits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -77,17 +79,16 @@ uint64_t IRsend::encodeMagiQuest(uint32_t wand_id, uint16_t magnitude) { // // Ref: // https://github.com/kitlaan/Arduino-IRremote/blob/master/ir_Magiquest.cpp -bool IRrecv::decodeMagiQuest(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeMagiQuest(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { uint16_t bits = 0; uint64_t data = 0; - uint16_t offset = kStartOffset; - if (results->rawlen < (2 * kMagiquestBits)) { + if (results->rawlen < (2 * kMagiquestBits) + offset - 1) { DPRINT("Not enough bits to be Magiquest - Rawlen: "); DPRINT(results->rawlen); DPRINT(" Expected: "); - DPRINTLN((2 * kMagiquestBits)); + DPRINTLN(2 * kMagiquestBits + offset - 1); return false; } diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Magiquest.h b/lib/IRremoteESP8266-2.7.4/src/ir_Magiquest.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Magiquest.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Magiquest.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Midea.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Midea.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Midea.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Midea.cpp index ce373ebfe..bbf9bedfa 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Midea.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Midea.cpp @@ -64,7 +64,7 @@ void IRsend::sendMidea(uint64_t data, uint16_t nbits, uint16_t repeat) { enableIROut(38); for (uint16_t r = 0; r <= repeat; r++) { - // The protcol sends the message, then follows up with an entirely + // The protocol sends the message, then follows up with an entirely // inverted payload. for (size_t inner_loop = 0; inner_loop < 2; inner_loop++) { // Header @@ -397,6 +397,8 @@ String IRMideaAC::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kMideaBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -404,7 +406,8 @@ String IRMideaAC::toString(void) { // // Status: Alpha / Needs testing against a real device. // -bool IRrecv::decodeMidea(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeMidea(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { uint8_t min_nr_of_messages = 1; if (strict) { if (nbits != kMideaBits) return false; // Not strictly a MIDEA message. @@ -414,12 +417,11 @@ bool IRrecv::decodeMidea(decode_results *results, uint16_t nbits, bool strict) { // The protocol sends the data normal + inverted, alternating on // each byte. Hence twice the number of expected data bits. if (results->rawlen < - min_nr_of_messages * (2 * nbits + kHeader + kFooter) - 1) + min_nr_of_messages * (2 * nbits + kHeader + kFooter) - 1 + offset) return false; // Can't possibly be a valid MIDEA message. uint64_t data = 0; uint64_t inverted = 0; - uint16_t offset = kStartOffset; if (nbits > sizeof(data) * 8) return false; // We can't possibly capture a Midea packet that big. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Midea.h b/lib/IRremoteESP8266-2.7.4/src/ir_Midea.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Midea.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Midea.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Mitsubishi.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Mitsubishi.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Mitsubishi.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Mitsubishi.cpp index cf5c573fc..68098f40a 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Mitsubishi.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Mitsubishi.cpp @@ -127,6 +127,8 @@ void IRsend::sendMitsubishi(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -139,12 +141,11 @@ void IRsend::sendMitsubishi(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // GlobalCache's Control Tower's Mitsubishi TV data. -bool IRrecv::decodeMitsubishi(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeMitsubishi(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kMitsubishiBits) return false; // Request is out of spec. - uint16_t offset = kStartOffset; uint64_t data = 0; // Match Data + Footer @@ -206,6 +207,8 @@ void IRsend::sendMitsubishi2(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -219,14 +222,13 @@ void IRsend::sendMitsubishi2(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/441 -bool IRrecv::decodeMitsubishi2(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < 2 * nbits + kHeader + (kFooter * 2) - 1) +bool IRrecv::decodeMitsubishi2(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= 2 * nbits + kHeader + (kFooter * 2) - 1 + offset) return false; // Shorter than shortest possibly expected. if (strict && nbits != kMitsubishiBits) return false; // Request is out of spec. - uint16_t offset = kStartOffset; results->value = 0; // Header @@ -287,6 +289,8 @@ void IRsend::sendMitsubishiAC(const unsigned char data[], const uint16_t nbytes, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -296,9 +300,10 @@ void IRsend::sendMitsubishiAC(const unsigned char data[], const uint16_t nbytes, // // Ref: // https://www.analysir.com/blog/2015/01/06/reverse-engineering-mitsubishi-ac-infrared-protocol/ -bool IRrecv::decodeMitsubishiAC(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < ((kMitsubishiACBits * 2) + 2)) { +bool IRrecv::decodeMitsubishiAC(decode_results *results, uint16_t offset, + const uint16_t nbits, + const bool strict) { + if (results->rawlen <= ((kMitsubishiACBits * 2) + 2) + offset) { DPRINTLN("Shorter than shortest possibly expected."); return false; // Shorter than shortest possibly expected. } @@ -306,10 +311,7 @@ bool IRrecv::decodeMitsubishiAC(decode_results *results, uint16_t nbits, DPRINTLN("Request is out of spec."); return false; // Request is out of spec. } - uint16_t offset = kStartOffset; - for (uint8_t i = 0; i < kMitsubishiACStateLength; i++) { - results->state[i] = 0; - } + for (uint8_t i = 0; i < kMitsubishiACStateLength; i++) results->state[i] = 0; bool failure = false; uint8_t rep = 0; do { @@ -825,6 +827,8 @@ void IRsend::sendMitsubishi136(const unsigned char data[], // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -834,16 +838,15 @@ void IRsend::sendMitsubishi136(const unsigned char data[], // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/888 -bool IRrecv::decodeMitsubishi136(decode_results *results, const uint16_t nbits, +bool IRrecv::decodeMitsubishi136(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { - // Too short to match? - if (results->rawlen < (2 * nbits) + kHeader + kFooter - 1) return false; if (nbits % 8 != 0) return false; // Not a multiple of an 8 bit byte. if (strict) { // Do checks to see if it matches the spec. if (nbits != kMitsubishi136Bits) return false; } - uint16_t used = matchGeneric(results->rawbuf + kStartOffset, results->state, - results->rawlen - kStartOffset, nbits, + uint16_t used = matchGeneric(results->rawbuf + offset, results->state, + results->rawlen - offset, nbits, kMitsubishi136HdrMark, kMitsubishi136HdrSpace, kMitsubishi136BitMark, kMitsubishi136OneSpace, kMitsubishi136BitMark, kMitsubishi136ZeroSpace, @@ -1174,6 +1177,8 @@ void IRsend::sendMitsubishi112(const unsigned char data[], // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -1191,14 +1196,14 @@ void IRsend::sendMitsubishi112(const unsigned char data[], // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/619 // https://github.com/crankyoldgit/IRremoteESP8266/issues/947 -bool IRrecv::decodeMitsubishi112(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < ((2 * nbits) + kHeader + kFooter - 1)) return false; +bool IRrecv::decodeMitsubishi112(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < (2 * nbits) + kHeader + kFooter - 1 + offset) + return false; if (nbits % 8 != 0) return false; // Not a multiple of an 8 bit byte. if (strict) { // Do checks to see if it matches the spec. if (nbits != kMitsubishi112Bits && nbits != kTcl112AcBits) return false; } - uint16_t offset = kStartOffset; decode_type_t typeguess = decode_type_t::UNKNOWN; uint16_t hdrspace; uint16_t bitmark; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Mitsubishi.h b/lib/IRremoteESP8266-2.7.4/src/ir_Mitsubishi.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Mitsubishi.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Mitsubishi.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_MitsubishiHeavy.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_MitsubishiHeavy.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/src/ir_MitsubishiHeavy.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_MitsubishiHeavy.cpp index cc6d066f3..39bd3d8d6 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_MitsubishiHeavy.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_MitsubishiHeavy.cpp @@ -959,17 +959,17 @@ String IRMitsubishiHeavy88Ac::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. -// Typically kMitsubishiHeavy88Bits or kMitsubishiHeavy152Bits. +// Typically kMitsubishiHeavy88Bits or kMitsubishiHeavy152Bits (def). // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: BETA / Appears to be working. Needs testing against a real device. -bool IRrecv::decodeMitsubishiHeavy(decode_results* results, +bool IRrecv::decodeMitsubishiHeavy(decode_results* results, uint16_t offset, const uint16_t nbits, const bool strict) { - // Check if can possibly be a valid MitsubishiHeavy message. - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) return false; if (strict) { switch (nbits) { case kMitsubishiHeavy88Bits: @@ -980,7 +980,6 @@ bool IRrecv::decodeMitsubishiHeavy(decode_results* results, } } - uint16_t offset = kStartOffset; uint16_t used; used = matchGeneric(results->rawbuf + offset, results->state, results->rawlen - offset, nbits, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_MitsubishiHeavy.h b/lib/IRremoteESP8266-2.7.4/src/ir_MitsubishiHeavy.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_MitsubishiHeavy.h rename to lib/IRremoteESP8266-2.7.4/src/ir_MitsubishiHeavy.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_NEC.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_NEC.cpp similarity index 89% rename from lib/IRremoteESP8266-2.7.3/src/ir_NEC.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_NEC.cpp index 03f68c1d9..2f870f58c 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_NEC.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_NEC.cpp @@ -68,6 +68,8 @@ uint32_t IRsend::encodeNEC(uint16_t address, uint16_t command) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kNECBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -85,22 +87,22 @@ uint32_t IRsend::encodeNEC(uint16_t address, uint16_t command) { // // Ref: // http://www.sbprojects.com/knowledge/ir/nec.php -bool IRrecv::decodeNEC(decode_results *results, uint16_t nbits, bool strict) { - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1 && - results->rawlen != kNecRptLength) +bool IRrecv::decodeNEC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < kNecRptLength + offset - 1) return false; // Can't possibly be a valid NEC message. if (strict && nbits != kNECBits) return false; // Not strictly an NEC message. uint64_t data = 0; - uint16_t offset = kStartOffset; - // Header + // Header - All NEC messages have this Header Mark. if (!matchMark(results->rawbuf[offset++], kNecHdrMark)) return false; // Check if it is a repeat code. - if (results->rawlen == kNecRptLength && - matchSpace(results->rawbuf[offset], kNecRptSpace) && - matchMark(results->rawbuf[offset + 1], kNecBitMark)) { + if (matchSpace(results->rawbuf[offset], kNecRptSpace) && + matchMark(results->rawbuf[offset + 1], kNecBitMark) && + (offset + 2 <= results->rawlen || + matchAtLeast(results->rawbuf[offset + 2], kNecMinGap))) { results->value = kRepeat; results->decode_type = NEC; results->bits = 0; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_NEC.h b/lib/IRremoteESP8266-2.7.4/src/ir_NEC.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_NEC.h rename to lib/IRremoteESP8266-2.7.4/src/ir_NEC.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Neoclima.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Neoclima.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Neoclima.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Neoclima.cpp index 8b944293e..0e410ca67 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Neoclima.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Neoclima.cpp @@ -463,6 +463,8 @@ String IRNeoclimaAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. Typically kNeoclimaBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -472,13 +474,12 @@ String IRNeoclimaAc::toString(void) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/764 -bool IRrecv::decodeNeoclima(decode_results *results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodeNeoclima(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Compliance if (strict && nbits != kNeoclimaBits) return false; // Incorrect nr. of bits per spec. - uint16_t offset = kStartOffset; // Match Main Header + Data + Footer uint16_t used; used = matchGeneric(results->rawbuf + offset, results->state, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Neoclima.h b/lib/IRremoteESP8266-2.7.4/src/ir_Neoclima.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Neoclima.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Neoclima.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Nikai.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Nikai.cpp similarity index 90% rename from lib/IRremoteESP8266-2.7.3/src/ir_Nikai.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Nikai.cpp index 12e99c278..5e6f9fbe5 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Nikai.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Nikai.cpp @@ -48,6 +48,8 @@ void IRsend::sendNikai(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kNikaiBits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -56,12 +58,12 @@ void IRsend::sendNikai(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Status: STABLE / Working. // -bool IRrecv::decodeNikai(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeNikai(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kNikaiBits) return false; // We expect Nikai to be a certain sized message. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Panasonic.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Panasonic.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Panasonic.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Panasonic.cpp index 511986a11..bf472de88 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Panasonic.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Panasonic.cpp @@ -142,6 +142,8 @@ uint64_t IRsend::encodePanasonic(const uint16_t manufacturer, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -153,13 +155,13 @@ uint64_t IRsend::encodePanasonic(const uint16_t manufacturer, // Ref: // http://www.remotecentral.com/cgi-bin/mboard/rc-pronto/thread.cgi?26152 // http://www.hifi-remote.com/wiki/index.php?title=Panasonic -bool IRrecv::decodePanasonic(decode_results *results, const uint16_t nbits, - const bool strict, const uint32_t manufacturer) { +bool IRrecv::decodePanasonic(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict, + const uint32_t manufacturer) { if (strict && nbits != kPanasonicBits) return false; // Request is out of spec. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, @@ -810,6 +812,8 @@ String IRPanasonicAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kPanasonicAcBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -825,20 +829,18 @@ String IRPanasonicAc::toString(void) { // A/C Remotes: // A75C3747 (Confirmed) // A75C3704 -bool IRrecv::decodePanasonicAC(decode_results *results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodePanasonicAC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { uint8_t min_nr_of_messages = 1; if (strict) { if (nbits != kPanasonicAcBits && nbits != kPanasonicAcShortBits) return false; // Not strictly a PANASONIC_AC message. } - if (results->rawlen < - min_nr_of_messages * (2 * nbits + kHeader + kFooter) - 1) + if (results->rawlen <= + min_nr_of_messages * (2 * nbits + kHeader + kFooter) - 1 + offset) return false; // Can't possibly be a valid PANASONIC_AC message. - uint16_t offset = kStartOffset; - // Match Header + Data #1 + Footer uint16_t used; used = matchGeneric(results->rawbuf + offset, results->state, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Panasonic.h b/lib/IRremoteESP8266-2.7.4/src/ir_Panasonic.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Panasonic.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Panasonic.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Pioneer.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Pioneer.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_Pioneer.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Pioneer.cpp index 490ea9440..85343a117 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Pioneer.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Pioneer.cpp @@ -96,6 +96,8 @@ uint64_t IRsend::encodePioneer(const uint16_t address, const uint16_t command) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kPioneerBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -103,15 +105,14 @@ uint64_t IRsend::encodePioneer(const uint16_t address, const uint16_t command) { // // Status: BETA / Should be working. (Self decodes & real examples) // -bool IRrecv::decodePioneer(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1) +bool IRrecv::decodePioneer(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * (nbits + kHeader + kFooter) - 1 + offset) return false; // Can't possibly be a valid Pioneer message. if (strict && nbits != kPioneerBits) return false; // Not strictly an Pioneer message. uint64_t data = 0; - uint16_t offset = kStartOffset; results->value = 0; for (uint16_t section = 0; section < 2; section++) { // Match Header + Data + Footer diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Pronto.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Pronto.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Pronto.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Pronto.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_RC5_RC6.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_RC5_RC6.cpp similarity index 95% rename from lib/IRremoteESP8266-2.7.3/src/ir_RC5_RC6.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_RC5_RC6.cpp index b79416692..ce69aaa3a 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_RC5_RC6.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_RC5_RC6.cpp @@ -347,6 +347,8 @@ int16_t IRrecv::getRClevel(decode_results *results, uint16_t *offset, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -363,14 +365,14 @@ int16_t IRrecv::getRClevel(decode_results *results, uint16_t *offset, // https://en.wikipedia.org/wiki/Manchester_code // TODO(anyone): // Serious testing of the RC-5X and strict aspects needs to be done. -bool IRrecv::decodeRC5(decode_results *results, uint16_t nbits, bool strict) { - if (results->rawlen < kRc5SamplesMin + kHeader - 1) return false; +bool IRrecv::decodeRC5(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= kRc5SamplesMin + kHeader - 1 + offset) return false; // Compliance if (strict && nbits != kRC5Bits && nbits != kRC5XBits) return false; // It's neither RC-5 or RC-5X. - uint16_t offset = kStartOffset; uint16_t used = 0; bool is_rc5x = false; uint64_t data = 0; @@ -432,6 +434,8 @@ bool IRrecv::decodeRC5(decode_results *results, uint16_t nbits, bool strict) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -444,8 +448,10 @@ bool IRrecv::decodeRC5(decode_results *results, uint16_t nbits, bool strict) { // https://en.wikipedia.org/wiki/Manchester_code // TODO(anyone): // Testing of the strict compliance aspects. -bool IRrecv::decodeRC6(decode_results *results, uint16_t nbits, bool strict) { - if (results->rawlen < kHeader + 2 + 4) // Up to the double-wide T bit. +bool IRrecv::decodeRC6(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= kHeader + 2 + 4 + offset) + // Up to the double-wide T bit. return false; // Smaller than absolute smallest possible RC6 message. if (strict) { // Compliance @@ -455,7 +461,7 @@ bool IRrecv::decodeRC6(decode_results *results, uint16_t nbits, bool strict) { // Also due to potential melding with the start bit, we can only count // the start bit as 1, instead of a more typical 2 value. The header still // remains as normal. - if (results->rawlen < nbits + kHeader + 1) + if (results->rawlen <= nbits + kHeader + 1 + offset) return false; // Don't have enough entries/samples to be valid. switch (nbits) { case kRC6Mode0Bits: @@ -466,8 +472,6 @@ bool IRrecv::decodeRC6(decode_results *results, uint16_t nbits, bool strict) { } } - uint16_t offset = kStartOffset; - // Header if (!matchMark(results->rawbuf[offset], kRc6HdrMark)) return false; // Calculate how long the common tick time is based on the header mark. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_RCMM.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_RCMM.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_RCMM.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_RCMM.cpp index 4e8f43891..a2542e467 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_RCMM.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_RCMM.cpp @@ -95,6 +95,8 @@ void IRsend::sendRCMM(uint64_t data, uint16_t nbits, uint16_t repeat) { // Places successful decode information in the results pointer. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. Typically kRCMMBits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -104,11 +106,11 @@ void IRsend::sendRCMM(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // http://www.sbprojects.com/knowledge/ir/rcmm.php -bool IRrecv::decodeRCMM(decode_results *results, uint16_t nbits, bool strict) { +bool IRrecv::decodeRCMM(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { uint64_t data = 0; - uint16_t offset = kStartOffset; - if (results->rawlen <= 4) + if (results->rawlen <= 4 + offset - 1) return false; // Not enough entries to ever be RCMM. // Calc the maximum size in bits, the message can be, or that we can accept. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Samsung.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Samsung.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/src/ir_Samsung.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Samsung.cpp index 1ca7a2b4a..a31e76953 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Samsung.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Samsung.cpp @@ -109,6 +109,8 @@ uint32_t IRsend::encodeSAMSUNG(const uint8_t customer, const uint8_t command) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. Typically kSamsungBits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -121,15 +123,12 @@ uint32_t IRsend::encodeSAMSUNG(const uint8_t customer, const uint8_t command) { // They differ on their compliance criteria and how they repeat. // Ref: // http://elektrolab.wz.cz/katalog/samsung_protocol.pdf -bool IRrecv::decodeSAMSUNG(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) - return false; // Can't possibly be a valid Samsung message. +bool IRrecv::decodeSAMSUNG(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kSamsungBits) return false; // We expect Samsung to be 32 bits of message. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, @@ -201,6 +200,8 @@ void IRsend::sendSamsung36(const uint64_t data, const uint16_t nbits, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. // Typically kSamsung36Bits. // strict: Flag to indicate if we strictly adhere to the specification. @@ -214,9 +215,9 @@ void IRsend::sendSamsung36(const uint64_t data, const uint16_t nbits, // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/621 -bool IRrecv::decodeSamsung36(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * nbits + kHeader + kFooter * 2 - 1) +bool IRrecv::decodeSamsung36(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * nbits + kHeader + kFooter * 2 - 1 + offset) return false; // Can't possibly be a valid Samsung message. // We need to be looking for > 16 bits to make sense. if (nbits <= 16) return false; @@ -224,7 +225,6 @@ bool IRrecv::decodeSamsung36(decode_results *results, const uint16_t nbits, return false; // We expect nbits to be 36 bits of message. uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer uint16_t used; @@ -570,6 +570,22 @@ void IRSamsungAc::setPowerful(const bool on) { } } +bool IRSamsungAc::getDisplay(void) { + return GETBIT8(remote_state[10], kSamsungAcDisplayOffset); +} + +void IRSamsungAc::setDisplay(const bool on) { + setBit(&remote_state[10], kSamsungAcDisplayOffset, on); +} + +bool IRSamsungAc::getIon(void) { + return GETBIT8(remote_state[11], kSamsungAcIonOffset); +} + +void IRSamsungAc::setIon(const bool on) { + setBit(&remote_state[11], kSamsungAcIonOffset, on); +} + // Convert a standard A/C mode into its native mode. uint8_t IRSamsungAc::convertMode(const stdAc::opmode_t mode) { switch (mode) { @@ -631,11 +647,11 @@ stdAc::state_t IRSamsungAc::toCommon(void) { result.turbo = this->getPowerful(); result.clean = this->getClean(); result.beep = this->getBeep(); + result.light = this->getDisplay(); + result.filter = this->getIon(); // Not supported. result.swingh = stdAc::swingh_t::kOff; result.econo = false; - result.filter = false; - result.light = false; result.sleep = -1; result.clock = -1; return result; @@ -644,7 +660,7 @@ stdAc::state_t IRSamsungAc::toCommon(void) { // Convert the internal state into a human readable string. String IRSamsungAc::toString(void) { String result = ""; - result.reserve(100); // Reserve some heap for the string to reduce fragging. + result.reserve(115); // Reserve some heap for the string to reduce fragging. result += addBoolToString(getPower(), kPowerStr, false); result += addModeToString(getMode(), kSamsungAcAuto, kSamsungAcCool, kSamsungAcHeat, kSamsungAcDry, @@ -679,6 +695,8 @@ String IRSamsungAc::toString(void) { result += addBoolToString(getClean(), kCleanStr); result += addBoolToString(getQuiet(), kQuietStr); result += addBoolToString(getPowerful(), kPowerfulStr); + result += addBoolToString(getDisplay(), kLightStr); + result += addBoolToString(getIon(), kIonStr); return result; } @@ -687,6 +705,8 @@ String IRSamsungAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kSamsungAcBits // strict: Flag indicating if we should perform strict matching. // Returns: @@ -696,14 +716,12 @@ String IRSamsungAc::toString(void) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/505 -bool IRrecv::decodeSamsungAC(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * nbits + kHeader * 3 + kFooter * 2 - 1) +bool IRrecv::decodeSamsungAC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * nbits + kHeader * 3 + kFooter * 2 - 1 + offset) return false; // Can't possibly be a valid Samsung A/C message. if (nbits != kSamsungAcBits && nbits != kSamsungAcExtendedBits) return false; - uint16_t offset = kStartOffset; - // Message Header if (!matchMark(results->rawbuf[offset++], kSamsungAcBitMark)) return false; if (!matchSpace(results->rawbuf[offset++], kSamsungAcHdrSpace)) return false; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Samsung.h b/lib/IRremoteESP8266-2.7.4/src/ir_Samsung.h similarity index 93% rename from lib/IRremoteESP8266-2.7.3/src/ir_Samsung.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Samsung.h index de2172444..52a781b65 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Samsung.h +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Samsung.h @@ -18,7 +18,9 @@ // Supports: // Brand: Samsung, Model: UA55H6300 TV +// Brand: Samsung, Model: DB63-03556X003 remote // Brand: Samsung, Model: IEC-R03 remote +// Brand: Samsung, Model: AR09FSSDAWKNFA A/C // Brand: Samsung, Model: AR12KSFPEWQNET A/C // Brand: Samsung, Model: AR12HSSDBWKNEU A/C @@ -58,6 +60,8 @@ const uint8_t kSamsungAcQuiet5Offset = 5; const uint8_t kSamsungAcPowerfulMask8 = 0b01010000; const uint8_t kSamsungAcPowerful10Offset = 1; // Mask 0b00000110 const uint8_t kSamsungAcPowerful10Size = 1; // Mask 0b00000110 +const uint8_t kSamsungAcDisplayOffset = 4; // Mask 0b00010000 +const uint8_t kSamsungAcIonOffset = 0; // Mask 0b00000001 const uint16_t kSamsungACSectionLength = 7; const uint64_t kSamsungAcPowerSection = 0x1D20F00000000; @@ -99,6 +103,12 @@ class IRSamsungAc { bool getQuiet(void); void setPowerful(const bool on); bool getPowerful(void); + + void setDisplay(const bool on); + bool getDisplay(void); + void setIon(const bool on); + bool getIon(void); + uint8_t* getRaw(void); void setRaw(const uint8_t new_code[], const uint16_t length = kSamsungAcStateLength); diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Sanyo.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Sanyo.cpp similarity index 96% rename from lib/IRremoteESP8266-2.7.3/src/ir_Sanyo.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Sanyo.cpp index b05e76766..f797fb678 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Sanyo.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Sanyo.cpp @@ -96,7 +96,7 @@ uint64_t IRsend::encodeSanyoLC7461(uint16_t address, uint8_t command) { // https://github.com/marcosamarinho/IRremoteESP8266/blob/master/ir_Sanyo.cpp // http://pdf.datasheetcatalog.com/datasheet/sanyo/LC7461.pdf void IRsend::sendSanyoLC7461(uint64_t data, uint16_t nbits, uint16_t repeat) { - // This protocol appears to be another 42-bit variant of the NEC protcol. + // This protocol appears to be another 42-bit variant of the NEC protocol. sendNEC(data, nbits, repeat); } #endif // SEND_SANYO @@ -106,6 +106,8 @@ void IRsend::sendSanyoLC7461(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -123,12 +125,12 @@ void IRsend::sendSanyoLC7461(uint64_t data, uint16_t nbits, uint16_t repeat) { // http://slydiman.narod.ru/scr/kb/sanyo.htm // https://github.com/marcosamarinho/IRremoteESP8266/blob/master/ir_Sanyo.cpp // http://pdf.datasheetcatalog.com/datasheet/sanyo/LC7461.pdf -bool IRrecv::decodeSanyoLC7461(decode_results *results, uint16_t nbits, - bool strict) { +bool IRrecv::decodeSanyoLC7461(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (strict && nbits != kSanyoLC7461Bits) return false; // Not strictly in spec. // This protocol is basically a 42-bit variant of the NEC protocol. - if (!decodeNEC(results, nbits, false)) + if (!decodeNEC(results, offset, nbits, false)) return false; // Didn't match a NEC format (without strict) // Bits 30 to 42+. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Sharp.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Sharp.cpp similarity index 96% rename from lib/IRremoteESP8266-2.7.3/src/ir_Sharp.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Sharp.cpp index abd93ecf6..f28ca0f4d 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Sharp.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Sharp.cpp @@ -168,6 +168,8 @@ void IRsend::sendSharp(const uint16_t address, uint16_t const command, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. Typically kSharpBits. // strict: Flag indicating if we should perform strict matching. // expansion: Should we expect the expansion bit to be set. Default is true. @@ -185,9 +187,10 @@ void IRsend::sendSharp(const uint16_t address, uint16_t const command, // http://www.sbprojects.com/knowledge/ir/sharp.php // http://www.mwftr.com/ucF08/LEC14%20PIC%20IR.pdf // http://www.hifi-remote.com/johnsfine/DecodeIR.html#Sharp -bool IRrecv::decodeSharp(decode_results *results, const uint16_t nbits, - const bool strict, const bool expansion) { - if (results->rawlen < 2 * nbits + kFooter - 1) +bool IRrecv::decodeSharp(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict, + const bool expansion) { + if (results->rawlen <= 2 * nbits + kFooter - 1 + offset) return false; // Not enough entries to be a Sharp message. // Compliance if (strict) { @@ -196,12 +199,12 @@ bool IRrecv::decodeSharp(decode_results *results, const uint16_t nbits, #ifdef UNIT_TEST // An in spec message has the data sent normally, then inverted. So we // expect twice as many entries than to just get the results. - if (results->rawlen < 2 * (2 * nbits + kFooter)) return false; + if (results->rawlen <= (2 * (2 * nbits + kFooter)) - 1 + offset) + return false; #endif } uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Data + Footer uint16_t used; @@ -496,6 +499,8 @@ String IRSharpAc::toString(void) { // Decode the supplied Sharp A/C message. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of bits to expect in the data portion. (kSharpAcBits) // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -506,16 +511,11 @@ String IRSharpAc::toString(void) { // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/638 // https://github.com/ToniA/arduino-heatpumpir/blob/master/SharpHeatpumpIR.cpp -bool IRrecv::decodeSharpAc(decode_results *results, const uint16_t nbits, - const bool strict) { - // Is there enough data to match successfully? - if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) - return false; - +bool IRrecv::decodeSharpAc(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Compliance if (strict && nbits != kSharpAcBits) return false; - uint16_t offset = kStartOffset; // Match Header + Data + Footer uint16_t used; used = matchGeneric(results->rawbuf + offset, results->state, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Sharp.h b/lib/IRremoteESP8266-2.7.4/src/ir_Sharp.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Sharp.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Sharp.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Sherwood.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Sherwood.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Sherwood.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Sherwood.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Sony.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Sony.cpp similarity index 95% rename from lib/IRremoteESP8266-2.7.3/src/ir_Sony.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Sony.cpp index d0f4b3c7a..c346eb293 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Sony.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Sony.cpp @@ -134,6 +134,8 @@ uint32_t IRsend::encodeSony(uint16_t nbits, uint16_t command, uint16_t address, // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -145,8 +147,9 @@ uint32_t IRsend::encodeSony(uint16_t nbits, uint16_t command, uint16_t address, // SONY protocol, SIRC (Serial Infra-Red Control) can be 12,15,20 bits long. // Ref: // http://www.sbprojects.com/knowledge/ir/sirc.php -bool IRrecv::decodeSony(decode_results *results, uint16_t nbits, bool strict) { - if (results->rawlen < 2 * nbits + kHeader - 1) +bool IRrecv::decodeSony(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= 2 * nbits + kHeader - 1 + offset) return false; // Message is smaller than we expected. // Compliance @@ -162,7 +165,6 @@ bool IRrecv::decodeSony(decode_results *results, uint16_t nbits, bool strict) { } uint64_t data = 0; - uint16_t offset = kStartOffset; uint16_t actualBits; // Header diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Tcl.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Tcl.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Tcl.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Tcl.cpp diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Tcl.h b/lib/IRremoteESP8266-2.7.4/src/ir_Tcl.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Tcl.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Tcl.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Teco.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Teco.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Teco.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Teco.cpp index 200f1954d..8e33e04ec 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Teco.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Teco.cpp @@ -298,18 +298,19 @@ String IRTecoAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kTecoBits. // strict: Flag indicating if we should perform strict matching. // Returns: // boolean: True if it can decode it, false if it can't. // // Status: STABLE / Tested. -bool IRrecv::decodeTeco(decode_results* results, +bool IRrecv::decodeTeco(decode_results* results, uint16_t offset, const uint16_t nbits, const bool strict) { if (strict && nbits != kTecoBits) return false; // Not what is expected uint64_t data = 0; - uint16_t offset = kStartOffset; // Match Header + Data + Footer if (!matchGeneric(results->rawbuf + offset, &data, results->rawlen - offset, nbits, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Teco.h b/lib/IRremoteESP8266-2.7.4/src/ir_Teco.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Teco.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Teco.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Toshiba.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Toshiba.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/src/ir_Toshiba.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Toshiba.cpp index ba1ca5424..3113e1b09 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Toshiba.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Toshiba.cpp @@ -316,6 +316,8 @@ String IRToshibaAC::toString(void) { // Places successful decode information in the results pointer. // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kToshibaACBits. // strict: Flag to indicate if we strictly adhere to the specification. // Returns: @@ -325,10 +327,8 @@ String IRToshibaAC::toString(void) { // // Ref: // -bool IRrecv::decodeToshibaAC(decode_results* results, const uint16_t nbits, - const bool strict) { - uint16_t offset = kStartOffset; - +bool IRrecv::decodeToshibaAC(decode_results* results, uint16_t offset, + const uint16_t nbits, const bool strict) { // Compliance if (strict && nbits != kToshibaACBits) return false; // Must be called with the correct nr. of bytes. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Toshiba.h b/lib/IRremoteESP8266-2.7.4/src/ir_Toshiba.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Toshiba.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Toshiba.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Trotec.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Trotec.cpp similarity index 96% rename from lib/IRremoteESP8266-2.7.3/src/ir_Trotec.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Trotec.cpp index cb923b5fc..563564d36 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Trotec.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Trotec.cpp @@ -238,6 +238,8 @@ String IRTrotecESP::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kTrotecBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -246,13 +248,12 @@ String IRTrotecESP::toString(void) { // Status: BETA / Probably works. Untested on real devices. // // Ref: -bool IRrecv::decodeTrotec(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * nbits + kHeader + 2 * kFooter - 1) +bool IRrecv::decodeTrotec(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= 2 * nbits + kHeader + 2 * kFooter - 1 + offset) return false; // Can't possibly be a valid Samsung A/C message. if (strict && nbits != kTrotecBits) return false; - uint16_t offset = kStartOffset; uint16_t used; // Header + Data + Footer #1 used = matchGeneric(results->rawbuf + offset, results->state, diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Trotec.h b/lib/IRremoteESP8266-2.7.4/src/ir_Trotec.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Trotec.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Trotec.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Vestel.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Vestel.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Vestel.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Vestel.cpp index c2a3a905b..4378497e0 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Vestel.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Vestel.cpp @@ -512,6 +512,8 @@ String IRVestelAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kVestelBits. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -519,8 +521,8 @@ String IRVestelAc::toString(void) { // // Status: Alpha / Needs testing against a real device. // -bool IRrecv::decodeVestelAc(decode_results* results, const uint16_t nbits, - const bool strict) { +bool IRrecv::decodeVestelAc(decode_results* results, uint16_t offset, + const uint16_t nbits, const bool strict) { if (nbits % 8 != 0) // nbits has to be a multiple of nr. of bits in a byte. return false; @@ -529,7 +531,6 @@ bool IRrecv::decodeVestelAc(decode_results* results, const uint16_t nbits, return false; // Not strictly a Vestel AC message. uint64_t data = 0; - uint16_t offset = kStartOffset; if (nbits > sizeof(data) * 8) return false; // We can't possibly capture a Vestel packet that big. diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Vestel.h b/lib/IRremoteESP8266-2.7.4/src/ir_Vestel.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Vestel.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Vestel.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Whirlpool.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Whirlpool.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/src/ir_Whirlpool.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Whirlpool.cpp index 9dbdf62e5..e1ca2e6db 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Whirlpool.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Whirlpool.cpp @@ -542,6 +542,8 @@ String IRWhirlpoolAc::toString(void) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: The number of data bits to expect. Typically kWhirlpoolAcBits // strict: Flag indicating if we should perform strict matching. // Returns: @@ -552,16 +554,15 @@ String IRWhirlpoolAc::toString(void) { // // Ref: // https://github.com/crankyoldgit/IRremoteESP8266/issues/509 -bool IRrecv::decodeWhirlpoolAC(decode_results *results, const uint16_t nbits, - const bool strict) { - if (results->rawlen < 2 * nbits + 4 + kHeader + kFooter - 1) +bool IRrecv::decodeWhirlpoolAC(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen < 2 * nbits + 4 + kHeader + kFooter - 1 + offset) return false; // Can't possibly be a valid Whirlpool A/C message. if (strict) { if (nbits != kWhirlpoolAcBits) return false; } - uint16_t offset = kStartOffset; - uint8_t sectionSize[kWhirlpoolAcSections] = {6, 8, 7}; + const uint8_t sectionSize[kWhirlpoolAcSections] = {6, 8, 7}; // Header if (!matchMark(results->rawbuf[offset++], kWhirlpoolAcHdrMark)) return false; diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Whirlpool.h b/lib/IRremoteESP8266-2.7.4/src/ir_Whirlpool.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/ir_Whirlpool.h rename to lib/IRremoteESP8266-2.7.4/src/ir_Whirlpool.h diff --git a/lib/IRremoteESP8266-2.7.3/src/ir_Whynter.cpp b/lib/IRremoteESP8266-2.7.4/src/ir_Whynter.cpp similarity index 91% rename from lib/IRremoteESP8266-2.7.3/src/ir_Whynter.cpp rename to lib/IRremoteESP8266-2.7.4/src/ir_Whynter.cpp index c5634f381..118eb7559 100644 --- a/lib/IRremoteESP8266-2.7.3/src/ir_Whynter.cpp +++ b/lib/IRremoteESP8266-2.7.4/src/ir_Whynter.cpp @@ -69,6 +69,8 @@ void IRsend::sendWhynter(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Args: // results: Ptr to the data to decode and where to store the decode result. +// offset: The starting index to use when attempting to decode the raw data. +// Typically/Defaults to kStartOffset. // nbits: Nr. of data bits to expect. // strict: Flag indicating if we should perform strict matching. // Returns: @@ -78,16 +80,15 @@ void IRsend::sendWhynter(uint64_t data, uint16_t nbits, uint16_t repeat) { // // Ref: // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Whynter.cpp -bool IRrecv::decodeWhynter(decode_results *results, uint16_t nbits, - bool strict) { - if (results->rawlen < 2 * nbits + 2 * kHeader + kFooter - 1) +bool IRrecv::decodeWhynter(decode_results *results, uint16_t offset, + const uint16_t nbits, const bool strict) { + if (results->rawlen <= 2 * nbits + 2 * kHeader + kFooter - 1 + offset) return false; // We don't have enough entries to possibly match. // Compliance if (strict && nbits != kWhynterBits) return false; // Incorrect nr. of bits per spec. - uint16_t offset = kStartOffset; uint64_t data = 0; // Pre-Header // Sequence begins with a bit mark and a zero space. diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/README.md b/lib/IRremoteESP8266-2.7.4/src/locale/README.md similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/README.md rename to lib/IRremoteESP8266-2.7.4/src/locale/README.md diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/de-CH.h b/lib/IRremoteESP8266-2.7.4/src/locale/de-CH.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/de-CH.h rename to lib/IRremoteESP8266-2.7.4/src/locale/de-CH.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/de-DE.h b/lib/IRremoteESP8266-2.7.4/src/locale/de-DE.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/de-DE.h rename to lib/IRremoteESP8266-2.7.4/src/locale/de-DE.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/defaults.h b/lib/IRremoteESP8266-2.7.4/src/locale/defaults.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/defaults.h rename to lib/IRremoteESP8266-2.7.4/src/locale/defaults.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/en-AU.h b/lib/IRremoteESP8266-2.7.4/src/locale/en-AU.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/en-AU.h rename to lib/IRremoteESP8266-2.7.4/src/locale/en-AU.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/en-IE.h b/lib/IRremoteESP8266-2.7.4/src/locale/en-IE.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/en-IE.h rename to lib/IRremoteESP8266-2.7.4/src/locale/en-IE.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/en-UK.h b/lib/IRremoteESP8266-2.7.4/src/locale/en-UK.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/en-UK.h rename to lib/IRremoteESP8266-2.7.4/src/locale/en-UK.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/en-US.h b/lib/IRremoteESP8266-2.7.4/src/locale/en-US.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/en-US.h rename to lib/IRremoteESP8266-2.7.4/src/locale/en-US.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/es-ES.h b/lib/IRremoteESP8266-2.7.4/src/locale/es-ES.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/es-ES.h rename to lib/IRremoteESP8266-2.7.4/src/locale/es-ES.h diff --git a/lib/IRremoteESP8266-2.7.3/src/locale/fr-FR.h b/lib/IRremoteESP8266-2.7.4/src/locale/fr-FR.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/src/locale/fr-FR.h rename to lib/IRremoteESP8266-2.7.4/src/locale/fr-FR.h diff --git a/lib/IRremoteESP8266-2.7.4/src/locale/it-IT.h b/lib/IRremoteESP8266-2.7.4/src/locale/it-IT.h new file mode 100644 index 000000000..b078a7319 --- /dev/null +++ b/lib/IRremoteESP8266-2.7.4/src/locale/it-IT.h @@ -0,0 +1,157 @@ +// Copyright 2020 - Enrico Gueli (@egueli) +// Locale/language file for Italian. +// This file will override the default values located in `defaults.h`. + +#ifndef LOCALE_IT_IT_H_ +#define LOCALE_IT_IT_H_ + +#define D_STR_UNKNOWN "SCONOSCIUTO" +#define D_STR_PROTOCOL "Protocollo" +#define D_STR_POWER "Accensione" +#define D_STR_ON "Acceso" +#define D_STR_OFF "Spento" +#define D_STR_MODE "Modalità" +#define D_STR_TOGGLE "Alterna" +#define D_STR_SLEEP "Sonno" +#define D_STR_LIGHT "Leggero" +#define D_STR_POWERFUL "Forte" +#define D_STR_QUIET "Silenzioso" +#define D_STR_ECONO "Eco" +#define D_STR_SWING "Swing" +#define D_STR_SWINGH D_STR_SWING"(O)" // Set `D_STR_SWING` first! +#define D_STR_SWINGV D_STR_SWING"(V)" // Set `D_STR_SWING` first! +#define D_STR_MOULD "Muffa" +#define D_STR_CLEAN "Pulizia" +#define D_STR_PURIFY "Purifica" +#define D_STR_TIMER "Timer" +#define D_STR_ONTIMER D_STR_ON " " D_STR_TIMER // Set `D_STR_ON` first! +#define D_STR_OFFTIMER D_STR_OFF " " D_STR_TIMER // Set `D_STR_OFF` first! +#define D_STR_CLOCK "Orologio" +#define D_STR_COMMAND "Comando" +#define D_STR_MODEL "Modello" +#define D_STR_TEMP "Temp" +#define D_STR_HUMID "Umido" +#define D_STR_SAVE "Salva" +#define D_STR_EYE "Occhio" +#define D_STR_FOLLOW "Segui" +#define D_STR_ION "Ioni" +#define D_STR_FRESH "Fresco" +#define D_STR_HOLD "Mantieni" +#define D_STR_8C_HEAT "8C " D_STR_HEAT // Set `D_STR_HEAT` first! +#define D_STR_BUTTON "Pulsante" +#define D_STR_NIGHT "Notte" +#define D_STR_SILENT "Silenzioso" +#define D_STR_FILTER "Filtro" +#define D_STR_UP "Su" +#define D_STR_TEMPUP D_STR_TEMP " " D_STR_UP // Set `D_STR_TEMP` first! +#define D_STR_DOWN "Giù" +#define D_STR_TEMPDOWN D_STR_TEMP " " D_STR_DOWN // Set `D_STR_TEMP` first! +#define D_STR_CHANGE "Cambia" +#define D_STR_START "Avvia" +#define D_STR_STOP "Ferma" +#define D_STR_MOVE "Muovi" +#define D_STR_SET "Imposta" +#define D_STR_CANCEL "Annulla" +#define D_STR_SENSOR "Sensore" +#define D_STR_WEEKLY "Settimanale" +#define D_STR_WEEKLYTIMER D_STR_WEEKLY " " D_STR_TIMER // Needs `D_STR_WEEKLY`! +#define D_STR_LAST "Ultimo" +#define D_STR_FAST "Veloce" +#define D_STR_SLOW "Lento" +#define D_STR_AIRFLOW "Flusso d'aria" +#define D_STR_STEP "Passo" +#define D_STR_NA "N/D" +#define D_STR_OUTSIDE "Esterno" +#define D_STR_LOUD "Rumoroso" +#define D_STR_UPPER "Superiore" +#define D_STR_LOWER "Inferiore" +#define D_STR_CIRCULATE "Circolare" +#define D_STR_CEILING "Soffitto" +#define D_STR_WALL "Muro" +#define D_STR_ROOM "Camera" +#define D_STR_FIXED "Fisso" + +#define D_STR_AUTO "Auto" +#define D_STR_AUTOMATIC "Automatico" +#define D_STR_MANUAL "Manuale" +#define D_STR_COOL "Fresco" +#define D_STR_HEAT "Caldo" +#define D_STR_FAN "Ventola" +#define D_STR_FANONLY "solo_ventola" +#define D_STR_DRY "Secco" + +#define D_STR_MAX "Max" +#define D_STR_MAXIMUM "Massimo" +#define D_STR_MINIMUM "Minimo" +#define D_STR_MEDIUM "Medio" + +#define D_STR_HIGHEST "Molto alto" +#define D_STR_HIGH "Alto" +#define D_STR_MID "Med" +#define D_STR_MIDDLE "Medio" +#define D_STR_LOW "Basso" +#define D_STR_LOWEST "Bassissimo" +#define D_STR_RIGHT "Destra" +#define D_STR_MAXRIGHT D_STR_MAX " " D_STR_RIGHT // Set `D_STR_MAX` first! +#define D_STR_RIGHTMAX_NOSPACE D_STR_RIGHT D_STR_MAX // Set `D_STR_MAX` first! +#define D_STR_LEFT "Sinistra" +#define D_STR_MAXLEFT D_STR_MAX " " D_STR_LEFT // Set `D_STR_MAX` first! +#define D_STR_LEFTMAX_NOSPACE D_STR_LEFT D_STR_MAX // Set `D_STR_MAX` first! +#define D_STR_WIDE "Largo" +#define D_STR_CENTRE "Centro" +#define D_STR_TOP "Superiore" +#define D_STR_BOTTOM "Inferiore" +// Compound words/phrases/descriptions from pre-defined words. +// Note: Obviously these need to be defined *after* their component words. + +#define D_STR_EYEAUTO D_STR_EYE " " D_STR_AUTO +#define D_STR_LIGHTTOGGLE D_STR_LIGHT " " D_STR_TOGGLE +#define D_STR_OUTSIDEQUIET D_STR_OUTSIDE " " D_STR_QUIET +#define D_STR_POWERTOGGLE D_STR_POWER " " D_STR_TOGGLE +#define D_STR_SENSORTEMP D_STR_SENSOR " " D_STR_TEMP +#define D_STR_SLEEP_TIMER D_STR_SLEEP " " D_STR_TIMER +#define D_STR_SWINGVMODE D_STR_SWINGV " " D_STR_MODE +#define D_STR_SWINGVTOGGLE D_STR_SWINGV " " D_STR_TOGGLE +// Separators +#ifndef D_CHR_TIME_SEP +#define D_CHR_TIME_SEP '.' +#endif // D_CHR_TIME_SEP + +#define D_STR_SPACELBRACE " (" +#define D_STR_COMMASPACE ", " +#define D_STR_COLONSPACE ": " + +#define D_STR_DAY "Giorno" +#define D_STR_DAYS D_STR_DAY "s" +#define D_STR_HOUR "Ore" +#define D_STR_HOURS D_STR_HOUR "s" +#define D_STR_MINUTE "Minuti" +#define D_STR_MINUTES D_STR_MINUTE "s" +#define D_STR_SECOND "Secondi" +#define D_STR_SECONDS D_STR_SECOND "s" +#define D_STR_NOW "Adesso" +#define D_STR_THREELETTERDAYS "DomLunMarMerGioVenSab" + +#define D_STR_YES "Sì" +#define D_STR_TRUE "Vero" +#define D_STR_FALSE "Falso" + +#define D_STR_REPEAT "Ripeti" +#define D_STR_CODE "Codice" +#define D_STR_BITS "Bit" +// IRrecvDumpV2 + +#define D_STR_LIBRARY "Libreria" +#define D_STR_MESGDESC "Desc. Mess." +#define D_STR_IRRECVDUMP_STARTUP \ + "IRrecvDumpV2 è ora attivo e in attesa di segnali IR dal pin %d" + +#ifndef D_WARN_BUFFERFULL +#define D_WARN_BUFFERFULL \ + "ATTENZIONE: il codice IR è troppo grande per il buffer (>= %d). " \ + "Non fare affidamento a questi risultati finché questo problema " \ + "non è risolto." \ + "Modifica e aumenta `kCaptureBufferSize`." +#endif // D_WARN_BUFFERFULL + +#endif // LOCALE_IT_IT_H_ diff --git a/lib/IRremoteESP8266-2.7.3/test/IRac_test.cpp b/lib/IRremoteESP8266-2.7.4/test/IRac_test.cpp similarity index 95% rename from lib/IRremoteESP8266-2.7.3/test/IRac_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/IRac_test.cpp index 875485eee..c8c231621 100644 --- a/lib/IRremoteESP8266-2.7.3/test/IRac_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/IRac_test.cpp @@ -332,21 +332,24 @@ TEST(TestIRac, Daikin216) { } TEST(TestIRac, Electra) { - IRElectraAc ac(0); - IRac irac(0); - IRrecv capture(0); + IRElectraAc ac(kGpioUnused); + IRac irac(kGpioUnused); + IRrecv capture(kGpioUnused); char expected[] = "Power: On, Mode: 6 (Fan), Temp: 26C, Fan: 1 (High), " - "Swing(V): On, Swing(H): On"; + "Swing(V): On, Swing(H): On, Light: Toggle, Clean: On, Turbo: On"; ac.begin(); irac.electra(&ac, - true, // Power - stdAc::opmode_t::kFan, // Mode - 26, // Celsius - stdAc::fanspeed_t::kHigh, // Fan speed - stdAc::swingv_t::kAuto, // Veritcal swing - stdAc::swingh_t::kLeft); // Horizontal swing + true, // Power + stdAc::opmode_t::kFan, // Mode + 26, // Celsius + stdAc::fanspeed_t::kHigh, // Fan speed + stdAc::swingv_t::kAuto, // Veritcal swing + stdAc::swingh_t::kLeft, // Horizontal swing + true, // Turbo + true, // Light (toggle) + true); // Clean ASSERT_EQ(expected, ac.toString()); ac._irsend.makeDecodeResult(); EXPECT_TRUE(capture.decode(&ac._irsend.capture)); @@ -892,7 +895,7 @@ TEST(TestIRac, Samsung) { IRrecv capture(0); char expected[] = "Power: On, Mode: 0 (Auto), Temp: 28C, Fan: 6 (Auto), Swing: On, " - "Beep: On, Clean: On, Quiet: On, Powerful: Off"; + "Beep: On, Clean: On, Quiet: On, Powerful: Off, Light: On, Ion: Off"; ac.begin(); irac.samsung(&ac, @@ -903,6 +906,8 @@ TEST(TestIRac, Samsung) { stdAc::swingv_t::kAuto, // Veritcal swing true, // Quiet false, // Turbo + true, // Light (Display) + false, // Filter (Ion) true, // Clean true, // Beep true, // Previous power state @@ -923,6 +928,8 @@ TEST(TestIRac, Samsung) { stdAc::swingv_t::kAuto, // Veritcal swing true, // Quiet false, // Turbo + true, // Light (Display) + false, // Filter (Ion) true, // Clean true, // Beep true, // Previous power state @@ -936,7 +943,7 @@ TEST(TestIRac, Samsung) { // desired state. char expected_on[] = "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off"; + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off"; ASSERT_EQ(expected_on, IRAcUtils::resultAcToString(&ac._irsend.capture)); } @@ -1600,3 +1607,64 @@ TEST(TestIRac, Issue1001) { "Command: 1 (Power)", IRAcUtils::resultAcToString(&ac._irsend.capture)); } + +// Check power switching in Daikin2 common a/c handling when from an IR message. +TEST(TestIRac, Issue1035) { + stdAc::state_t prev; // Previously desired state + stdAc::state_t result; // State we need to send to get to `desired` + prev.protocol = decode_type_t::DAIKIN2; + prev.model = -1; + prev.power = false; + prev.mode = stdAc::opmode_t::kAuto; + prev.degrees = 24; + prev.celsius = true; + prev.fanspeed = stdAc::fanspeed_t::kAuto; + prev.swingv = stdAc::swingv_t::kOff; + prev.swingh = stdAc::swingh_t::kOff; + prev.quiet = false; + prev.turbo = false; + prev.econo = false; + prev.light = false; + prev.filter = false; + prev.clean = false; + prev.beep = false; + prev.sleep = -1; + + // https://github.com/crankyoldgit/IRremoteESP8266/issues/1035#issuecomment-580963572 + const uint8_t on_code[kDaikin2StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x01, 0x15, 0x43, 0x90, 0x29, 0x0C, 0x80, 0x04, + 0xC0, 0x16, 0x24, 0x00, 0x00, 0xBE, 0xC1, 0x2D, 0x11, 0xDA, 0x27, 0x00, + 0x00, 0x09, 0x2A, 0x00, 0xB0, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC1, + 0x90, 0x60, 0x0C}; + const uint8_t off_code[kDaikin2StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x01, 0x15, 0xC3, 0x90, 0x29, 0x0C, 0x80, 0x04, + 0xC0, 0x16, 0x24, 0x00, 0x00, 0xBE, 0xD1, 0xBD, 0x11, 0xDA, 0x27, 0x00, + 0x00, 0x08, 0x2A, 0x00, 0xB0, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC1, + 0x90, 0x60, 0x0B}; + + IRac irac(kGpioUnused); + IRrecv capture(kGpioUnused); + IRDaikin2 ac(kGpioUnused); + + ac.begin(); + ac.setRaw(on_code); + ac.send(); + ac._irsend.makeDecodeResult(); + ASSERT_TRUE(capture.decode(&ac._irsend.capture)); + ASSERT_EQ(DAIKIN2, ac._irsend.capture.decode_type); + ASSERT_FALSE(prev.power); + ASSERT_TRUE(IRAcUtils::decodeToState(&ac._irsend.capture, &result, &prev)); + ASSERT_TRUE(result.power); + + prev = result; + + ac._irsend.reset(); + ac.setRaw(off_code); + ac.send(); + ac._irsend.makeDecodeResult(); + ASSERT_TRUE(capture.decode(&ac._irsend.capture)); + ASSERT_EQ(DAIKIN2, ac._irsend.capture.decode_type); + ASSERT_TRUE(prev.power); + ASSERT_TRUE(IRAcUtils::decodeToState(&ac._irsend.capture, &result, &prev)); + ASSERT_FALSE(result.power); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/IRrecv_test.cpp b/lib/IRremoteESP8266-2.7.4/test/IRrecv_test.cpp similarity index 74% rename from lib/IRremoteESP8266-2.7.3/test/IRrecv_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/IRrecv_test.cpp index 9dff78c75..fa025a2cb 100644 --- a/lib/IRremoteESP8266-2.7.3/test/IRrecv_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/IRrecv_test.cpp @@ -168,7 +168,8 @@ TEST(TestDecode, DecodePanasonic) { irsend.reset(); irsend.sendPanasonic64(0x40040190ED7C); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); @@ -1244,3 +1245,347 @@ TEST(TestIRrecv, Tolerance) { result = irrecv.matchData(irsend.capture.rawbuf + 1, 5, 1500, 500, 500, 1500); ASSERT_FALSE(result.success); } + +TEST(TestDecode, SkippingInDecode) { + IRsendTest irsend(0); + IRrecv irrecv(1); + irsend.begin(); + + // Normal (default) usage. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + + // Explicitly use the default (no skipping) + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + // Enable the least amount of actual skipping. + // Should still decode normal data. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 1)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + + // Crank up the amount of actual skipping. + // Should still decode normal data. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 10)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + + // Introduce some noise before the actual message. + + // Should not match as NEC anymore. + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_NE(NEC, irsend.capture.decode_type); + // Now with explicit default options set. + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0)); + EXPECT_NE(NEC, irsend.capture.decode_type); + + // Now with 1 skip, which it should match as NEC as there is only one + // mark + space pair of noise. + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 1)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + + // Now with more than 1 skip, which it should match as NEC as there is only + // one mark + space pair of noise. + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 5)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + + // Test multiple noise pairs. + + irsend.reset(); + irsend.mark(160); + irsend.space(60); + irsend.mark(60); + irsend.space(160); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + // Default decode parameters should fail to detect as NEC. + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_NE(NEC, irsend.capture.decode_type); + // A single skip should fail to detect as NEC, as there are two pairs of noise + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 1)); + EXPECT_NE(NEC, irsend.capture.decode_type); + // However, two skips should match it correctly. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 2)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + // And so should more than 2 skips. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 10)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); +} + +TEST(TestCrudeNoiseFilter, General) { + IRsendTest irsend(0); + IRrecv irrecv(1); + irsend.begin(); + + // Normal (default) usage. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // Explicitly no filtering. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 0)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // Filter out anything less than 100usecs of which there should be none. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // Add small noise at the start, but don't filter it + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 0)); + EXPECT_NE(NEC, irsend.capture.decode_type); + EXPECT_EQ(69 + 2, irsend.capture.rawlen); + + // Add small noise at the start, but filter it this time + irsend.reset(); + irsend.mark(60); + irsend.space(60); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + irsend.reset(); + irsend.mark(60); // Less than the filter floor. + irsend.space(560); + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + irsend.reset(); + irsend.mark(100); // Higher than the filter floor. + irsend.space(200); // Higher than the filter floor. + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_NE(kNECBits, irsend.capture.bits); + EXPECT_EQ(69 + 2, irsend.capture.rawlen); + + irsend.reset(); + irsend.mark(160); // Higher than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // Multiple noise at the start + irsend.reset(); + irsend.mark(60); // Lower than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.mark(60); // Lower than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.mark(60); // Lower than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // A mix of noise that should be removed. + irsend.reset(); + irsend.mark(60); // Lower than the filter floor. + irsend.space(160); // Higher than the filter floor. + irsend.mark(160); // Higher than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.mark(160); // Higher than the filter floor. + irsend.space(60); // Lower than the filter floor. + irsend.sendNEC(0x4BB640BF); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); + + // Add noise that should be removed to the end of a message. + irsend.reset(); + irsend.sendNEC(0x4BB640BF); + irsend.mark(60); // Lower than the filter floor. + irsend.space(160); // Higher than the filter floor. + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 100)); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x4BB640BF, irsend.capture.value); + EXPECT_EQ(69, irsend.capture.rawlen); +} + +TEST(TestCrudeNoiseFilter, NoiseMidSample) { + IRsendTest irsend(0); + IRrecv irrecv(1); + irsend.begin(); + + // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1042#issuecomment-583895303 + uint16_t rawData[71] = { + 482, 1370, 9082, 1558, 342, 2514, 662, 470, 660, 468, 658, 1588, 662, 466, + 662, 466, 662, 466, 662, 466, 662, 466, 662, 1586, 660, 1588, 662, 466, + 662, 1588, 662, 1586, 662, 1586, 660, 1588, 662, 1586, 662, 468, 660, + 1588, 662, 468, 662, 466, 660, 466, 662, 464, 662, 466, 662, 466, 662, + 1588, 660, 466, 662, 1586, 662, 1588, 660, 1586, 662, 1586, 662, 1586, + 664, 1594, 662}; // UNKNOWN B0784C9E + + irsend.reset(); + irsend.sendRaw(rawData, 71, 38); + irsend.makeDecodeResult(); + // Try with no filter first. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 1, 0)); + EXPECT_NE(NEC, irsend.capture.decode_type); + const uint16_t prev_length = irsend.capture.rawlen; + // Now with the filter set to 350, to remove the 342 mark at rawData[4]. + // Note: a mark of 350us is huge. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 1, 350)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x20DF40BF, irsend.capture.value); + EXPECT_EQ(prev_length - 2, irsend.capture.rawlen); + EXPECT_EQ( + "uint16_t rawData[69] = {482, 1370, 9082, 4414, 662, 470, 660, 468, " + "658, 1588, 662, 466, 662, 466, 662, 466, 662, 466, 662, 466, 662, " + "1586, 660, 1588, 662, 466, 662, 1588, 662, 1586, 662, 1586, 660, " + "1588, 662, 1586, 662, 468, 660, 1588, 662, 468, 662, 466, 660, " + "466, 662, 464, 662, 466, 662, 466, 662, 1588, 660, 466, 662, " + "1586, 662, 1588, 660, 1586, 662, 1586, 662, 1586, 664, 1594, " + "662}; // NEC 20DF40BF\n" + "uint32_t address = 0x4;\n" + "uint32_t command = 0x2;\n" + "uint64_t data = 0x20DF40BF;\n", + resultToSourceCode(&irsend.capture)); + + // Data modified as rawData2[3] which was 882 is too far out of spec. for a + // NEC bit mark. + uint16_t rawData2[7] = { + 9066, 2026, 600, 13906, 222, 992, 734}; // UNKNOWN 8FDE36A7 + irsend.reset(); + irsend.sendRaw(rawData2, 7, 38); + irsend.makeDecodeResult(); + // Try with no filter first. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 0)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(0, irsend.capture.bits); + EXPECT_TRUE(irsend.capture.repeat); + // Now with the filter set to 250, to remove the 222 mark at rawData2[4]. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 350)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(0, irsend.capture.bits); + EXPECT_TRUE(irsend.capture.repeat); + EXPECT_EQ( + "uint16_t rawData[5] = {9066, 2026, 600, 15120, 734}; " + "// NEC (Repeat) FFFFFFFFFFFFFFFF\n" + "uint64_t data = 0xFFFFFFFFFFFFFFFF;\n", + resultToSourceCode(&irsend.capture)); +} + +TEST(TestCrudeNoiseFilter, NoiseAtEndOfSample) { + IRsendTest irsend(0); + IRrecv irrecv(1); + irsend.begin(); + + // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1042#issuecomment-583895303 + uint16_t rawData[69] = { // UNKNOWN B52869E1 + 9078, 4386, 662, 468, 660, 466, 662, 1588, 660, 468, 660, 468, 662, 466, + 662, 466, 662, 466, 662, 1588, 660, 1588, 660, 466, 662, 1590, 660, 1586, + 662, 1586, 662, 1588, 662, 1584, 662, 1588, 662, 1588, 660, 466, 686, 442, + 662, 466, 662, 466, 662, 466, 662, 468, 662, 466, 662, 466, 662, 1586, + 662, 1588, 662, 1586, 644, 1600, 662, 1586, 688, 1566, 684, 2638, 146}; + irsend.reset(); + irsend.sendRaw(rawData, 69, 38); + irsend.makeDecodeResult(); + // Try with no filter first. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 0)); + EXPECT_NE(NEC, irsend.capture.decode_type); + const uint16_t prev_length = irsend.capture.rawlen; + + // Now with the filter set to 200, to remove the 146 mark at at the end. + EXPECT_TRUE(irrecv.decode(&irsend.capture, NULL, 0, 200)); + EXPECT_EQ(NEC, irsend.capture.decode_type); + EXPECT_EQ(kNECBits, irsend.capture.bits); + EXPECT_EQ(0x20DFC03F, irsend.capture.value); + EXPECT_EQ(prev_length - 2, irsend.capture.rawlen); + EXPECT_EQ( + "uint16_t rawData[67] = {9078, 4386, 662, 468, 660, 466, 662, 1588, " + "660, 468, 660, 468, 662, 466, 662, 466, 662, 466, 662, 1588, 660, " + "1588, 660, 466, 662, 1590, 660, 1586, 662, 1586, 662, 1588, 662, " + "1584, 662, 1588, 662, 1588, 660, 466, 686, 442, 662, 466, 662, " + "466, 662, 466, 662, 468, 662, 466, 662, 466, 662, 1586, 662, 1588," + " 662, 1586, 644, 1600, 662, 1586, 688, 1566, 684}; " + "// NEC 20DFC03F\n" + "uint32_t address = 0x4;\n" + "uint32_t command = 0x3;\n" + "uint64_t data = 0x20DFC03F;\n", + resultToSourceCode(&irsend.capture)); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/IRrecv_test.h b/lib/IRremoteESP8266-2.7.4/test/IRrecv_test.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/IRrecv_test.h rename to lib/IRremoteESP8266-2.7.4/test/IRrecv_test.h diff --git a/lib/IRremoteESP8266-2.7.3/test/IRsend_test.cpp b/lib/IRremoteESP8266-2.7.4/test/IRsend_test.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/test/IRsend_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/IRsend_test.cpp index fbf8ba229..f2e280504 100644 --- a/lib/IRremoteESP8266-2.7.3/test/IRsend_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/IRsend_test.cpp @@ -193,7 +193,7 @@ TEST(TestSendRaw, GeneralUse) { irsend.reset(); irsend.sendRaw(rawData, 67, 38); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, kNECBits, false)); + ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, kNECBits, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0xC3E0E0E8, irsend.capture.value); diff --git a/lib/IRremoteESP8266-2.7.3/test/IRsend_test.h b/lib/IRremoteESP8266-2.7.4/test/IRsend_test.h similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/IRsend_test.h rename to lib/IRremoteESP8266-2.7.4/test/IRsend_test.h diff --git a/lib/IRremoteESP8266-2.7.3/test/IRutils_test.cpp b/lib/IRremoteESP8266-2.7.4/test/IRutils_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/IRutils_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/IRutils_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/Makefile b/lib/IRremoteESP8266-2.7.4/test/Makefile similarity index 98% rename from lib/IRremoteESP8266-2.7.3/test/Makefile rename to lib/IRremoteESP8266-2.7.4/test/Makefile index cdf133913..7b1a4b379 100644 --- a/lib/IRremoteESP8266-2.7.3/test/Makefile +++ b/lib/IRremoteESP8266-2.7.4/test/Makefile @@ -39,7 +39,7 @@ TESTS = IRutils_test IRsend_test ir_NEC_test ir_GlobalCache_test \ ir_Whirlpool_test ir_Lutron_test ir_Electra_test ir_Pioneer_test \ ir_MWM_test ir_Vestel_test ir_Teco_test ir_Tcl_test ir_Lego_test IRac_test \ ir_MitsubishiHeavy_test ir_Trotec_test ir_Argo_test ir_Goodweather_test \ - ir_Inax_test ir_Neoclima_test ir_Amcor_test + ir_Inax_test ir_Neoclima_test ir_Amcor_test ir_Epson_test # All Google Test headers. Usually you shouldn't change this # definition. @@ -85,7 +85,7 @@ PROTOCOLS = ir_NEC.o ir_Sony.o ir_Samsung.o ir_JVC.o ir_RCMM.o ir_RC5_RC6.o \ ir_Hitachi.o ir_GICable.o ir_Whirlpool.o ir_Lutron.o ir_Electra.o \ ir_Pioneer.o ir_MWM.o ir_Vestel.o ir_Teco.o ir_Tcl.o ir_Lego.o ir_Argo.o \ ir_Trotec.o ir_MitsubishiHeavy.o ir_Goodweather.o ir_Inax.o ir_Neoclima.o \ - ir_Amcor.o + ir_Amcor.o ir_Epson.o # All the IR Protocol header files. PROTOCOLS_H = $(USER_DIR)/ir_Amcor.h \ @@ -623,3 +623,12 @@ ir_Amcor_test.o : ir_Amcor_test.cpp $(COMMON_TEST_DEPS) $(GTEST_HEADERS) ir_Amcor_test : $(COMMON_OBJ) ir_Amcor_test.o $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ + +ir_Epson.o : $(USER_DIR)/ir_Epson.cpp $(COMMON_DEPS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Epson.cpp + +ir_Epson_test.o : ir_Epson_test.cpp $(COMMON_TEST_DEPS) $(GTEST_HEADERS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c ir_Epson_test.cpp + +ir_Epson_test : $(COMMON_OBJ) ir_Epson_test.o + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Aiwa_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Aiwa_test.cpp similarity index 83% rename from lib/IRremoteESP8266-2.7.3/test/ir_Aiwa_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Aiwa_test.cpp index 2fa63afe6..f87d5c5e2 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Aiwa_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Aiwa_test.cpp @@ -130,7 +130,8 @@ TEST(TestDecodeAiwa, NormalDecodeWithStrict) { irsend.reset(); irsend.sendAiwaRCT501(0x7F); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(kAiwaRcT501Bits, irsend.capture.bits); EXPECT_EQ(0x7F, irsend.capture.value); @@ -142,7 +143,8 @@ TEST(TestDecodeAiwa, NormalDecodeWithStrict) { irsend.reset(); irsend.sendAiwaRCT501(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(kAiwaRcT501Bits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -154,7 +156,8 @@ TEST(TestDecodeAiwa, NormalDecodeWithStrict) { irsend.reset(); irsend.sendAiwaRCT501(0x7FFF); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(kAiwaRcT501Bits, irsend.capture.bits); EXPECT_EQ(0x7FFF, irsend.capture.value); @@ -173,7 +176,8 @@ TEST(TestDecodeAiwa, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendAiwaRCT501(0x7F, kAiwaRcT501Bits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(kAiwaRcT501Bits, irsend.capture.bits); EXPECT_EQ(0x7F, irsend.capture.value); @@ -193,7 +197,8 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictValues) { irsend.sendNEC(0x1D8113F00FF, 42, kAiwaRcT501MinRepeats); irsend.makeDecodeResult(); // MUST pass with strict on. - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); ASSERT_EQ(0x7F, irsend.capture.value); irsend.reset(); @@ -202,10 +207,12 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictValues) { irsend.sendNEC(0x1234567890A, 42, kAiwaRcT501MinRepeats); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); // Should fail if strict off too. ASSERT_FALSE( - irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, false)); + irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, kAiwaRcT501Bits, + false)); irsend.reset(); // Use sendNEC(data, 42) to make/send an illegal value Aiwa message. @@ -213,7 +220,8 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictValues) { irsend.sendNEC(0x1D8113F00FE, 42, kAiwaRcT501MinRepeats); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); // Should fail if strict off too. ASSERT_FALSE( irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, false)); @@ -224,10 +232,12 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictValues) { irsend.sendNEC(0x0D8113F00FF, 42, kAiwaRcT501MinRepeats); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); // Should fail if strict off too. ASSERT_FALSE( - irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, false)); + irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, kAiwaRcT501Bits, + false)); } // Decode unsupported Aiwa messages. @@ -240,9 +250,10 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictSizes) { irsend.sendAiwaRCT501(0x0, 8); // Illegal size Aiwa 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -251,12 +262,15 @@ TEST(TestDecodeAiwa, DecodeWithNonStrictSizes) { irsend.sendAiwaRCT501(0x12345678, 32); // Illegal size Aiwa 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, + kAiwaRcT501Bits, true)); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, 32, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, 32, + false)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -273,7 +287,8 @@ TEST(TestDecodeAiwa, Decode64BitMessages) { irsend.sendAiwaRCT501(0x1FFFFFFFFF, 37); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, 37, false)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, 37, + false)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(37, irsend.capture.bits); EXPECT_EQ(0x1FFFFFFFFF, irsend.capture.value); @@ -283,7 +298,8 @@ TEST(TestDecodeAiwa, Decode64BitMessages) { irsend.sendNEC(0x76044FFFFFFFFFFF, 64, kAiwaRcT501MinRepeats); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, 37, false)); + ASSERT_TRUE(irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, 37, + false)); EXPECT_EQ(AIWA_RC_T501, irsend.capture.decode_type); EXPECT_EQ(37, irsend.capture.bits); EXPECT_EQ(0x1FFFFFFFFF, irsend.capture.value); @@ -316,7 +332,7 @@ TEST(TestDecodeAiwa, DecodeGlobalCacheExample) { EXPECT_FALSE(irsend.capture.repeat); // Confirm what the 42-bit NEC decode is. - ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, 42, false)); + ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 42, false)); EXPECT_EQ(0x1D8113F00FF, irsend.capture.value); } @@ -336,5 +352,6 @@ TEST(TestDecodeAiwa, FailToDecodeNonAiwaExample) { ASSERT_FALSE(irrecv.decodeAiwaRCT501(&irsend.capture)); ASSERT_FALSE( - irrecv.decodeAiwaRCT501(&irsend.capture, kAiwaRcT501Bits, false)); + irrecv.decodeAiwaRCT501(&irsend.capture, kStartOffset, kAiwaRcT501Bits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Amcor_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Amcor_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Amcor_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Amcor_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Argo_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Argo_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Argo_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Argo_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Carrier_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Carrier_test.cpp similarity index 97% rename from lib/IRremoteESP8266-2.7.3/test/ir_Carrier_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Carrier_test.cpp index 053b31dd4..f62a9d0f5 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Carrier_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Carrier_test.cpp @@ -161,7 +161,8 @@ TEST(TestDecodeCarrierAC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendCarrierAC(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCarrierAC(&irsend.capture, kCarrierAcBits, true)); + ASSERT_TRUE(irrecv.decodeCarrierAC(&irsend.capture, kStartOffset, + kCarrierAcBits, true)); EXPECT_EQ(CARRIER_AC, irsend.capture.decode_type); EXPECT_EQ(kCarrierAcBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -172,7 +173,8 @@ TEST(TestDecodeCarrierAC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendCarrierAC(0xB335ABE2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCarrierAC(&irsend.capture, kCarrierAcBits, true)); + ASSERT_TRUE(irrecv.decodeCarrierAC(&irsend.capture, kStartOffset, + kCarrierAcBits, true)); EXPECT_EQ(CARRIER_AC, irsend.capture.decode_type); EXPECT_EQ(kCarrierAcBits, irsend.capture.bits); EXPECT_EQ(0xB335ABE2, irsend.capture.value); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Coolix_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Coolix_test.cpp similarity index 91% rename from lib/IRremoteESP8266-2.7.3/test/ir_Coolix_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Coolix_test.cpp index 226e1aa68..20a46c7b4 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Coolix_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Coolix_test.cpp @@ -215,7 +215,8 @@ TEST(TestDecodeCoolix, NormalDecodeWithStrict) { irsend.reset(); irsend.sendCOOLIX(0x123456); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0x123456, irsend.capture.value); @@ -227,7 +228,8 @@ TEST(TestDecodeCoolix, NormalDecodeWithStrict) { irsend.reset(); irsend.sendCOOLIX(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -239,7 +241,8 @@ TEST(TestDecodeCoolix, NormalDecodeWithStrict) { irsend.reset(); irsend.sendCOOLIX(0xFFFFFF); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0xFFFFFF, irsend.capture.value); @@ -258,20 +261,23 @@ TEST(TestDecodeCoolix, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendCOOLIX(0x123456, kCoolixBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0x123456, irsend.capture.value); EXPECT_FALSE(irsend.capture.repeat); irsend.makeDecodeResult(4 * kCoolixBits + 4); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0x123456, irsend.capture.value); irsend.makeDecodeResult(2 * (4 * kCoolixBits + 4)); - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(kCoolixBits, irsend.capture.bits); EXPECT_EQ(0x123456, irsend.capture.value); @@ -287,9 +293,10 @@ TEST(TestDecodeCoolix, DecodeWithNonStrictSizes) { irsend.sendCOOLIX(0x12, 8); // Illegal value Coolix 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x12, irsend.capture.value); @@ -298,13 +305,14 @@ TEST(TestDecodeCoolix, DecodeWithNonStrictSizes) { irsend.sendCOOLIX(0x12345678, 32); // Illegal value Coolix 32-bit message. irsend.makeDecodeResult(); // Shouldn't pass with strict when we ask for less bits than we got. - ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, true)); + ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -313,7 +321,7 @@ TEST(TestDecodeCoolix, DecodeWithNonStrictSizes) { irsend.reset(); irsend.sendCOOLIX(0x123456, kCoolixBits, 2); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, 9, false)); + ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, 9, false)); } // Decode (non-standard) 64-bit messages. @@ -327,7 +335,7 @@ TEST(TestDecodeCoolix, Decode64BitMessages) { irsend.sendCOOLIX(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(COOLIX, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -349,7 +357,8 @@ TEST(TestDecodeCoolix, FailToDecodeNonCoolixExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kCoolixBits, false)); + ASSERT_FALSE(irrecv.decodeCOOLIX(&irsend.capture, kStartOffset, kCoolixBits, + false)); } // Tests for the IRCoolixAC class. @@ -800,3 +809,44 @@ TEST(TestCoolixACClass, Issue985) { EXPECT_EQ(kCoolixOff, ac._irsend.capture.value); EXPECT_EQ("Power: Off", IRAcUtils::resultAcToString(&ac._irsend.capture)); } + +TEST(TestCoolixACClass, PowerStateWithSetRaw) { + IRrecv irrecv(kGpioUnused); + IRCoolixAC ac(kGpioUnused); + + // Problem reported that power is always off via decodeToState() + // Ref: + // https://github.com/crankyoldgit/IRremoteESP8266/pull/1040 + // https://github.com/arendst/Tasmota/issues/7660 + + const uint32_t on_code = 0xB2BFCC; // A valid "on" message. + + // Check the off case. + ac.setRaw(kCoolixOff); + ASSERT_FALSE(ac.getPower()); + EXPECT_FALSE(ac.toCommon().power); + + // Check the "on" case. + ac.setRaw(on_code); + ASSERT_TRUE(ac.getPower()); + EXPECT_TRUE(ac.toCommon().power); + // Now check the reported decodeToState() is also fixed. + ac._irsend.reset(); + ac.send(); + ac._irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&ac._irsend.capture)); + EXPECT_EQ(COOLIX, ac._irsend.capture.decode_type); + EXPECT_EQ(kCoolixBits, ac._irsend.capture.bits); + EXPECT_EQ(on_code, ac._irsend.capture.value); + EXPECT_EQ( + "Power: On, Mode: 3 (Heat), Fan: 5 (Auto), Temp: 25C, Zone Follow: Off, " + "Sensor Temp: Off", IRAcUtils::resultAcToString(&ac._irsend.capture)); + stdAc::state_t result; + ASSERT_TRUE(IRAcUtils::decodeToState(&ac._irsend.capture, &result)); + EXPECT_TRUE(result.power); + + // Recheck the off case to ensure it changes. + ac.setRaw(kCoolixOff); + ASSERT_FALSE(ac.getPower()); + EXPECT_FALSE(ac.toCommon().power); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Daikin_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Daikin_test.cpp similarity index 98% rename from lib/IRremoteESP8266-2.7.3/test/ir_Daikin_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Daikin_test.cpp index 9fcaabcb0..60d39d9a3 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Daikin_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Daikin_test.cpp @@ -3364,3 +3364,39 @@ TEST(TestDaikin152Class, BuildKnownState) { 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x6F}; EXPECT_STATE_EQ(expectedState, ac.getRaw(), kDaikin152Bits); } + +TEST(TestDaikin2Class, Issue1035) { + IRDaikin2 ac(kGpioUnused); + // https://github.com/crankyoldgit/IRremoteESP8266/issues/1035#issuecomment-580963572 + const uint8_t on_code[kDaikin2StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x01, 0x15, 0x43, 0x90, 0x29, 0x0C, 0x80, 0x04, + 0xC0, 0x16, 0x24, 0x00, 0x00, 0xBE, 0xC1, 0x2D, 0x11, 0xDA, 0x27, 0x00, + 0x00, 0x09, 0x2A, 0x00, 0xB0, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC1, + 0x90, 0x60, 0x0C}; + const uint8_t off_code[kDaikin2StateLength] = { + 0x11, 0xDA, 0x27, 0x00, 0x01, 0x15, 0xC3, 0x90, 0x29, 0x0C, 0x80, 0x04, + 0xC0, 0x16, 0x24, 0x00, 0x00, 0xBE, 0xD1, 0xBD, 0x11, 0xDA, 0x27, 0x00, + 0x00, 0x08, 0x2A, 0x00, 0xB0, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC1, + 0x90, 0x60, 0x0B}; + + ac.setRaw(on_code); + EXPECT_EQ( + "Power: On, Mode: 0 (Auto), Temp: 21C, Fan: 11 (Quiet), " + "Swing(V): 1 (Highest), Swing(H): 190 (Auto), Clock: 13:09, " + "On Timer: Off, Off Timer: Off, Sleep Timer: Off, Beep: 2 (Loud), " + "Light: 1 (High), Mould: On, Clean: On, Fresh: On, Eye: Off, " + "Eye Auto: Off, Quiet: Off, Powerful: Off, Purify: On, Econo: Off", + ac.toString()); + ASSERT_TRUE(ac.toCommon().power); + ASSERT_NE(ac.toCommon().mode, stdAc::opmode_t::kOff); + + ac.setRaw(off_code); + EXPECT_EQ( + "Power: Off, Mode: 0 (Auto), Temp: 21C, Fan: 11 (Quiet), " + "Swing(V): 1 (Highest), Swing(H): 190 (Auto), Clock: 13:09, " + "On Timer: Off, Off Timer: Off, Sleep Timer: Off, Beep: 2 (Loud), " + "Light: 1 (High), Mould: On, Clean: On, Fresh: On, Eye: Off, " + "Eye Auto: Off, Quiet: Off, Powerful: Off, Purify: On, Econo: Off", + ac.toString()); + ASSERT_FALSE(ac.toCommon().power); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Denon_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Denon_test.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/test/ir_Denon_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Denon_test.cpp index bfb554bb5..64be43f97 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Denon_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Denon_test.cpp @@ -185,7 +185,8 @@ TEST(TestDecodeDenon, NormalDecodeWithStrict) { irsend.sendDenon(0x2278); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kDenonBits, true)); + ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kStartOffset, kDenonBits, + true)); EXPECT_EQ(DENON, irsend.capture.decode_type); EXPECT_EQ(kDenonBits, irsend.capture.bits); EXPECT_EQ(0x2278, irsend.capture.value); @@ -198,7 +199,8 @@ TEST(TestDecodeDenon, NormalDecodeWithStrict) { irsend.sendDenon(0x1278, kDenonLegacyBits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kDenonLegacyBits, true)); + ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kStartOffset, + kDenonLegacyBits, true)); EXPECT_EQ(DENON, irsend.capture.decode_type); EXPECT_EQ(kDenonLegacyBits, irsend.capture.bits); EXPECT_EQ(0x1278, irsend.capture.value); @@ -210,7 +212,8 @@ TEST(TestDecodeDenon, NormalDecodeWithStrict) { irsend.reset(); irsend.sendDenon(0x2A4C028D6CE3, kDenon48Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kDenon48Bits, true)); + ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kStartOffset, + kDenon48Bits, true)); EXPECT_EQ(DENON, irsend.capture.decode_type); EXPECT_EQ(kDenon48Bits, irsend.capture.bits); EXPECT_EQ(0x2A4C028D6CE3, irsend.capture.value); @@ -235,7 +238,8 @@ TEST(TestDecodeDenon, DecodeGlobalCacheExample) { irsend.sendGC(gc_test_power, 67); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kDenonBits, true)); + ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kStartOffset, kDenonBits, + true)); EXPECT_EQ(DENON, irsend.capture.decode_type); EXPECT_EQ(kDenonBits, irsend.capture.bits); EXPECT_EQ(0x2278, irsend.capture.value); @@ -256,7 +260,8 @@ TEST(TestDecodeDenon, DecodeGlobalCacheExample) { irsend.sendGC(gc_test_eco, 103); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kDenon48Bits, true)); + ASSERT_TRUE(irrecv.decodeDenon(&irsend.capture, kStartOffset, kDenon48Bits, + true)); EXPECT_EQ(DENON, irsend.capture.decode_type); EXPECT_EQ(kDenon48Bits, irsend.capture.bits); EXPECT_EQ(0x2A4C028D6CE3, irsend.capture.value); @@ -280,7 +285,10 @@ TEST(TestDecodeDenon, FailToDecodeNonDenonExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kDenonLegacyBits, false)); - ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kDenonBits, false)); - ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kDenon48Bits, false)); + ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kStartOffset, + kDenonLegacyBits, false)); + ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kStartOffset, kDenonBits, + false)); + ASSERT_FALSE(irrecv.decodeDenon(&irsend.capture, kStartOffset, kDenon48Bits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Dish_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Dish_test.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/test/ir_Dish_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Dish_test.cpp index 21286b7ac..d74564811 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Dish_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Dish_test.cpp @@ -189,7 +189,8 @@ TEST(TestDecodeDish, NormalDecodeWithStrict) { irsend.reset(); irsend.sendDISH(0x9C00); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kDishBits, true)); + ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kStartOffset, kDishBits, + true)); EXPECT_EQ(DISH, irsend.capture.decode_type); EXPECT_EQ(kDishBits, irsend.capture.bits); EXPECT_EQ(0x9C00, irsend.capture.value); @@ -208,13 +209,14 @@ TEST(TestDecodeDish, DecodeWithNonStrictSize) { irsend.sendDISH(0x12, 8); // Illegal size Dish message. (smaller) irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kDishBits, true)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, kDishBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, 8, true)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 8, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(DISH, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x12, irsend.capture.value); @@ -225,13 +227,14 @@ TEST(TestDecodeDish, DecodeWithNonStrictSize) { irsend.sendDISH(0x12345678, 32); // Illegal size Dish message. (larger) irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kDishBits, true)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, kDishBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(DISH, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -249,9 +252,9 @@ TEST(TestDecodeDish, Decode64BitMessages) { // Illegal value & size Dish 64-bit message. irsend.sendDISH(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 64, true)); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(DISH, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -299,7 +302,8 @@ TEST(TestDecodeDish, DecodeGlobalCacheExample) { irsend.sendGC(gc_test_hopper, 73); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kDishBits, true)); + ASSERT_TRUE(irrecv.decodeDISH(&irsend.capture, kStartOffset, kDishBits, + true)); EXPECT_EQ(DISH, irsend.capture.decode_type); EXPECT_EQ(kDishBits, irsend.capture.bits); EXPECT_EQ(0x9C00, irsend.capture.value); @@ -332,5 +336,6 @@ TEST(TestDecodeDish, FailToDecodeNonDishExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kDishBits, false)); + ASSERT_FALSE(irrecv.decodeDISH(&irsend.capture, kStartOffset, kDishBits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Electra_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Electra_test.cpp similarity index 69% rename from lib/IRremoteESP8266-2.7.3/test/ir_Electra_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Electra_test.cpp index 43ea456c6..b49482433 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Electra_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Electra_test.cpp @@ -101,7 +101,7 @@ TEST(TestDecodeElectraAC, RealExampleDecode) { EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 3 (Low), " - "Swing(V): Off, Swing(H): Off", + "Swing(V): Off, Swing(H): Off, Light: -, Clean: Off, Turbo: Off", IRAcUtils::resultAcToString(&irsend.capture)); } @@ -199,24 +199,25 @@ TEST(TestIRElectraAcClass, toCommon) { ac.setFan(kElectraAcFanHigh); ac.setSwingV(true); ac.setSwingH(true); + ac.setClean(true); + ac.setLightToggle(true); // Now test it. ASSERT_EQ(decode_type_t::ELECTRA_AC, ac.toCommon().protocol); ASSERT_EQ(-1, ac.toCommon().model); ASSERT_TRUE(ac.toCommon().power); ASSERT_TRUE(ac.toCommon().celsius); ASSERT_EQ(20, ac.toCommon().degrees); - ASSERT_EQ(stdAc::opmode_t::kCool, ac.toCommon().mode); ASSERT_EQ(stdAc::fanspeed_t::kMax, ac.toCommon().fanspeed); ASSERT_EQ(stdAc::swingv_t::kAuto, ac.toCommon().swingv); ASSERT_EQ(stdAc::swingh_t::kAuto, ac.toCommon().swingh); + ASSERT_TRUE(ac.toCommon().clean); + ASSERT_TRUE(ac.toCommon().light); // Unsupported. ASSERT_FALSE(ac.toCommon().turbo); ASSERT_FALSE(ac.toCommon().filter); - ASSERT_FALSE(ac.toCommon().light); ASSERT_FALSE(ac.toCommon().quiet); ASSERT_FALSE(ac.toCommon().econo); - ASSERT_FALSE(ac.toCommon().clean); ASSERT_FALSE(ac.toCommon().beep); ASSERT_EQ(-1, ac.toCommon().sleep); ASSERT_EQ(-1, ac.toCommon().clock); @@ -232,19 +233,125 @@ TEST(TestIRElectraAcClass, HumanReadable) { ac.setRaw(on_cool_32C_auto_voff); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 32C, Fan: 5 (Auto), " - "Swing(V): Off, Swing(H): Off", ac.toString()); + "Swing(V): Off, Swing(H): Off, Light: -, Clean: Off, Turbo: Off", + ac.toString()); uint8_t on_cool_16C_auto_voff[13] = { 0xC3, 0x47, 0xE0, 0x00, 0xA0, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x41, 0x0B}; ac.setRaw(on_cool_16C_auto_voff); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 5 (Auto), " - "Swing(V): Off, Swing(H): Off", ac.toString()); + "Swing(V): Off, Swing(H): Off, Light: -, Clean: Off, Turbo: Off", + ac.toString()); uint8_t on_cool_16C_low_voff[13] = { 0xC3, 0x47, 0xE0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x41, 0xCB}; ac.setRaw(on_cool_16C_low_voff); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 3 (Low), " - "Swing(V): Off, Swing(H): Off", ac.toString()); + "Swing(V): Off, Swing(H): Off, Light: -, Clean: Off, Turbo: Off", + ac.toString()); +} + +TEST(TestIRElectraAcClass, Clean) { + IRElectraAc ac(kGpioUnused); + ac.begin(); + + ac.setClean(true); + EXPECT_TRUE(ac.getClean()); + + ac.setClean(false); + EXPECT_FALSE(ac.getClean()); + + ac.setClean(true); + EXPECT_TRUE(ac.getClean()); + + ac.setClean(false); + // ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1033#issuecomment-581133127 + uint8_t on[13] = {0xC3, 0x87, 0xE0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x24, + 0x00, 0x19, 0xE7}; + ac.setRaw(on); + EXPECT_EQ( + "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 3 (Low), " + "Swing(V): Off, Swing(H): Off, Light: Toggle, Clean: On, Turbo: Off", + ac.toString()); +} + +TEST(TestIRElectraAcClass, Turbo) { + IRElectraAc ac(kGpioUnused); + ac.begin(); + + ac.setTurbo(true); + EXPECT_TRUE(ac.getTurbo()); + + ac.setTurbo(false); + EXPECT_FALSE(ac.getTurbo()); + + ac.setTurbo(true); + EXPECT_TRUE(ac.getTurbo()); + + ac.setTurbo(false); + // ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1033#issuecomment-583888046 + const uint8_t on[13] = { + 0xC3, 0x87, 0xE0, 0x00, 0x60, 0x40, 0x20, 0x00, 0x00, 0x20, 0x00, 0x08, + 0x12}; + + ac.setRaw(on); + EXPECT_EQ( + "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 3 (Low), " + "Swing(V): Off, Swing(H): Off, Light: -, Clean: Off, Turbo: On", + ac.toString()); +} + +TEST(TestIRElectraAcClass, LightToggle) { + IRElectraAc ac(kGpioUnused); + ac.begin(); + + ac.setLightToggle(true); + EXPECT_TRUE(ac.getLightToggle()); + + ac.setLightToggle(false); + EXPECT_FALSE(ac.getLightToggle()); + + ac.setLightToggle(true); + EXPECT_TRUE(ac.getLightToggle()); + + ac.setLightToggle(false); + // ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1033#issuecomment-581133127 + uint8_t on[13] = {0xC3, 0x87, 0xE0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x24, + 0x00, 0x19, 0xE7}; + ac.setRaw(on); + EXPECT_EQ( + "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 3 (Low), " + "Swing(V): Off, Swing(H): Off, Light: Toggle, Clean: On, Turbo: Off", + ac.toString()); +} + +TEST(TestIRElectraAcClass, ConstructKnownState) { + IRElectraAc ac(kGpioUnused); + // Data from: + // https://github.com/crankyoldgit/IRremoteESP8266/issues/1033#issuecomment-581133127 + // A/C on - Cooling mode - 24° - Fan speed set to 1 - Light set to toggle + // - flaps off - turbo off - clean on + const uint8_t on_cool_24C_fan1_swing_off_turbo_off_clean_on[13] = { + 0xC3, 0x87, 0xE0, 0x00, 0x60, 0x00, 0x20, + // 0x00, 0x00, 0x24, 0x00, 0x19, 0xE7}; // Real captured data + // TODO(ShonP40): Explain `state[11]` difference. + 0x00, 0x00, 0x24, 0x00, 0x15, 0xE3}; // state[11] hacked to pass test. + ac.stateReset(); + ac.on(); + ac.setMode(kElectraAcCool); + ac.setTemp(24); + ac.setSwingH(false); + ac.setSwingV(false); + ac.setFan(kElectraAcFanLow); + ac.setLightToggle(true); + ac.setClean(true); + + EXPECT_EQ( + "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 3 (Low), " + "Swing(V): Off, Swing(H): Off, Light: Toggle, Clean: On, Turbo: Off", + ac.toString()); + EXPECT_STATE_EQ(on_cool_24C_fan1_swing_off_turbo_off_clean_on, + ac.getRaw(), kElectraAcBits); } diff --git a/lib/IRremoteESP8266-2.7.4/test/ir_Epson_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Epson_test.cpp new file mode 100644 index 000000000..d1df3f9ac --- /dev/null +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Epson_test.cpp @@ -0,0 +1,159 @@ +// Copyright 2020 David Conran + +#include "IRac.h" +#include "IRrecv.h" +#include "IRrecv_test.h" +#include "IRsend.h" +#include "IRsend_test.h" +#include "gtest/gtest.h" + +// Tests for sendEpson(). + +// Test sending typical data only. +TEST(TestSendEpson, SendDataOnly) { + IRsendTest irsend(kGpioUnused); + irsend.begin(); + irsend.sendEpson(0xC1AA09F6); + EXPECT_EQ( + "f38000d33" + "m8960s4480" + "m560s1680m560s1680m560s560m560s560m560s560m560s560m560s560m560s1680" + "m560s1680m560s560m560s1680m560s560m560s1680m560s560m560s1680m560s560" + "m560s560m560s560m560s560m560s560m560s1680m560s560m560s560m560s1680" + "m560s1680m560s1680m560s1680m560s1680m560s560m560s1680m560s1680m560s560" + "m560s41440" + "m8960s4480" + "m560s1680m560s1680m560s560m560s560m560s560m560s560m560s560m560s1680" + "m560s1680m560s560m560s1680m560s560m560s1680m560s560m560s1680m560s560" + "m560s560m560s560m560s560m560s560m560s1680m560s560m560s560m560s1680" + "m560s1680m560s1680m560s1680m560s1680m560s560m560s1680m560s1680m560s560" + "m560s41440" + "m8960s4480" + "m560s1680m560s1680m560s560m560s560m560s560m560s560m560s560m560s1680" + "m560s1680m560s560m560s1680m560s560m560s1680m560s560m560s1680m560s560" + "m560s560m560s560m560s560m560s560m560s1680m560s560m560s560m560s1680" + "m560s1680m560s1680m560s1680m560s1680m560s560m560s1680m560s1680m560s560" + "m560s41440", + irsend.outputStr()); +} + +// Tests for decodeEpson(). + +// Decode normal Epson messages. +TEST(TestDecodeEpson, SyntheticSelfDecode) { + IRsendTest irsend(kGpioUnused); + IRrecv irrecv(kGpioUnused); + irsend.begin(); + + // Real-life Epson code from an actual capture/decode. + irsend.reset(); + irsend.sendEpson(0xC1AA09F6); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(EPSON, irsend.capture.decode_type); + EXPECT_EQ(kEpsonBits, irsend.capture.bits); + EXPECT_EQ(0xC1AA09F6, irsend.capture.value); + EXPECT_EQ(0x5583, irsend.capture.address); + EXPECT_EQ(0x90, irsend.capture.command); + EXPECT_TRUE(irsend.capture.repeat); +} + +// Decode a real Epson message. +TEST(TestDecodeEpson, RealMessageDecode) { + IRsendTest irsend(kGpioUnused); + IRrecv irrecv(kGpioUnused); + irsend.begin(); + + // Real-life Epson code from an actual capture/decode. + irsend.reset(); + const uint16_t rawData_0[203] = { + 8976, 4496, 542, 1690, 542, 1688, 542, 588, 518, 612, 542, 586, 518, 610, + 518, 610, 542, 1688, 516, 1714, 542, 614, 516, 1688, 542, 612, 516, 1690, + 540, 614, 514, 1690, 520, 638, 516, 584, 518, 612, 542, 586, 540, 588, + 542, 1688, 520, 610, 540, 586, 520, 1712, 540, 1692, 542, 1688, 542, 1690, + 520, 1710, 518, 610, 518, 1712, 518, 1716, 544, 584, 544, 40870, + 8978, 4496, 542, 1690, 542, 1688, 520, 610, 542, 584, 516, 638, 514, 588, + 540, 588, 540, 1690, 516, 1716, 516, 614, 542, 1688, 518, 612, 542, 1688, + 540, 614, 514, 1692, 542, 588, 538, 590, 542, 586, 542, 612, 516, 612, + 514, 1692, 516, 612, 540, 586, 520, 1712, 518, 1714, 542, 1688, 518, 1716, + 542, 1688, 516, 614, 542, 1686, 518, 1714, 516, 612, 532, 40882, + 8976, 4498, 516, 1716, 542, 1690, 540, 614, 516, 614, 516, 614, 514, 588, + 540, 588, 544, 1688, 522, 1710, 518, 638, 516, 1688, 520, 636, 492, 1714, + 542, 586, 542, 1690, 542, 588, 542, 584, 542, 612, 516, 612, 514, 614, + 516, 1690, 542, 586, 542, 586, 540, 1690, 518, 1712, 518, 1716, 518, 1714, + 542, 1690, 542, 586, 540, 1690, 542, 1690, 542, 588, 540}; + irsend.sendRaw(rawData_0, 203, 38000); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(EPSON, irsend.capture.decode_type); + EXPECT_EQ(kEpsonBits, irsend.capture.bits); + EXPECT_EQ(0xC1AA09F6, irsend.capture.value); + EXPECT_EQ(0x5583, irsend.capture.address); + EXPECT_EQ(0x90, irsend.capture.command); + EXPECT_TRUE(irsend.capture.repeat); +} + +TEST(TestDecodeEpson, RequiresARepeat) { + IRsendTest irsend(kGpioUnused); + IRrecv irrecv(kGpioUnused); + irsend.begin(); + + // Simulate sending only two messages (mesg + repeat) + irsend.reset(); + irsend.sendEpson(0xC1AA09F6, kEpsonBits, 1); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(EPSON, irsend.capture.decode_type); + EXPECT_EQ(kEpsonBits, irsend.capture.bits); + EXPECT_EQ(0xC1AA09F6, irsend.capture.value); + EXPECT_EQ(0x5583, irsend.capture.address); + EXPECT_EQ(0x90, irsend.capture.command); + EXPECT_TRUE(irsend.capture.repeat); + + // Simulate sending no repeats (just 1 message) which should fail to be + // detected as Epson. + irsend.reset(); + irsend.sendEpson(0xC1AA09F6, kEpsonBits, 0); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + ASSERT_NE(EPSON, irsend.capture.decode_type); +} + +TEST(TestDecodeEpson, DecodeOnlyIfRepeatIsTheSame) { + IRsendTest irsend(kGpioUnused); + IRrecv irrecv(kGpioUnused); + irsend.begin(); + + // Simulate sending only two identical messages. + // This should succeed. + irsend.reset(); + irsend.sendEpson(0xC1AA09F6, kEpsonBits, 0); + irsend.sendEpson(0xC1AA09F6, kEpsonBits, 0); + + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(EPSON, irsend.capture.decode_type); + EXPECT_EQ(kEpsonBits, irsend.capture.bits); + EXPECT_EQ(0xC1AA09F6, irsend.capture.value); + EXPECT_EQ(0x5583, irsend.capture.address); + EXPECT_EQ(0x90, irsend.capture.command); + EXPECT_TRUE(irsend.capture.repeat); + + // Simulate sending a repeat but with a different code. + // This should fail. + irsend.reset(); + irsend.sendEpson(0xC1AA09F6, kEpsonBits, 0); // Valid code. + irsend.sendEpson(0x4BB640BF, kEpsonBits, 0); // Valid code but different. + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + ASSERT_NE(EPSON, irsend.capture.decode_type); +} + +TEST(TestUtils, Housekeeping) { + ASSERT_EQ("EPSON", typeToString(decode_type_t::EPSON)); + ASSERT_EQ(decode_type_t::EPSON, strToDecodeType("EPSON")); + ASSERT_FALSE(hasACState(decode_type_t::EPSON)); + ASSERT_FALSE(IRac::isProtocolSupported(decode_type_t::EPSON)); + ASSERT_EQ(kEpsonBits, IRsendTest::defaultBits(decode_type_t::EPSON)); + ASSERT_EQ(kEpsonMinRepeat, IRsendTest::minRepeats(decode_type_t::EPSON)); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Fujitsu_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Fujitsu_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Fujitsu_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Fujitsu_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_GICable_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_GICable_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_GICable_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_GICable_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_GlobalCache_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_GlobalCache_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_GlobalCache_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_GlobalCache_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Goodweather_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Goodweather_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Goodweather_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Goodweather_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Gree_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Gree_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Gree_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Gree_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Haier_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Haier_test.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/test/ir_Haier_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Haier_test.cpp index db824a28e..ee55d2866 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Haier_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Haier_test.cpp @@ -768,7 +768,8 @@ TEST(TestDecodeHaierAC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendHaierAC(expectedState); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeHaierAC(&irsend.capture, kHaierACBits, true)); + ASSERT_TRUE(irrecv.decodeHaierAC(&irsend.capture, kStartOffset, kHaierACBits, + true)); EXPECT_EQ(HAIER_AC, irsend.capture.decode_type); EXPECT_EQ(kHaierACBits, irsend.capture.bits); EXPECT_FALSE(irsend.capture.repeat); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Hitachi_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Hitachi_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Hitachi_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Hitachi_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Inax_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Inax_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Inax_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Inax_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_JVC_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_JVC_test.cpp similarity index 88% rename from lib/IRremoteESP8266-2.7.3/test/ir_JVC_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_JVC_test.cpp index 3cd99c3aa..51b16b82c 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_JVC_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_JVC_test.cpp @@ -110,7 +110,7 @@ TEST(TestDecodeJVC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendJVC(0xC2B8); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -122,7 +122,7 @@ TEST(TestDecodeJVC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendJVC(irsend.encodeJVC(0x07, 0x99)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0xE099, irsend.capture.value); @@ -134,7 +134,7 @@ TEST(TestDecodeJVC, NormalDecodeWithStrict) { irsend.reset(); irsend.sendJVC(irsend.encodeJVC(0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0x8080, irsend.capture.value); @@ -153,7 +153,7 @@ TEST(TestDecodeJVC, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendJVC(0xC2B8, kJvcBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -162,14 +162,14 @@ TEST(TestDecodeJVC, NormalDecodeWithRepeatAndStrict) { EXPECT_FALSE(irsend.capture.repeat); irsend.makeDecodeResult(2 * kJvcBits + 4); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); EXPECT_TRUE(irsend.capture.repeat); irsend.makeDecodeResult(2 * kJvcBits + 4 + 2 * kJvcBits + 2); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(kJvcBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -203,9 +203,9 @@ TEST(TestDecodeJVC, DecodeWithNonStrictValues) { irsend.sendJVC(0x0, 8); // Illegal value JVC 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -216,13 +216,13 @@ TEST(TestDecodeJVC, DecodeWithNonStrictValues) { irsend.sendJVC(0x12345678, 32); // Illegal value JVC 32-bit message. irsend.makeDecodeResult(); // Should not pass with strict when we ask for less bits than we got. - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kJvcBits, true)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -235,11 +235,12 @@ TEST(TestDecodeJVC, DecodeWithNonStrictValues) { irsend.makeDecodeResult(); // Shouldn't pass if strict off and the wrong expected bits. - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kJvcBits, false)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, + false)); // Re-decode with correct bit size. - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, 36, true)); - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, 36, false)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 36, true)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 36, false)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0x40C0, irsend.capture.value); @@ -258,7 +259,7 @@ TEST(TestDecodeJVC, Decode64BitMessages) { irsend.sendJVC(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeJVC(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(JVC, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -307,5 +308,6 @@ TEST(TestDecodeJVC, FailToDecodeNonJVCExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kJvcBits, false)); + ASSERT_FALSE(irrecv.decodeJVC(&irsend.capture, kStartOffset, kJvcBits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Kelvinator_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Kelvinator_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Kelvinator_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Kelvinator_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_LG_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_LG_test.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/test/ir_LG_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_LG_test.cpp index 1c2b2a856..703ea3c6c 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_LG_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_LG_test.cpp @@ -151,7 +151,7 @@ TEST(TestDecodeLG, NormalDecodeWithStrict) { irsend.reset(); irsend.sendLG(0x4B4AE51, kLgBits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLgBits, irsend.capture.bits); EXPECT_EQ(0x4B4AE51, irsend.capture.value); @@ -163,7 +163,7 @@ TEST(TestDecodeLG, NormalDecodeWithStrict) { irsend.reset(); irsend.sendLG(0xB4B4AE51, kLg32Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLg32Bits, false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, false)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLg32Bits, irsend.capture.bits); EXPECT_EQ(0xB4B4AE51, irsend.capture.value); @@ -175,7 +175,7 @@ TEST(TestDecodeLG, NormalDecodeWithStrict) { irsend.reset(); irsend.sendLG(irsend.encodeLG(0x07, 0x99)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLgBits, irsend.capture.bits); EXPECT_EQ(0x700992, irsend.capture.value); @@ -187,7 +187,7 @@ TEST(TestDecodeLG, NormalDecodeWithStrict) { irsend.reset(); irsend.sendLG(irsend.encodeLG(0x800, 0x8000), kLg32Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLg32Bits, irsend.capture.bits); EXPECT_EQ(0x80080008, irsend.capture.value); @@ -206,7 +206,7 @@ TEST(TestDecodeLG, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendLG(irsend.encodeLG(0x07, 0x99), kLgBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLgBits, irsend.capture.bits); EXPECT_EQ(0x700992, irsend.capture.value); @@ -218,7 +218,7 @@ TEST(TestDecodeLG, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendLG(irsend.encodeLG(0x07, 0x99), kLg32Bits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLg32Bits, irsend.capture.bits); EXPECT_EQ(0x700992, irsend.capture.value); @@ -238,19 +238,20 @@ TEST(TestDecodeLG, DecodeWithNonStrictValues) { irsend.reset(); irsend.sendLG(0x1); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, false)); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLgBits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, + false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, false)); // Illegal LG 32-bit message value. irsend.reset(); irsend.sendLG(0x1111111, kLg32Bits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLg32Bits, false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, false)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLg32Bits, irsend.capture.bits); EXPECT_EQ(0x1111111, irsend.capture.value); @@ -261,7 +262,7 @@ TEST(TestDecodeLG, DecodeWithNonStrictValues) { irsend.reset(); irsend.sendLG(0x1111111, kLg32Bits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, false)); } // Decode unsupported LG message sizes. @@ -276,13 +277,14 @@ TEST(TestDecodeLG, DecodeWithNonStrictSizes) { irsend.sendLG(irsend.encodeLG(0x07, 0x99), 16); irsend.makeDecodeResult(); // Should fail when unexpected against different bit sizes. - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, false)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, + false)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, 16, false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, 16, false)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(16, irsend.capture.bits); EXPECT_EQ(0x992, irsend.capture.value); @@ -294,12 +296,13 @@ TEST(TestDecodeLG, DecodeWithNonStrictSizes) { irsend.sendLG(0x123456789, 36); // Illegal value LG 36-bit message. irsend.makeDecodeResult(); // Should fail when unexpected against different bit sizes. - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, false)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLg32Bits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, + false)); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, 36, false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, 36, false)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0x123456789, irsend.capture.value); @@ -318,9 +321,9 @@ TEST(TestDecodeLG, Decode64BitMessages) { // Illegal value & size LG 64-bit message. irsend.sendLG(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, 64, true)); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -346,7 +349,7 @@ TEST(TestDecodeLG, DecodeGlobalCacheExample) { irsend.sendGC(gc_test, 75); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kLg32Bits, true)); + ASSERT_TRUE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLg32Bits, true)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(kLg32Bits, irsend.capture.bits); EXPECT_EQ(0xB4B4AE51, irsend.capture.value); @@ -371,7 +374,7 @@ TEST(TestDecodeLG, FailToDecodeNonLGExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeLG(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kLgBits, false)); + ASSERT_FALSE(irrecv.decodeLG(&irsend.capture, kStartOffset, kLgBits, false)); } // Tests for sendLG2(). @@ -451,6 +454,7 @@ TEST(TestDecodeLG, Issue620) { 532, 512, 530, 484, 556, 1536, 532}; // LG 8808721 irsend.sendRaw(rawData, 59, 38000); irsend.makeDecodeResult(); + ASSERT_TRUE(irrecv.decode(&irsend.capture)); EXPECT_EQ(LG, irsend.capture.decode_type); EXPECT_EQ(28, irsend.capture.bits); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Lasertag_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Lasertag_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Lasertag_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Lasertag_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Lego_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Lego_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Lego_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Lego_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Lutron_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Lutron_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Lutron_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Lutron_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_MWM_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_MWM_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_MWM_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_MWM_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Magiquest_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Magiquest_test.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/test/ir_Magiquest_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Magiquest_test.cpp index bbc5f3366..1e5faf5c0 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Magiquest_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Magiquest_test.cpp @@ -93,7 +93,8 @@ TEST(TestDecodeMagiQuest, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMagiQuest(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kMagiquestBits, true)); + ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kStartOffset, + kMagiquestBits, true)); EXPECT_EQ(MAGIQUEST, irsend.capture.decode_type); EXPECT_EQ(kMagiquestBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -104,7 +105,8 @@ TEST(TestDecodeMagiQuest, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMagiQuest(irsend.encodeMagiQuest(0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kMagiquestBits, true)); + ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kStartOffset, + kMagiquestBits, true)); EXPECT_EQ(MAGIQUEST, irsend.capture.decode_type); EXPECT_EQ(kMagiquestBits, irsend.capture.bits); EXPECT_EQ(0x10001, irsend.capture.value); @@ -115,7 +117,8 @@ TEST(TestDecodeMagiQuest, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMagiQuest(irsend.encodeMagiQuest(0x12345678, 0xABCD)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kMagiquestBits, true)); + ASSERT_TRUE(irrecv.decodeMagiQuest(&irsend.capture, kStartOffset, + kMagiquestBits, true)); EXPECT_EQ(MAGIQUEST, irsend.capture.decode_type); EXPECT_EQ(kMagiquestBits, irsend.capture.bits); EXPECT_EQ(0x12345678ABCD, irsend.capture.value); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Midea_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Midea_test.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/test/ir_Midea_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Midea_test.cpp index ebe291048..a43076fea 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Midea_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Midea_test.cpp @@ -478,7 +478,8 @@ TEST(TestDecodeMidea, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMidea(0x1234567890DF); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0x1234567890DF, irsend.capture.value); @@ -490,7 +491,8 @@ TEST(TestDecodeMidea, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMidea(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -502,7 +504,8 @@ TEST(TestDecodeMidea, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMidea(0xFFFFFFFFFFA0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFA0, irsend.capture.value); @@ -534,20 +537,23 @@ TEST(TestDecodeMidea, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendMidea(0xA18263FFFF6E, kMideaBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0xA18263FFFF6E, irsend.capture.value); EXPECT_FALSE(irsend.capture.repeat); irsend.makeDecodeResult(2 * (2 * kMideaBits + 4)); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0xA18263FFFF6E, irsend.capture.value); irsend.makeDecodeResult(4 * (2 * kMideaBits + 4)); - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(0xA18263FFFF6E, irsend.capture.value); @@ -563,9 +569,10 @@ TEST(TestDecodeMidea, DecodeWithNonStrictSizes) { irsend.sendMidea(0x12, 8); // Illegal value Midea 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x12, irsend.capture.value); @@ -574,13 +581,14 @@ TEST(TestDecodeMidea, DecodeWithNonStrictSizes) { irsend.sendMidea(0x12345678, 32); // Illegal value Midea 32-bit message. irsend.makeDecodeResult(); // Shouldn't pass with strict when we ask for less bits than we got. - ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kMideaBits, true)); + ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -589,7 +597,7 @@ TEST(TestDecodeMidea, DecodeWithNonStrictSizes) { irsend.reset(); irsend.sendMidea(0x123456, kMideaBits, 2); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, 9, false)); + ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kStartOffset, 9, false)); } // Decode (non-standard) 64-bit messages. @@ -603,7 +611,7 @@ TEST(TestDecodeMidea, Decode64BitMessages) { irsend.sendMidea(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -625,7 +633,8 @@ TEST(TestDecodeMidea, FailToDecodeNonMideaExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kMideaBits, false)); + ASSERT_FALSE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + false)); } // Decode against a real capture reported by a user. See issue #354 @@ -768,7 +777,8 @@ TEST(TestDecodeMidea, Issue887) { irsend.reset(); irsend.sendMidea(hwaddr); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeMidea(&irsend.capture, kMideaBits, false)); + EXPECT_TRUE(irrecv.decodeMidea(&irsend.capture, kStartOffset, kMideaBits, + false)); EXPECT_EQ(MIDEA, irsend.capture.decode_type); EXPECT_EQ(kMideaBits, irsend.capture.bits); EXPECT_EQ(hwaddr, irsend.capture.value); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_MitsubishiHeavy_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_MitsubishiHeavy_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_MitsubishiHeavy_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_MitsubishiHeavy_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Mitsubishi_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Mitsubishi_test.cpp similarity index 96% rename from lib/IRremoteESP8266-2.7.3/test/ir_Mitsubishi_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Mitsubishi_test.cpp index 8236777b5..4f759c046 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Mitsubishi_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Mitsubishi_test.cpp @@ -143,7 +143,8 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMitsubishi(0xC2B8); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(kMitsubishiBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -154,7 +155,8 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMitsubishi(0x0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(kMitsubishiBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -165,7 +167,8 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithStrict) { irsend.reset(); irsend.sendMitsubishi(0xFFFF); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(kMitsubishiBits, irsend.capture.bits); EXPECT_EQ(0xFFFF, irsend.capture.value); @@ -178,17 +181,24 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithStrict) { // 12 bits. irsend.sendMitsubishi(0xFFF, 12); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 12, true)); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 12, + true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 64, + true)); // 32 bits. irsend.sendMitsubishi(0xFFF, 32); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 12, true)); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 32, true)); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 12, + true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 32, + true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 64, + true)); } // Decode normal repeated Mitsubishi messages. @@ -201,7 +211,8 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendMitsubishi(0xC2B8, kMitsubishiBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(kMitsubishiBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -213,7 +224,8 @@ TEST(TestDecodeMitsubishi, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendMitsubishi(0xC2B8, kMitsubishiBits, 0); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(kMitsubishiBits, irsend.capture.bits); EXPECT_EQ(0xC2B8, irsend.capture.value); @@ -232,31 +244,36 @@ TEST(TestDecodeMitsubishi, DecodeWithNonStrictValues) { irsend.sendMitsubishi(0x0, 8); // Illegal sized Mitsubishi 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); EXPECT_EQ(0x0, irsend.capture.address); EXPECT_EQ(0x0, irsend.capture.command); - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 64, false)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 64, + false)); irsend.reset(); // Illegal sized Mitsubishi 64-bit message. irsend.sendMitsubishi(0xFEDCBA9876543210, 64); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, true)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, + kMitsubishiBits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 64, + false)); EXPECT_EQ(MITSUBISHI, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFEDCBA9876543210, irsend.capture.value); EXPECT_EQ(0x0, irsend.capture.address); EXPECT_EQ(0x0, irsend.capture.command); // Should fail when we are after a shorter message than we got. - ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, 8, false)); + ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, 8, + false)); } // Decode a 'real' example via GlobalCache @@ -299,7 +316,8 @@ TEST(TestDecodeMitsubishi, FailToDecodeNonMitsubishiExample) { ASSERT_FALSE(irrecv.decodeMitsubishi(&irsend.capture)); ASSERT_FALSE( - irrecv.decodeMitsubishi(&irsend.capture, kMitsubishiBits, false)); + irrecv.decodeMitsubishi(&irsend.capture, kStartOffset, kMitsubishiBits, + false)); } // Tests for Mitsubishi A/C methods. diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_NEC_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_NEC_test.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/test/ir_NEC_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_NEC_test.cpp index c881b7b44..f7598c981 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_NEC_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_NEC_test.cpp @@ -162,7 +162,7 @@ TEST(TestDecodeNEC, NormalNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x0); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, 32, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(kNECBits, irsend.capture.bits); EXPECT_EQ(0, irsend.capture.value); @@ -172,7 +172,7 @@ TEST(TestDecodeNEC, NormalNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x12345678); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, 32, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(kNECBits, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -189,7 +189,7 @@ TEST(TestDecodeNEC, ShortNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x0, 16); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, 16, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 16, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(16, irsend.capture.bits); EXPECT_EQ(0, irsend.capture.value); @@ -200,13 +200,13 @@ TEST(TestDecodeNEC, ShortNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x0, 32); irsend.makeDecodeResult(); - EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, 16, false)); + EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 16, false)); // Send 16 bits of data, but fail because we are expecting 17. irsend.reset(); irsend.sendNEC(0x0, 16); irsend.makeDecodeResult(); - EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, 17, false)); + EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 17, false)); } // Longer NEC-like messages (without strict naturally) @@ -218,7 +218,7 @@ TEST(TestDecodeNEC, LongerNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x1234567890ABCDEF, 64); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, 64, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0x1234567890ABCDEF, irsend.capture.value); @@ -229,7 +229,7 @@ TEST(TestDecodeNEC, LongerNECDecodeWithoutStrict) { irsend.reset(); irsend.sendNEC(0x0, 63); irsend.makeDecodeResult(); - EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, 64, false)); + EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 64, false)); } // Incorrect decoding reported in Issue #243 @@ -299,7 +299,7 @@ TEST(TestDecodeNEC, NonStrictNECDecode_Issue264) { irsend.sendRaw(rawData, 67, 38); irsend.makeDecodeResult(); EXPECT_FALSE(irrecv.decodeNEC(&irsend.capture)); // Not strictly NEC - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kNECBits, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, kNECBits, false)); EXPECT_EQ(0x77E1A040, irsend.capture.value); // Do it all again, but with a normal decode. @@ -331,7 +331,7 @@ TEST(TestDecodeNEC, AutoReceiveCalibration) { irsend.sendRaw(rawData, 67, 38); irsend.makeDecodeResult(); - EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kNECBits, false)); + EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, kNECBits, false)); EXPECT_EQ(NEC, irsend.capture.decode_type); EXPECT_EQ(kNECBits, irsend.capture.bits); EXPECT_EQ(0x77E1A040, irsend.capture.value); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Neoclima_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Neoclima_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Neoclima_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Neoclima_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Nikai_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Nikai_test.cpp similarity index 87% rename from lib/IRremoteESP8266-2.7.3/test/ir_Nikai_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Nikai_test.cpp index fff242326..98d6d806d 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Nikai_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Nikai_test.cpp @@ -77,7 +77,8 @@ TEST(TestDecodeNikai, NormalDecodeWithStrict) { irsend.reset(); irsend.sendNikai(0x123456); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, true)); + ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + true)); EXPECT_EQ(NIKAI, irsend.capture.decode_type); EXPECT_EQ(kNikaiBits, irsend.capture.bits); EXPECT_EQ(0x123456, irsend.capture.value); @@ -85,7 +86,8 @@ TEST(TestDecodeNikai, NormalDecodeWithStrict) { irsend.reset(); irsend.sendNikai(0x101); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, true)); + ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + true)); EXPECT_EQ(NIKAI, irsend.capture.decode_type); EXPECT_EQ(kNikaiBits, irsend.capture.bits); EXPECT_EQ(0x101, irsend.capture.value); @@ -101,7 +103,8 @@ TEST(TestDecodeNikai, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendNikai(0xD5F2A, kNikaiBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, true)); + ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + true)); EXPECT_EQ(NIKAI, irsend.capture.decode_type); EXPECT_EQ(kNikaiBits, irsend.capture.bits); EXPECT_EQ(0xD5F2A, irsend.capture.value); @@ -117,18 +120,20 @@ TEST(TestDecodeNikai, NormalDecodeWithNonStrict) { irsend.sendNikai(0x0, 16); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, true)); + ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + true)); // And it should fail when we expect more bits. - ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, false)); + ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + false)); // Should pass if strict off if we ask for correct nr. of bits sent. - ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, 16, false)); + ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kStartOffset, 16, false)); EXPECT_EQ(NIKAI, irsend.capture.decode_type); EXPECT_EQ(16, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); // Should fail as we are expecting less bits than there are. - ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, 12, false)); + ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kStartOffset, 12, false)); } // Decode (non-standard) 64-bit messages. @@ -142,9 +147,10 @@ TEST(TestDecodeNikai, Decode64BitMessages) { // Illegal size Nikai 64-bit message. irsend.sendNikai(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, true)); + ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + true)); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeNikai(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(NIKAI, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -211,5 +217,6 @@ TEST(TestDecodeNikai, FailToDecodeNonNikaiExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kNikaiBits, false)); + ASSERT_FALSE(irrecv.decodeNikai(&irsend.capture, kStartOffset, kNikaiBits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Panasonic_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Panasonic_test.cpp similarity index 95% rename from lib/IRremoteESP8266-2.7.3/test/ir_Panasonic_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Panasonic_test.cpp index 97f9bbb28..7f022ed17 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Panasonic_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Panasonic_test.cpp @@ -219,7 +219,8 @@ TEST(TestDecodePanasonic, NormalDecodeWithStrict) { irsend.reset(); irsend.sendPanasonic64(0x40040190ED7C); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); @@ -231,7 +232,8 @@ TEST(TestDecodePanasonic, NormalDecodeWithStrict) { irsend.reset(); irsend.sendPanasonic64(irsend.encodePanasonic(0x4004, 0x12, 0x34, 0x56)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x400412345670, irsend.capture.value); @@ -243,7 +245,8 @@ TEST(TestDecodePanasonic, NormalDecodeWithStrict) { irsend.reset(); irsend.sendPanasonic64(irsend.encodePanasonic(0x4004, 0x1, 0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x400401010101, irsend.capture.value); @@ -262,7 +265,8 @@ TEST(TestDecodePanasonic, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendPanasonic64(0x40040190ED7C, kPanasonicBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); @@ -271,13 +275,15 @@ TEST(TestDecodePanasonic, NormalDecodeWithRepeatAndStrict) { EXPECT_FALSE(irsend.capture.repeat); irsend.makeDecodeResult(2 * kPanasonicBits + 4); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); irsend.makeDecodeResult(2 * (2 * kPanasonicBits + 4)); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); @@ -293,9 +299,11 @@ TEST(TestDecodePanasonic, DecodeWithNonStrictValues) { irsend.sendPanasonic64(0x0); // Illegal value Panasonic 48-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, false)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, false)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -307,9 +315,11 @@ TEST(TestDecodePanasonic, DecodeWithNonStrictValues) { irsend.sendPanasonic64(irsend.encodePanasonic(0, 1, 2, 3)); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, false)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, false)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x1020300, irsend.capture.value); @@ -327,13 +337,14 @@ TEST(TestDecodePanasonic, DecodeWithNonStrictSize) { irsend.sendPanasonic64(0x12345678, 32); // Illegal size Panasonic message. irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -345,12 +356,14 @@ TEST(TestDecodePanasonic, DecodeWithNonStrictSize) { irsend.sendPanasonic64(irsend.encodePanasonic(0x4004, 1, 2, 3), 56); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); // Shouldn't pass if strict off and wrong bit size. - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, false)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, false)); // Re-decode with correct bit size. - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, 56, true)); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, 56, false)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 56, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 56, false)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(56, irsend.capture.bits); EXPECT_EQ(0x400401020300, irsend.capture.value); @@ -368,9 +381,9 @@ TEST(TestDecodePanasonic, Decode64BitMessages) { // Illegal value & size Panasonic 64-bit message. irsend.sendPanasonic64(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 64, true)); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -397,7 +410,8 @@ TEST(TestDecodePanasonic, DecodeGlobalCacheExample) { irsend.sendGC(gc_test, 103); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, true)); + ASSERT_TRUE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, true)); EXPECT_EQ(PANASONIC, irsend.capture.decode_type); EXPECT_EQ(kPanasonicBits, irsend.capture.bits); EXPECT_EQ(0x40040190ED7C, irsend.capture.value); @@ -430,7 +444,8 @@ TEST(TestDecodePanasonic, FailToDecodeNonPanasonicExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture)); - ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kPanasonicBits, false)); + ASSERT_FALSE(irrecv.decodePanasonic(&irsend.capture, kStartOffset, + kPanasonicBits, false)); } // Failing to decode Panasonic in Issue #245 diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Pioneer_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Pioneer_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Pioneer_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Pioneer_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Pronto_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Pronto_test.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/test/ir_Pronto_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Pronto_test.cpp index 513f985da..b5020987f 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Pronto_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Pronto_test.cpp @@ -366,3 +366,28 @@ TEST(TestSendPronto, NormalPlusRepeatSequence) { "m8892s2210m546s95212", irsend.outputStr()); } + +// Tests for #1034 +TEST(TestSendPronto, Issue1034) { + IRsendTest irsend(0); + IRrecv irrecv(0); + irsend.begin(); + + // JVC code allegedly. + uint16_t pronto_test[40] = { + 0x0000, 0x006c, 0x0001, 0x0011, 0x0140, 0x00a0, 0x0014, 0x003c, 0x0014, + 0x003c, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x003c, + 0x0014, 0x0014, 0x0014, 0x003c, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, + 0x0014, 0x0014, 0x0014, 0x0014, 0x003c, 0x0014, 0x0014, 0x0014, 0x0014, + 0x0014, 0x0014, 0x0014, 0x0384}; + + irsend.reset(); + irsend.sendPronto(pronto_test, 40, 1); + irsend.makeDecodeResult(); + EXPECT_TRUE(irrecv.decode(&irsend.capture)); + EXPECT_EQ(JVC, irsend.capture.decode_type); + EXPECT_EQ(kJvcBits, irsend.capture.bits); + EXPECT_EQ(0xc508, irsend.capture.value); + EXPECT_EQ(0xa3, irsend.capture.address); + EXPECT_EQ(0x10, irsend.capture.command); +} diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_RC5_RC6_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_RC5_RC6_test.cpp similarity index 88% rename from lib/IRremoteESP8266-2.7.3/test/ir_RC5_RC6_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_RC5_RC6_test.cpp index da9fa027c..0b46bad7f 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_RC5_RC6_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_RC5_RC6_test.cpp @@ -202,7 +202,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(0x175); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -214,7 +214,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(0x175); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -227,7 +227,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(0x175, kRC5XBits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -239,7 +239,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(irsend.encodeRC5(0x00, 0x0B, true)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x80B, irsend.capture.value); @@ -251,7 +251,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(irsend.encodeRC5X(0x02, 0x41, true), kRC5XBits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, true)); EXPECT_EQ(RC5X, irsend.capture.decode_type); EXPECT_EQ(kRC5XBits, irsend.capture.bits); EXPECT_EQ(0x1881, irsend.capture.value); @@ -264,7 +264,7 @@ TEST(TestDecodeRC5, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRC5(irsend.encodeRC5X(0x02, 0x41, true), kRC5XBits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); } // Decode normal repeated RC5 messages. @@ -277,7 +277,7 @@ TEST(TestDecodeRC5, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC5(0x174, kRC5Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x174, irsend.capture.value); @@ -288,7 +288,7 @@ TEST(TestDecodeRC5, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC5(0x175, kRC5Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(kRC5Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -299,7 +299,7 @@ TEST(TestDecodeRC5, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC5(irsend.encodeRC5X(0x02, 0x41, true), kRC5XBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, true)); EXPECT_EQ(RC5X, irsend.capture.decode_type); EXPECT_EQ(kRC5XBits, irsend.capture.bits); EXPECT_EQ(0x1881, irsend.capture.value); @@ -317,10 +317,11 @@ TEST(TestDecodeRC5, DecodeWithNonStrictValues) { irsend.sendRC5(0xFA, 8); // Illegal value RC5 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0xFA, irsend.capture.value); @@ -331,14 +332,15 @@ TEST(TestDecodeRC5, DecodeWithNonStrictValues) { irsend.sendRC5(0x12345678, 32); // Illegal size RC5 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(RC5, irsend.capture.decode_type); EXPECT_EQ(31, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -347,14 +349,15 @@ TEST(TestDecodeRC5, DecodeWithNonStrictValues) { irsend.sendRC5(0x87654321, 32); // Illegal size RC5 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, true)); - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5XBits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5XBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(RC5X, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x87654321, irsend.capture.value); @@ -371,7 +374,7 @@ TEST(TestDecodeRC5, Decode64BitMessages) { irsend.sendRC5(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeRC5(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(RC5X, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -392,7 +395,8 @@ TEST(TestDecodeRC5, FailToDecodeNonRC5Example) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kRC5Bits, false)); + ASSERT_FALSE(irrecv.decodeRC5(&irsend.capture, kStartOffset, kRC5Bits, + false)); } // RRRRRR CCCCC 666 @@ -688,7 +692,8 @@ TEST(TestDecodeRC6, NormalMode0DecodeWithStrict) { irsend.reset(); irsend.sendRC6(0x175); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6Mode0Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -700,7 +705,8 @@ TEST(TestDecodeRC6, NormalMode0DecodeWithStrict) { irsend.reset(); irsend.sendRC6(irsend.encodeRC6(0x1234567, 0x89, kRC6Mode0Bits)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6Mode0Bits, irsend.capture.bits); EXPECT_EQ(0x56789, irsend.capture.value); @@ -712,7 +718,8 @@ TEST(TestDecodeRC6, NormalMode0DecodeWithStrict) { irsend.reset(); irsend.sendRC6(0x123456789, kRC6Mode0Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6Mode0Bits, irsend.capture.bits); EXPECT_EQ(0x56789, irsend.capture.value); @@ -731,7 +738,8 @@ TEST(TestDecodeRC6, Normal36BitDecodeWithStrict) { irsend.reset(); irsend.sendRC6(0x175, kRC6_36Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6_36Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -743,7 +751,8 @@ TEST(TestDecodeRC6, Normal36BitDecodeWithStrict) { irsend.reset(); irsend.sendRC6(irsend.encodeRC6(0x1234567, 0x89, kRC6_36Bits), kRC6_36Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6_36Bits, irsend.capture.bits); EXPECT_EQ(0x123456789, irsend.capture.value); @@ -762,7 +771,8 @@ TEST(TestDecodeRC6, NormalMode0DecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC6(0x174, kRC6Mode0Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6Mode0Bits, irsend.capture.bits); EXPECT_EQ(0x174, irsend.capture.value); @@ -773,7 +783,8 @@ TEST(TestDecodeRC6, NormalMode0DecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC6(0x175, kRC6Mode0Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6Mode0Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -791,7 +802,8 @@ TEST(TestDecodeRC6, Normal36BitDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC6(0x175, kRC6_36Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6_36Bits, irsend.capture.bits); EXPECT_EQ(0x175, irsend.capture.value); @@ -802,7 +814,8 @@ TEST(TestDecodeRC6, Normal36BitDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendRC6(0x174, kRC6_36Bits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6_36Bits, irsend.capture.bits); EXPECT_EQ(0x174, irsend.capture.value); @@ -881,7 +894,7 @@ TEST(TestDecodeRC6, Decode36BitGlobalCacheExample) { irsend.sendGC(gc_test, 65); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits)); + ASSERT_TRUE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits)); EXPECT_EQ(RC6, irsend.capture.decode_type); EXPECT_EQ(kRC6_36Bits, irsend.capture.bits); EXPECT_EQ(0xC800F742A, irsend.capture.value); @@ -905,18 +918,26 @@ TEST(TestDecodeRC5, FailToDecodeNonRC6Example) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, false)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, false)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + false)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, kStartOffset, + false)); irsend.reset(); irsend.sendRC5(0x0); irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, true)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6Mode0Bits, false)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, true)); - ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, false)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + true)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6Mode0Bits, + false)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kStartOffset, kRC6_36Bits, + true)); + ASSERT_FALSE(irrecv.decodeRC6(&irsend.capture, kRC6_36Bits, kStartOffset, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_RCMM_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_RCMM_test.cpp similarity index 86% rename from lib/IRremoteESP8266-2.7.3/test/ir_RCMM_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_RCMM_test.cpp index 22306a59b..ef37d87a6 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_RCMM_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_RCMM_test.cpp @@ -91,7 +91,8 @@ TEST(TestDecodeRCMM, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRCMM(0xe0a600); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kRCMMBits, true)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, kRCMMBits, + true)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(kRCMMBits, irsend.capture.bits); EXPECT_EQ(0xe0a600, irsend.capture.value); @@ -103,7 +104,7 @@ TEST(TestDecodeRCMM, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRCMM(0x600, 12); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 12, true)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 12, true)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(12, irsend.capture.bits); EXPECT_EQ(0x600, irsend.capture.value); @@ -115,7 +116,7 @@ TEST(TestDecodeRCMM, NormalDecodeWithStrict) { irsend.reset(); irsend.sendRCMM(0x28e0a600, 32); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 32, true)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 32, true)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x28e0a600, irsend.capture.value); @@ -134,15 +135,15 @@ TEST(TestDecodeRCMM, IllegalDecodeWithStrict) { irsend.reset(); irsend.sendRCMM(0x0, 8); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, 8, true)); - ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, 12, true)); + ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 8, true)); + ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 12, true)); // Illegal RCMM 36-bit message. irsend.reset(); irsend.sendRCMM(0x0, 36); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, 12, true)); - ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, 36, true)); + ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 12, true)); + ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 36, true)); } // Decodes without strict mode. @@ -155,13 +156,13 @@ TEST(TestDecodeRCMM, DecodeWithoutStrict) { irsend.reset(); irsend.sendRCMM(0x55, 8); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x55, irsend.capture.value); EXPECT_EQ(0x0, irsend.capture.address); EXPECT_EQ(0x0, irsend.capture.command); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 12, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 12, false)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x55, irsend.capture.value); @@ -172,18 +173,18 @@ TEST(TestDecodeRCMM, DecodeWithoutStrict) { irsend.reset(); irsend.sendRCMM(0x123456789, 36); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 12, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 12, false)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0x123456789, irsend.capture.value); EXPECT_EQ(0x0, irsend.capture.address); EXPECT_EQ(0x0, irsend.capture.command); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 24, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 24, false)); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0x123456789, irsend.capture.value); EXPECT_EQ(0x0, irsend.capture.address); EXPECT_EQ(0x0, irsend.capture.command); - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 36, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 36, false)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0x123456789, irsend.capture.value); @@ -202,7 +203,7 @@ TEST(TestDecodeRCMM, Decode64BitMessages) { irsend.sendRCMM(0xFEDCBA9876543210, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(RCMM, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFEDCBA9876543210, irsend.capture.value); @@ -226,7 +227,8 @@ TEST(TestDecodeRCMM, FailToDecodeNonRCMMExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kRCMMBits, false)); + ASSERT_FALSE(irrecv.decodeRCMM(&irsend.capture, kStartOffset, kRCMMBits, + false)); } // Issue 281 Debugging diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Samsung_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Samsung_test.cpp similarity index 93% rename from lib/IRremoteESP8266-2.7.3/test/ir_Samsung_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Samsung_test.cpp index 9a572c631..c44572934 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Samsung_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Samsung_test.cpp @@ -107,7 +107,8 @@ TEST(TestDecodeSamsung, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSAMSUNG(0xE0E09966); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0xE0E09966, irsend.capture.value); @@ -118,7 +119,8 @@ TEST(TestDecodeSamsung, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSAMSUNG(irsend.encodeSAMSUNG(0x07, 0x99)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0xE0E09966, irsend.capture.value); @@ -129,7 +131,8 @@ TEST(TestDecodeSamsung, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSAMSUNG(irsend.encodeSAMSUNG(0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0x8080807F, irsend.capture.value); @@ -147,7 +150,8 @@ TEST(TestDecodeSamsung, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendSAMSUNG(0xE0E09966, kSamsungBits, 2); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0xE0E09966, irsend.capture.value); @@ -165,9 +169,11 @@ TEST(TestDecodeSamsung, DecodeWithNonStrictValues) { irsend.sendSAMSUNG(0x0); // Illegal value Samsung 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, false)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + false)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -178,9 +184,11 @@ TEST(TestDecodeSamsung, DecodeWithNonStrictValues) { irsend.sendSAMSUNG(0x12345678); // Illegal value Samsung 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, false)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + false)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(kSamsungBits, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -192,12 +200,14 @@ TEST(TestDecodeSamsung, DecodeWithNonStrictValues) { irsend.sendSAMSUNG(irsend.encodeSAMSUNG(0, 0), 36); irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); // Shouldn't pass if strict off and wrong expected bit size. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, false)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + false)); // Re-decode with correct bit size. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, 36, true)); - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, 36, false)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, 36, true)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, 36, false)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(36, irsend.capture.bits); EXPECT_EQ(0xFF, irsend.capture.value); // We told it to expect 8 bits less. @@ -214,7 +224,7 @@ TEST(TestDecodeSamsung, DecodeWithNonStrictValues) { ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, false)); // Should pass if strict off if we ask for correct nr. of bits sent. - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, 16, false)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, 16, false)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(16, irsend.capture.bits); EXPECT_EQ(0xFF, irsend.capture.value); // We told it to expect 4 bits less. @@ -222,7 +232,7 @@ TEST(TestDecodeSamsung, DecodeWithNonStrictValues) { EXPECT_EQ(0x00, irsend.capture.command); // Should fail as we are expecting less bits than there are. - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, 12, false)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, 12, false)); } // Decode (non-standard) 64-bit messages. @@ -236,9 +246,10 @@ TEST(TestDecodeSamsung, Decode64BitMessages) { // Illegal value & size Samsung 64-bit message. irsend.sendSAMSUNG(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, true)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + true)); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(SAMSUNG, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -289,7 +300,8 @@ TEST(TestDecodeSamsung, FailToDecodeNonSamsungExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kSamsungBits, false)); + ASSERT_FALSE(irrecv.decodeSAMSUNG(&irsend.capture, kStartOffset, kSamsungBits, + false)); } // General housekeeping @@ -451,6 +463,26 @@ TEST(TestIRSamsungAcClass, SetAndGetBeep) { EXPECT_TRUE(samsung.getBeep()); } +TEST(TestIRSamsungAcClass, SetAndGetDisplay) { + IRSamsungAc ac(0); + ac.setDisplay(true); + EXPECT_TRUE(ac.getDisplay()); + ac.setDisplay(false); + EXPECT_FALSE(ac.getDisplay()); + ac.setDisplay(true); + EXPECT_TRUE(ac.getDisplay()); +} + +TEST(TestIRSamsungAcClass, SetAndGetIon) { + IRSamsungAc ac(0); + ac.setIon(true); + EXPECT_TRUE(ac.getIon()); + ac.setIon(false); + EXPECT_FALSE(ac.getIon()); + ac.setIon(true); + EXPECT_TRUE(ac.getIon()); +} + TEST(TestIRSamsungAcClass, SetAndGetTemp) { IRSamsungAc samsung(0); samsung.setTemp(25); @@ -549,7 +581,8 @@ TEST(TestIRSamsungAcClass, SetAndGetPowerful) { EXPECT_EQ(kSamsungAcFanTurbo, ac.getFan()); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 7 (Turbo), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: On", ac.toString()); + "Beep: Off, Clean: Off, Quiet: Off, Powerful: On, Light: On, Ion: Off", + ac.toString()); uint8_t off[kSamsungAcStateLength] = { 0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, @@ -559,7 +592,8 @@ TEST(TestIRSamsungAcClass, SetAndGetPowerful) { EXPECT_NE(kSamsungAcFanTurbo, ac.getFan()); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", ac.toString()); + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", + ac.toString()); } TEST(TestIRSamsungAcClass, QuietAndPowerfulAreMutuallyExclusive) { @@ -624,7 +658,7 @@ TEST(TestIRSamsungAcClass, HumanReadable) { IRSamsungAc samsung(0); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 2 (Low), Swing: On, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); samsung.setTemp(kSamsungAcMaxTemp); samsung.setMode(kSamsungAcHeat); @@ -635,18 +669,24 @@ TEST(TestIRSamsungAcClass, HumanReadable) { samsung.setClean(true); EXPECT_EQ( "Power: Off, Mode: 4 (Heat), Temp: 30C, Fan: 5 (High), Swing: Off, " - "Beep: On, Clean: On, Quiet: Off, Powerful: Off", + "Beep: On, Clean: On, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); samsung.setQuiet(true); EXPECT_EQ( "Power: Off, Mode: 4 (Heat), Temp: 30C, Fan: 0 (Auto), Swing: Off, " - "Beep: On, Clean: On, Quiet: On, Powerful: Off", + "Beep: On, Clean: On, Quiet: On, Powerful: Off, Light: On, Ion: Off", samsung.toString()); samsung.setQuiet(false); samsung.setPowerful(true); EXPECT_EQ( "Power: Off, Mode: 4 (Heat), Temp: 30C, Fan: 7 (Turbo), Swing: Off, " - "Beep: On, Clean: On, Quiet: Off, Powerful: On", + "Beep: On, Clean: On, Quiet: Off, Powerful: On, Light: On, Ion: Off", + samsung.toString()); + samsung.setIon(true); + samsung.setDisplay(false); + EXPECT_EQ( + "Power: Off, Mode: 4 (Heat), Temp: 30C, Fan: 7 (Turbo), Swing: Off, " + "Beep: On, Clean: On, Quiet: Off, Powerful: On, Light: Off, Ion: On", samsung.toString()); } @@ -750,7 +790,7 @@ TEST(TestDecodeSamsungAC, DecodeRealExample) { samsung.setRaw(irsend.capture.state); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 2 (Low), Swing: On, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -799,7 +839,7 @@ TEST(TestDecodeSamsungAC, DecodeRealExample2) { samsung.setRaw(irsend.capture.state); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -858,7 +898,7 @@ TEST(TestDecodeSamsungAC, DecodePowerOnSample) { samsung.setRaw(irsend.capture.state, kSamsungAcExtendedStateLength); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 24C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -918,7 +958,7 @@ TEST(TestDecodeSamsungAC, DecodePowerOffSample) { samsung.setRaw(irsend.capture.state, kSamsungAcExtendedStateLength); EXPECT_EQ( "Power: Off, Mode: 1 (Cool), Temp: 24C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -965,7 +1005,7 @@ TEST(TestDecodeSamsungAC, DecodeHeatSample) { samsung.setRaw(irsend.capture.state); EXPECT_EQ( "Power: On, Mode: 4 (Heat), Temp: 17C, Fan: 0 (Auto), Swing: On, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -1012,7 +1052,7 @@ TEST(TestDecodeSamsungAC, DecodeCoolSample) { samsung.setRaw(irsend.capture.state); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 20C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -1070,7 +1110,7 @@ TEST(TestDecodeSamsungAC, Issue604DecodeExtended) { samsung.setRaw(irsend.capture.state, irsend.capture.bits / 8); EXPECT_EQ( "Power: Off, Mode: 4 (Heat), Temp: 30C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", samsung.toString()); } @@ -1267,7 +1307,7 @@ TEST(TestIRSamsungAcClass, Issue604SendPowerHack) { "m586s100000"; std::string text = "Power: On, Mode: 1 (Cool), Temp: 23C, Fan: 4 (Med), " "Swing: On, Beep: Off, Clean: Off, Quiet: Off, " - "Powerful: Off"; + "Powerful: Off, Light: On, Ion: Off"; // Don't do a setPower()/on()/off() as that will trigger the special message. // So it should only be the normal "settings" message. ac.setTemp(23); @@ -1328,6 +1368,8 @@ TEST(TestIRSamsungAcClass, toCommon) { ac.setBeep(true); ac.setClean(true); ac.setQuiet(true); + ac.setDisplay(true); + ac.setIon(true); // Now test it. ASSERT_EQ(decode_type_t::SAMSUNG_AC, ac.toCommon().protocol); ASSERT_EQ(-1, ac.toCommon().model); @@ -1339,13 +1381,13 @@ TEST(TestIRSamsungAcClass, toCommon) { ASSERT_EQ(stdAc::swingv_t::kAuto, ac.toCommon().swingv); ASSERT_FALSE(ac.toCommon().turbo); ASSERT_TRUE(ac.toCommon().quiet); + ASSERT_TRUE(ac.toCommon().light); + ASSERT_TRUE(ac.toCommon().filter); ASSERT_TRUE(ac.toCommon().clean); ASSERT_TRUE(ac.toCommon().beep); // Unsupported. ASSERT_EQ(stdAc::swingh_t::kOff, ac.toCommon().swingh); ASSERT_FALSE(ac.toCommon().econo); - ASSERT_FALSE(ac.toCommon().light); - ASSERT_FALSE(ac.toCommon().filter); ASSERT_EQ(-1, ac.toCommon().sleep); ASSERT_EQ(-1, ac.toCommon().clock); } @@ -1392,7 +1434,7 @@ TEST(TestDecodeSamsungAC, Issue734QuietSetting) { ac.setRaw(irsend.capture.state, irsend.capture.bits / 8); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: On, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: On, Powerful: Off, Light: On, Ion: Off", ac.toString()); // Make sure the ac class state is in something wildly different first. @@ -1414,7 +1456,7 @@ TEST(TestDecodeSamsungAC, Issue734QuietSetting) { ac.setQuiet(true); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: On, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: On, Powerful: Off, Light: On, Ion: Off", ac.toString()); // Check it matches the known good/expected state. EXPECT_STATE_EQ(expectedState, ac.getRaw(), kSamsungAcBits); @@ -1464,6 +1506,6 @@ TEST(TestDecodeSamsungAC, Issue734PowerfulOff) { ac.setRaw(irsend.capture.state, irsend.capture.bits / 8); EXPECT_EQ( "Power: On, Mode: 1 (Cool), Temp: 16C, Fan: 0 (Auto), Swing: Off, " - "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off", + "Beep: Off, Clean: Off, Quiet: Off, Powerful: Off, Light: On, Ion: Off", ac.toString()); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Sanyo_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Sanyo_test.cpp similarity index 81% rename from lib/IRremoteESP8266-2.7.3/test/ir_Sanyo_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Sanyo_test.cpp index 165e29f17..c59113cda 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Sanyo_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Sanyo_test.cpp @@ -71,7 +71,8 @@ TEST(TestDecodeSanyoLC7461, NormalDecodeWithStrict) { irsend.sendSanyoLC7461(0x1D8113F00FF); irsend.makeDecodeResult(); ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x1D8113F00FF, irsend.capture.value); @@ -84,7 +85,8 @@ TEST(TestDecodeSanyoLC7461, NormalDecodeWithStrict) { irsend.sendSanyoLC7461(irsend.encodeSanyoLC7461(0x1234, 0x56)); irsend.makeDecodeResult(); ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x2468DCB56A9, irsend.capture.value); @@ -97,7 +99,8 @@ TEST(TestDecodeSanyoLC7461, NormalDecodeWithStrict) { irsend.sendSanyoLC7461(irsend.encodeSanyoLC7461(0x1, 0x1)); irsend.makeDecodeResult(); ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x3FFE01FE, irsend.capture.value); @@ -117,7 +120,8 @@ TEST(TestDecodeSanyoLC7461, NormalDecodeWithRepeatAndStrict) { irsend.sendSanyoLC7461(0x3FFE01FE, kSanyoLC7461Bits, 1); irsend.makeDecodeResult(); ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x3FFE01FE, irsend.capture.value); @@ -137,10 +141,12 @@ TEST(TestDecodeSanyoLC7461, DecodeWithNonStrictValues) { irsend.makeDecodeResult(); // Should fail with strict on. ASSERT_FALSE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); // Should pass if strict off. ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, false)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + false)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -152,17 +158,22 @@ TEST(TestDecodeSanyoLC7461, DecodeWithNonStrictValues) { irsend.sendSanyoLC7461(0x1234567890A); irsend.makeDecodeResult(); ASSERT_FALSE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, 32, true)); - ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, 64, true)); + ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, 32, + true)); + ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, 64, + true)); // And should fail for a bad value. ASSERT_FALSE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); // Should pass if strict off. ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, false)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + false)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x1234567890A, irsend.capture.value); @@ -170,7 +181,8 @@ TEST(TestDecodeSanyoLC7461, DecodeWithNonStrictValues) { EXPECT_EQ(0x89, irsend.capture.command); // Shouldn't pass if strict off and looking for a smaller size. - ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, 34, false)); + ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, 34, + false)); } // Decode (non-standard) 64-bit messages. @@ -184,7 +196,8 @@ TEST(TestDecodeSanyoLC7461, Decode64BitMessages) { irsend.sendSanyoLC7461(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeSanyoLC7461(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, 64, + false)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -210,7 +223,8 @@ TEST(TestDecodeSanyoLC7461, DecodeGlobalCacheExample) { irsend.makeDecodeResult(); ASSERT_TRUE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, true)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + true)); EXPECT_EQ(SANYO_LC7461, irsend.capture.decode_type); EXPECT_EQ(kSanyoLC7461Bits, irsend.capture.bits); EXPECT_EQ(0x1D8113F00FF, irsend.capture.value); @@ -219,7 +233,7 @@ TEST(TestDecodeSanyoLC7461, DecodeGlobalCacheExample) { EXPECT_FALSE(irsend.capture.repeat); // Confirm what the 42-bit NEC decode is. - ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, 42, false)); + ASSERT_TRUE(irrecv.decodeNEC(&irsend.capture, kStartOffset, 42, false)); EXPECT_EQ(0x1D8113F00FF, irsend.capture.value); } @@ -240,5 +254,6 @@ TEST(TestDecodeSanyoLC7461, FailToDecodeNonSanyoLC7461Example) { ASSERT_FALSE(irrecv.decodeSanyoLC7461(&irsend.capture)); ASSERT_FALSE( - irrecv.decodeSanyoLC7461(&irsend.capture, kSanyoLC7461Bits, false)); + irrecv.decodeSanyoLC7461(&irsend.capture, kStartOffset, kSanyoLC7461Bits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Sharp_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Sharp_test.cpp similarity index 94% rename from lib/IRremoteESP8266-2.7.3/test/ir_Sharp_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Sharp_test.cpp index 571e59859..e605e0d05 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Sharp_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Sharp_test.cpp @@ -196,7 +196,8 @@ TEST(TestDecodeSharp, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSharpRaw(0x454A); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + EXPECT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(kSharpBits, irsend.capture.bits); EXPECT_EQ(0x454A, irsend.capture.value); @@ -208,7 +209,8 @@ TEST(TestDecodeSharp, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSharpRaw(irsend.encodeSharp(0x07, 0x99)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(kSharpBits, irsend.capture.bits); EXPECT_EQ(0x7266, irsend.capture.value); @@ -220,7 +222,8 @@ TEST(TestDecodeSharp, NormalDecodeWithStrict) { irsend.reset(); irsend.sendSharpRaw(irsend.encodeSharp(0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(kSharpBits, irsend.capture.bits); EXPECT_EQ(0x4202, irsend.capture.value); @@ -239,7 +242,8 @@ TEST(TestDecodeSharp, NormalDecodeWithRepeatAndStrict) { irsend.reset(); irsend.sendSharpRaw(0x7266, kSharpBits, 1); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(kSharpBits, irsend.capture.bits); EXPECT_EQ(0x7266, irsend.capture.value); @@ -247,7 +251,8 @@ TEST(TestDecodeSharp, NormalDecodeWithRepeatAndStrict) { EXPECT_EQ(0x99, irsend.capture.command); irsend.makeDecodeResult(2 * (2 * kSharpBits + kFooter)); - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(kSharpBits, irsend.capture.bits); EXPECT_EQ(0x7266, irsend.capture.value); @@ -263,9 +268,10 @@ TEST(TestDecodeSharp, DecodeWithNonStrict) { irsend.sendSharpRaw(0x0, 8); // Illegal length Sharp 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x0, irsend.capture.value); @@ -276,12 +282,13 @@ TEST(TestDecodeSharp, DecodeWithNonStrict) { irsend.sendSharpRaw(0x12345678, 32); // Illegal length Sharp 32-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kSharpBits, true)); + ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + true)); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, 32, true)); + ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kStartOffset, 32, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, 32, false)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, 32, false)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(32, irsend.capture.bits); EXPECT_EQ(0x12345678, irsend.capture.value); @@ -300,7 +307,7 @@ TEST(TestDecodeSharp, Decode64BitMessages) { irsend.sendSharpRaw(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeSharp(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(SHARP, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -350,7 +357,8 @@ TEST(TestDecodeSharp, FailToDecodeNonSharpExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kSharpBits, false)); + ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + false)); // Test only half of a good message, as it is sent (sort of) twice. uint16_t gc_half[35] = {38000, 1, 1, 10, 70, 10, 30, 10, 30, 10, 30, 10, @@ -361,7 +369,8 @@ TEST(TestDecodeSharp, FailToDecodeNonSharpExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kSharpBits, false)); + ASSERT_FALSE(irrecv.decodeSharp(&irsend.capture, kStartOffset, kSharpBits, + false)); } // https://github.com/crankyoldgit/IRremoteESP8266/issues/638#issue-421064165 diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Sherwood_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Sherwood_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Sherwood_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Sherwood_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Sony_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Sony_test.cpp similarity index 88% rename from lib/IRremoteESP8266-2.7.3/test/ir_Sony_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Sony_test.cpp index 18fc58334..c69d40e67 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Sony_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Sony_test.cpp @@ -193,7 +193,7 @@ TEST(TestDecodeSony, SonyDecodeWithUnexpectedLegalSize) { irsend.reset(); irsend.sendSony(irsend.encodeSony(kSony20Bits, 0x1, 0x1, 0x1)); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kSonyMinBits)); + ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSonyMinBits)); EXPECT_EQ(SONY, irsend.capture.decode_type); EXPECT_EQ(kSony20Bits, irsend.capture.bits); EXPECT_EQ(0x81080, irsend.capture.value); @@ -204,7 +204,7 @@ TEST(TestDecodeSony, SonyDecodeWithUnexpectedLegalSize) { irsend.reset(); irsend.sendSony(irsend.encodeSony(kSony12Bits, 21, 1), kSony12Bits); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kSony20Bits)); + ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits)); EXPECT_EQ(SONY, irsend.capture.decode_type); EXPECT_EQ(kSony12Bits, irsend.capture.bits); EXPECT_EQ(0xA90, irsend.capture.value); @@ -215,22 +215,28 @@ TEST(TestDecodeSony, SonyDecodeWithUnexpectedLegalSize) { irsend.reset(); irsend.sendSony(irsend.encodeSony(kSony12Bits, 21, 1), kSony12Bits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); // 15-bit message should be regected when using strict and a different size. irsend.reset(); irsend.sendSony(irsend.encodeSony(kSony15Bits, 21, 1), kSony15Bits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); // 20-bit message should be regected when using strict and a different size. irsend.reset(); irsend.sendSony(irsend.encodeSony(kSony20Bits, 1, 1, 1), kSony20Bits); irsend.makeDecodeResult(); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + ASSERT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); } // Decode unsupported Sony messages. i.e non-standard sizes. @@ -243,10 +249,14 @@ TEST(TestDecodeSony, SonyDecodeWithIllegalSize) { irsend.sendSony(0xFF, 8); // Illegal 8-bit Sony-like message. irsend.makeDecodeResult(); // Should fail with strict on. - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSonyMinBits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSonyMinBits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); // Should work with a 'normal' match (not strict) ASSERT_TRUE(irrecv.decode(&irsend.capture)); EXPECT_EQ(SONY, irsend.capture.decode_type); @@ -259,10 +269,14 @@ TEST(TestDecodeSony, SonyDecodeWithIllegalSize) { irsend.sendSony(0x1FFF, 13); // Illegal 13-bit Sony-like message. irsend.makeDecodeResult(); // Should fail with strict on. - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSonyMinBits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSonyMinBits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); // Should work with a 'normal' match (not strict) ASSERT_TRUE(irrecv.decode(&irsend.capture)); EXPECT_EQ(SONY, irsend.capture.decode_type); @@ -275,10 +289,14 @@ TEST(TestDecodeSony, SonyDecodeWithIllegalSize) { irsend.sendSony(0x1FFFF, 17); // Illegal 17-bit Sony-like message. irsend.makeDecodeResult(); // Should fail with strict on. - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSonyMinBits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSonyMinBits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); // Should work with a 'normal' match (not strict) ASSERT_TRUE(irrecv.decode(&irsend.capture)); EXPECT_EQ(SONY, irsend.capture.decode_type); @@ -291,10 +309,14 @@ TEST(TestDecodeSony, SonyDecodeWithIllegalSize) { irsend.sendSony(0x1FFFFF, 21); // Illegal 21-bit Sony-like message. irsend.makeDecodeResult(); // Should fail with strict on. - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSonyMinBits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony15Bits, true)); - EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kSony20Bits, true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSonyMinBits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony15Bits, + true)); + EXPECT_FALSE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony20Bits, + true)); // Should work with a 'normal' match (not strict) ASSERT_TRUE(irrecv.decode(&irsend.capture)); EXPECT_EQ(SONY, irsend.capture.decode_type); @@ -336,7 +358,8 @@ TEST(TestDecodeSony, DecodeGlobalCacheExample) { EXPECT_EQ(0x1, irsend.capture.address); EXPECT_EQ(0x2E, irsend.capture.command); // With strict and correct size. - ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kSony12Bits, true)); + ASSERT_TRUE(irrecv.decodeSony(&irsend.capture, kStartOffset, kSony12Bits, + true)); } // Encoding & Decode 20 bit Sony messages. Issue #476 diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Tcl_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Tcl_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Tcl_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Tcl_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Teco_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Teco_test.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/test/ir_Teco_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Teco_test.cpp index cb6c8bcd9..635e93a44 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Teco_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Teco_test.cpp @@ -353,7 +353,8 @@ TEST(TestDecodeTeco, NormalDecodeWithStrict) { irsend.reset(); irsend.sendTeco(expectedState); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeTeco(&irsend.capture, kTecoBits, true)); + ASSERT_TRUE(irrecv.decodeTeco(&irsend.capture, kStartOffset, kTecoBits, + true)); EXPECT_EQ(TECO, irsend.capture.decode_type); EXPECT_EQ(kTecoBits, irsend.capture.bits); EXPECT_FALSE(irsend.capture.repeat); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Toshiba_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Toshiba_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Toshiba_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Toshiba_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Trotec_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Trotec_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Trotec_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Trotec_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Vestel_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Vestel_test.cpp similarity index 99% rename from lib/IRremoteESP8266-2.7.3/test/ir_Vestel_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Vestel_test.cpp index 4164386f7..d20a882a6 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Vestel_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Vestel_test.cpp @@ -407,7 +407,8 @@ TEST(TestDecodeVestelAc, NormalDecodeWithStrict) { irsend.reset(); irsend.sendVestelAc(expectedState); irsend.makeDecodeResult(); - ASSERT_TRUE(irrecv.decodeVestelAc(&irsend.capture, kVestelAcBits, true)); + ASSERT_TRUE(irrecv.decodeVestelAc(&irsend.capture, kStartOffset, + kVestelAcBits, true)); EXPECT_EQ(VESTEL_AC, irsend.capture.decode_type); EXPECT_EQ(kVestelAcBits, irsend.capture.bits); EXPECT_FALSE(irsend.capture.repeat); diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Whirlpool_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Whirlpool_test.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/test/ir_Whirlpool_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Whirlpool_test.cpp diff --git a/lib/IRremoteESP8266-2.7.3/test/ir_Whynter_test.cpp b/lib/IRremoteESP8266-2.7.4/test/ir_Whynter_test.cpp similarity index 92% rename from lib/IRremoteESP8266-2.7.3/test/ir_Whynter_test.cpp rename to lib/IRremoteESP8266-2.7.4/test/ir_Whynter_test.cpp index 0c45f2654..eaccf0ea1 100644 --- a/lib/IRremoteESP8266-2.7.3/test/ir_Whynter_test.cpp +++ b/lib/IRremoteESP8266-2.7.4/test/ir_Whynter_test.cpp @@ -199,10 +199,11 @@ TEST(TestDecodeWhynter, DecodeWithNonStrictSizes) { irsend.sendWhynter(0x12, 8); // Illegal sized Whynter 8-bit message. irsend.makeDecodeResult(); // Should fail with strict on. - ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kWhynterBits, true)); - ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, 8, true)); + ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, kWhynterBits, + true)); + ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, 8, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, 8, false)); + ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, 8, false)); EXPECT_EQ(WHYNTER, irsend.capture.decode_type); EXPECT_EQ(8, irsend.capture.bits); EXPECT_EQ(0x12, irsend.capture.value); @@ -213,13 +214,14 @@ TEST(TestDecodeWhynter, DecodeWithNonStrictSizes) { irsend.sendWhynter(0x1234567890, 40); // Illegal size Whynter 40-bit message. irsend.makeDecodeResult(); // Shouldn't pass with strict when we ask for less bits than we got. - ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kWhynterBits, true)); + ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, kWhynterBits, + true)); irsend.makeDecodeResult(); // Should fail with strict when we ask for the wrong bit size. - ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, 40, true)); + ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, 40, true)); // Should pass if strict off. - ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, 40, false)); + ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, 40, false)); EXPECT_EQ(WHYNTER, irsend.capture.decode_type); EXPECT_EQ(40, irsend.capture.bits); EXPECT_EQ(0x1234567890, irsend.capture.value); @@ -238,7 +240,7 @@ TEST(TestDecodeWhynter, Decode64BitMessages) { irsend.sendWhynter(0xFFFFFFFFFFFFFFFF, 64); irsend.makeDecodeResult(); // Should work with a 'normal' match (not strict) - ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, 64, false)); + ASSERT_TRUE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, 64, false)); EXPECT_EQ(WHYNTER, irsend.capture.decode_type); EXPECT_EQ(64, irsend.capture.bits); EXPECT_EQ(0xFFFFFFFFFFFFFFFF, irsend.capture.value); @@ -262,5 +264,6 @@ TEST(TestDecodeWhynter, FailToDecodeNonWhynterExample) { irsend.makeDecodeResult(); ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture)); - ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kWhynterBits, false)); + ASSERT_FALSE(irrecv.decodeWhynter(&irsend.capture, kStartOffset, kWhynterBits, + false)); } diff --git a/lib/IRremoteESP8266-2.7.3/tools/Makefile b/lib/IRremoteESP8266-2.7.4/tools/Makefile similarity index 98% rename from lib/IRremoteESP8266-2.7.3/tools/Makefile rename to lib/IRremoteESP8266-2.7.4/tools/Makefile index 6868f97db..0ee8cc563 100644 --- a/lib/IRremoteESP8266-2.7.3/tools/Makefile +++ b/lib/IRremoteESP8266-2.7.4/tools/Makefile @@ -51,7 +51,7 @@ PROTOCOLS = ir_NEC.o ir_Sony.o ir_Samsung.o ir_JVC.o ir_RCMM.o ir_RC5_RC6.o \ ir_GICable.o ir_Whirlpool.o ir_Lutron.o ir_Electra.o ir_Pioneer.o \ ir_MWM.o ir_Vestel.o ir_Teco.o ir_Tcl.o ir_Lego.o \ ir_MitsubishiHeavy.o ir_Goodweather.o ir_Inax.o ir_Argo.o \ - ir_Trotec.o ir_Neoclima.o ir_Amcor.o + ir_Trotec.o ir_Neoclima.o ir_Amcor.o ir_Epson.o # Common object files COMMON_OBJ = IRutils.o IRtimer.o IRsend.o IRrecv.o IRtext.o IRac.o $(PROTOCOLS) @@ -234,5 +234,8 @@ ir_Neoclima.o : $(USER_DIR)/ir_Neoclima.cpp $(USER_DIR)/ir_Neoclima.h $(COMMON_D ir_Amcor.o : $(USER_DIR)/ir_Amcor.cpp $(USER_DIR)/ir_Amcor.h $(GTEST_HEADERS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Amcor.cpp +ir_Epson.o : $(USER_DIR)/ir_Epson.cpp $(GTEST_HEADERS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/ir_Epson.cpp + IRac.o : $(USER_DIR)/IRac.cpp $(USER_DIR)/IRac.h $(COMMON_DEPS) $(GTEST_HEADERS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c $(USER_DIR)/IRac.cpp diff --git a/lib/IRremoteESP8266-2.7.3/tools/RawToGlobalCache.sh b/lib/IRremoteESP8266-2.7.4/tools/RawToGlobalCache.sh similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/RawToGlobalCache.sh rename to lib/IRremoteESP8266-2.7.4/tools/RawToGlobalCache.sh diff --git a/lib/IRremoteESP8266-2.7.3/tools/auto_analyse_raw_data.py b/lib/IRremoteESP8266-2.7.4/tools/auto_analyse_raw_data.py similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/auto_analyse_raw_data.py rename to lib/IRremoteESP8266-2.7.4/tools/auto_analyse_raw_data.py diff --git a/lib/IRremoteESP8266-2.7.3/tools/auto_analyse_raw_data_test.py b/lib/IRremoteESP8266-2.7.4/tools/auto_analyse_raw_data_test.py similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/auto_analyse_raw_data_test.py rename to lib/IRremoteESP8266-2.7.4/tools/auto_analyse_raw_data_test.py diff --git a/lib/IRremoteESP8266-2.7.3/tools/gc_decode.cpp b/lib/IRremoteESP8266-2.7.4/tools/gc_decode.cpp similarity index 84% rename from lib/IRremoteESP8266-2.7.3/tools/gc_decode.cpp rename to lib/IRremoteESP8266-2.7.4/tools/gc_decode.cpp index a1d828d1c..f1c374bbe 100644 --- a/lib/IRremoteESP8266-2.7.3/tools/gc_decode.cpp +++ b/lib/IRremoteESP8266-2.7.4/tools/gc_decode.cpp @@ -27,18 +27,20 @@ void str_to_uint16(char *str, uint16_t *res, uint8_t base) { void usage_error(char *name) { std::cerr << "Usage: " << name << " [-gc] [-rawdump] " << std::endl - << "Usage: " << name << " -prontohex [-rawdump] " + << "Usage: " << name + << " -prontohex [-rawdump] [-repeats num] " << std::endl << "Usage: " << name << " -raw [-rawdump] " << std::endl; } int main(int argc, char *argv[]) { int argv_offset = 1; + int repeats = 0; bool dumpraw = false; enum decode_type_t input_type = GLOBALCACHE; const uint16_t raw_freq = 38; // Check the invocation/calling usage. - if (argc < 2 || argc > 4) { + if (argc < 2 || argc > 6) { usage_error(argv[0]); return 1; } @@ -52,11 +54,24 @@ int main(int argc, char *argv[]) { argv_offset++; } - if (strncmp("-rawdump", argv[argv_offset], 7) == 0) { + if (strncmp("-rawdump", argv[argv_offset], 8) == 0) { dumpraw = true; argv_offset++; } + if (input_type == PRONTO && strncmp("-repeats", argv[argv_offset], 8) == 0) { + argv_offset++; + if (argc - argv_offset <= 1) { + usage_error(argv[0]); + return 1; + } + repeats = atoi(argv[argv_offset++]); + if (repeats < 0) { + usage_error(argv[0]); + return 1; + } + } + if (argc - argv_offset != 1) { usage_error(argv[0]); return 1; @@ -80,8 +95,8 @@ int main(int argc, char *argv[]) { index++; } - IRsendTest irsend(4); - IRrecv irrecv(4); + IRsendTest irsend(0); + IRrecv irrecv(0); irsend.begin(); irsend.reset(); @@ -90,7 +105,7 @@ int main(int argc, char *argv[]) { irsend.sendGC(gc_test, index); break; case PRONTO: - irsend.sendPronto(gc_test, index); + irsend.sendPronto(gc_test, index, repeats); break; case RAW: irsend.sendRaw(gc_test, index, raw_freq); diff --git a/lib/IRremoteESP8266-2.7.3/tools/generate_irtext_h.sh b/lib/IRremoteESP8266-2.7.4/tools/generate_irtext_h.sh similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/generate_irtext_h.sh rename to lib/IRremoteESP8266-2.7.4/tools/generate_irtext_h.sh diff --git a/lib/IRremoteESP8266-2.7.3/tools/mkkeywords b/lib/IRremoteESP8266-2.7.4/tools/mkkeywords similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/mkkeywords rename to lib/IRremoteESP8266-2.7.4/tools/mkkeywords diff --git a/lib/IRremoteESP8266-2.7.3/tools/mode2_decode.cpp b/lib/IRremoteESP8266-2.7.4/tools/mode2_decode.cpp similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/mode2_decode.cpp rename to lib/IRremoteESP8266-2.7.4/tools/mode2_decode.cpp diff --git a/lib/IRremoteESP8266-2.7.3/tools/scrape_supported_devices.py b/lib/IRremoteESP8266-2.7.4/tools/scrape_supported_devices.py similarity index 100% rename from lib/IRremoteESP8266-2.7.3/tools/scrape_supported_devices.py rename to lib/IRremoteESP8266-2.7.4/tools/scrape_supported_devices.py diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index b304bf95b..ee767851a 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -4,6 +4,7 @@ - Change default my_user_config.h driver and sensor support removing most sensors and adding most drivers - Add support for Jarolift rollers by Keeloq algorithm +- Change IRremoteESP8266 library updated to v2.7.4 ### 8.1.0.9 20200220