├── IRMQTTServer ├── IRMQTTServer.h └── IRMQTTServer.ino ├── IRremoteESP8266-2.6.4 ├── .github │ ├── CONTRIBUTING.md │ ├── Contributors.md │ └── issue_template.md ├── .gitignore ├── .gitmodules ├── .style.yapf ├── .travis.yml ├── CPPLINT.cfg ├── LICENSE.txt ├── README.md ├── ReleaseNotes.md ├── SupportedProtocols.md ├── examples │ ├── ControlSamsungAC │ │ ├── ControlSamsungAC.ino │ │ └── platformio.ini │ ├── DumbIRRepeater │ │ ├── DumbIRRepeater.ino │ │ └── platformio.ini │ ├── IRGCSendDemo │ │ ├── IRGCSendDemo.ino │ │ └── platformio.ini │ ├── IRGCTCPServer │ │ ├── IRGCTCPServer.ino │ │ └── platformio.ini │ ├── IRMQTTServer │ │ ├── IRMQTTServer.h │ │ ├── IRMQTTServer.ino │ │ └── platformio.ini │ ├── IRServer │ │ ├── IRServer.ino │ │ └── platformio.ini │ ├── IRrecvDemo │ │ ├── IRrecvDemo.ino │ │ └── platformio.ini │ ├── IRrecvDump │ │ ├── IRrecvDump.ino │ │ └── platformio.ini │ ├── IRrecvDumpV2 │ │ ├── IRrecvDumpV2.ino │ │ └── platformio.ini │ ├── IRsendDemo │ │ ├── IRsendDemo.ino │ │ └── platformio.ini │ ├── IRsendProntoDemo │ │ ├── IRsendProntoDemo.ino │ │ └── platformio.ini │ ├── JVCPanasonicSendDemo │ │ ├── JVCPanasonicSendDemo.ino │ │ └── platformio.ini │ ├── LGACSend │ │ ├── LGACSend.ino │ │ └── platformio.ini │ ├── SmartIRRepeater │ │ ├── SmartIRRepeater.ino │ │ └── platformio.ini │ ├── TurnOnArgoAC │ │ ├── TurnOnArgoAC.ino │ │ └── platformio.ini │ ├── TurnOnDaikinAC │ │ ├── TurnOnDaikinAC.ino │ │ └── platformio.ini │ ├── TurnOnFujitsuAC │ │ ├── TurnOnFujitsuAC.ino │ │ └── platformio.ini │ ├── TurnOnKelvinatorAC │ │ ├── TurnOnKelvinatorAC.ino │ │ └── platformio.ini │ ├── TurnOnMitsubishiAC │ │ ├── TurnOnMitsubishiAC.ino │ │ └── platformio.ini │ ├── TurnOnMitsubishiHeavyAc │ │ ├── TurnOnMitsubishiHeavyAc.ino │ │ └── platformio.ini │ ├── TurnOnPanasonicAC │ │ ├── TurnOnPanasonicAC.ino │ │ └── platformio.ini │ ├── TurnOnToshibaAC │ │ ├── TurnOnToshibaAC.ino │ │ └── platformio.ini │ └── TurnOnTrotecAC │ │ ├── TurnOnTrotecAC.ino │ │ └── platformio.ini ├── keywords.txt ├── library.json ├── library.properties ├── platformio.ini ├── pylintrc ├── src │ ├── CPPLINT.cfg │ ├── IRac.cpp │ ├── IRac.h │ ├── IRrecv.cpp │ ├── IRrecv.h │ ├── IRremoteESP8266.h │ ├── IRsend.cpp │ ├── IRsend.h │ ├── IRtimer.cpp │ ├── IRtimer.h │ ├── IRutils.cpp │ ├── IRutils.h │ ├── ir_Aiwa.cpp │ ├── ir_Argo.cpp │ ├── ir_Argo.h │ ├── ir_Carrier.cpp │ ├── ir_Coolix.cpp │ ├── ir_Coolix.h │ ├── ir_Daikin.cpp │ ├── ir_Daikin.h │ ├── ir_Denon.cpp │ ├── ir_Dish.cpp │ ├── ir_Electra.cpp │ ├── ir_Electra.h │ ├── ir_Fujitsu.cpp │ ├── ir_Fujitsu.h │ ├── ir_GICable.cpp │ ├── ir_GlobalCache.cpp │ ├── ir_Goodweather.cpp │ ├── ir_Goodweather.h │ ├── ir_Gree.cpp │ ├── ir_Gree.h │ ├── ir_Haier.cpp │ ├── ir_Haier.h │ ├── ir_Hitachi.cpp │ ├── ir_Hitachi.h │ ├── ir_Inax.cpp │ ├── ir_JVC.cpp │ ├── ir_Kelvinator.cpp │ ├── ir_Kelvinator.h │ ├── ir_LG.cpp │ ├── ir_LG.h │ ├── ir_Lasertag.cpp │ ├── ir_Lego.cpp │ ├── ir_Lutron.cpp │ ├── ir_MWM.cpp │ ├── ir_Magiquest.cpp │ ├── ir_Magiquest.h │ ├── ir_Midea.cpp │ ├── ir_Midea.h │ ├── ir_Mitsubishi.cpp │ ├── ir_Mitsubishi.h │ ├── ir_MitsubishiHeavy.cpp │ ├── ir_MitsubishiHeavy.h │ ├── ir_NEC.cpp │ ├── ir_NEC.h │ ├── ir_Neoclima.cpp │ ├── ir_Neoclima.h │ ├── ir_Nikai.cpp │ ├── ir_Panasonic.cpp │ ├── ir_Panasonic.h │ ├── ir_Pioneer.cpp │ ├── ir_Pronto.cpp │ ├── ir_RC5_RC6.cpp │ ├── ir_RCMM.cpp │ ├── ir_Samsung.cpp │ ├── ir_Samsung.h │ ├── ir_Sanyo.cpp │ ├── ir_Sharp.cpp │ ├── ir_Sharp.h │ ├── ir_Sherwood.cpp │ ├── ir_Sony.cpp │ ├── ir_Tcl.cpp │ ├── ir_Tcl.h │ ├── ir_Teco.cpp │ ├── ir_Teco.h │ ├── ir_Toshiba.cpp │ ├── ir_Toshiba.h │ ├── ir_Trotec.cpp │ ├── ir_Trotec.h │ ├── ir_Vestel.cpp │ ├── ir_Vestel.h │ ├── ir_Whirlpool.cpp │ ├── ir_Whirlpool.h │ └── ir_Whynter.cpp ├── test │ ├── IRac_test.cpp │ ├── IRrecv_test.cpp │ ├── IRrecv_test.h │ ├── IRsend_test.cpp │ ├── IRsend_test.h │ ├── IRutils_test.cpp │ ├── Makefile │ ├── ir_Aiwa_test.cpp │ ├── ir_Argo_test.cpp │ ├── ir_Carrier_test.cpp │ ├── ir_Coolix_test.cpp │ ├── ir_Daikin_test.cpp │ ├── ir_Denon_test.cpp │ ├── ir_Dish_test.cpp │ ├── ir_Electra_test.cpp │ ├── ir_Fujitsu_test.cpp │ ├── ir_GICable_test.cpp │ ├── ir_GlobalCache_test.cpp │ ├── ir_Goodweather_test.cpp │ ├── ir_Gree_test.cpp │ ├── ir_Haier_test.cpp │ ├── ir_Hitachi_test.cpp │ ├── ir_Inax_test.cpp │ ├── ir_JVC_test.cpp │ ├── ir_Kelvinator_test.cpp │ ├── ir_LG_test.cpp │ ├── ir_Lasertag_test.cpp │ ├── ir_Lego_test.cpp │ ├── ir_Lutron_test.cpp │ ├── ir_MWM_test.cpp │ ├── ir_Magiquest_test.cpp │ ├── ir_Midea_test.cpp │ ├── ir_MitsubishiHeavy_test.cpp │ ├── ir_Mitsubishi_test.cpp │ ├── ir_NEC_test.cpp │ ├── ir_Neoclima_test.cpp │ ├── ir_Nikai_test.cpp │ ├── ir_Panasonic_test.cpp │ ├── ir_Pioneer_test.cpp │ ├── ir_Pronto_test.cpp │ ├── ir_RC5_RC6_test.cpp │ ├── ir_RCMM_test.cpp │ ├── ir_Samsung_test.cpp │ ├── ir_Sanyo_test.cpp │ ├── ir_Sharp_test.cpp │ ├── ir_Sherwood_test.cpp │ ├── ir_Sony_test.cpp │ ├── ir_Tcl_test.cpp │ ├── ir_Teco_test.cpp │ ├── ir_Toshiba_test.cpp │ ├── ir_Trotec_test.cpp │ ├── ir_Vestel_test.cpp │ ├── ir_Whirlpool_test.cpp │ └── ir_Whynter_test.cpp └── tools │ ├── Makefile │ ├── RawToGlobalCache.sh │ ├── auto_analyse_raw_data.py │ ├── auto_analyse_raw_data_test.py │ ├── gc_decode.cpp │ ├── mkkeywords │ ├── mode2_decode.cpp │ └── scrape_supported_devices.py ├── README.md ├── bom └── IRMQTT_POS.csv ├── fimware ├── IRMQTT-MINI.bin ├── IRMQTTServer.ino.generic.bin └── hkusb.bin ├── gerber ├── IRMQTT-B.Cu.gbr ├── IRMQTT-B.Mask.gbr ├── IRMQTT-B.Paste.gbr ├── IRMQTT-B.SilkS.gbr ├── IRMQTT-Edge.Cuts.gbr ├── IRMQTT-F.Cu.gbr ├── IRMQTT-F.Mask.gbr ├── IRMQTT-F.Paste.gbr ├── IRMQTT-F.SilkS.gbr ├── IRMQTT-NPTH.drl └── IRMQTT-PTH.drl ├── pcb.png ├── pic ├── DSC_4234.JPG ├── IRMQTT.html ├── Thumbs.db ├── irmqtt-mqtt.gif ├── irmqtt-ota.gif ├── irmqtt-stl.png ├── irmqtt-web.gif ├── irmqtt-wifi.gif ├── irmqtt.jpg └── pcb.jpg └── stl ├── IR-B v30.stl └── PIR v69.stl /IRremoteESP8266-2.6.4/.github/Contributors.md: -------------------------------------------------------------------------------- 1 | ## Contributors of this project 2 | ### Main contributors & maintainers 3 | - [Mark Szabo](https://github.com/markszabo/) : Initial IR sending on ESP8266 4 | - [Sébastien Warin](https://github.com/sebastienwarin/) (http://sebastien.warin.fr) : Initial IR receiving on ESP8266 5 | - [David Conran](https://github.com/crankyoldgit/) : ESP32 support and pretty much everything else. 6 | - [Roi Dayan](https://github.com/roidayan/) 7 | - [Marcos de Alcântara Marinho](https://github.com/marcosamarinho/) 8 | - [Massimiliano Pinto](https://github.com/pintomax/) 9 | - [Darsh Patel](https://github.com/darshkpatel/) 10 | - [Jonny Graham](https://github.com/jonnygraham/) 11 | - [Stu Fisher](https://github.com/stufisher/) 12 | - [Jorge Cisneros](https://github.com/jorgecis/) 13 | - [Denes Varga](https://github.com/denxhun/) 14 | - [Brett T. Warden](https://github.com/bwarden/) 15 | - [Fabien Valthier](https://github.com/hcoohb) 16 | - [Ajay Pala](https://github.com/ajaypala/) 17 | 18 | All contributors can be found on the [contributors site](https://github.com/crankyoldgit/IRremoteESP8266/graphs/contributors). 19 | 20 | ### Contributors of the [original project](https://github.com/z3t0/Arduino-IRremote) can be found on the [original project's contributors page](https://github.com/z3t0/Arduino-IRremote/blob/master/Contributors.md) 21 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | _(Please use this template for reporting issues. You can delete what ever is not relevant. Giving us this information will help us help you faster. Please also read the [FAQ](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Frequently-Asked-Questions) & [Troubleshooting Guide](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Troubleshooting-Guide). Your problem may already have an answer there.)_ 2 | 3 | ### Version/revision of the library used 4 | _Typically located in the `library.json` & `src/IRremoteESP8266.h` files in the root directory of the library. 5 | e.g. v2.0.0, or 'master' as at 1st of June, 2017. etc._ 6 | 7 | ### Expected behavior 8 | _What steps did you do and what should it have done?_ 9 | 10 | e.g. 11 | 1. Initialise the IRsend class. 12 | 2. IRsend.sendFoobar(0xdeadbeef); 13 | 3. Foobar branded BBQ turns on and cooks me some ribs. 14 | 15 | ### Actual behavior 16 | _What steps did you do, and what did or didn't actually happen?_ 17 | 18 | e.g. 19 | 1. Initialise the IRsend class. 20 | 2. IRsend.sendFoobar(0xdeadbeef); 21 | 3. Foobar BBQ went into Cow(er)-saving mode and fried me a couple of eggs instead. 22 | 23 | #### Output of raw data from IRrecvDumpV2.ino (if applicable) 24 | _Include some raw dumps of what the device saw._ 25 | 26 | ### Steps to reproduce the behavior 27 | _What can we do to (pref. reliably) repeat what is happening?_ 28 | 29 | #### Example code used 30 | _Include all relevant code snippets or links to the actual code files. Tip: [How to quote your code so it is still readable](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code)._ 31 | 32 | #### Circuit diagram and hardware used (if applicable) 33 | _Link to an image of the circuit diagram used. Part number of the IR receiver module etc. ESP8266 or ESP32 board type._ 34 | 35 | ### I have followed the steps in the [Troubleshooting Guide](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Troubleshooting-Guide) & read the [FAQ](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Frequently-Asked-Questions) 36 | _Yes/No._ 37 | 38 | ### Has this library/code previously worked as expected for you? 39 | _Yes/No. If "Yes", which version last worked for you?_ 40 | 41 | ### Other useful information 42 | _More information is always welcome. Be verbose._ 43 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/.gitignore: -------------------------------------------------------------------------------- 1 | #----------------------------------------# 2 | # .gitingore for IRremoteESP8266 library # 3 | #----------------------------------------# 4 | 5 | ### Files to ignore. 6 | 7 | ## Editors 8 | # vi/vim 9 | **/*.swp 10 | 11 | # vscode 12 | .vscode 13 | 14 | ## Build environments 15 | # Platformio 16 | **/.pio/ 17 | **/.pioenvs/ 18 | **/.piolibdeps/ 19 | **/.clang_complete 20 | **/.gcc-flags.json 21 | examples/**/lib 22 | examples/**/.travis.yml 23 | examples/**/.gitignore 24 | lib/readme.txt 25 | lib/googletest/**/* 26 | 27 | # GCC pre-compiled headers. 28 | **/*.gch 29 | 30 | # Python compiled files 31 | **/*.pyc 32 | 33 | # Unit Test builds 34 | test/*.o 35 | test/*.a 36 | test/*_test 37 | 38 | # Tools builds 39 | tools/*.o 40 | tools/*.a 41 | tools/gc_decode 42 | tools/mode2_decode 43 | 44 | .pioenvs 45 | .piolibdeps 46 | .clang_complete 47 | .gcc-flags.json 48 | 49 | #Cygwin builds 50 | *.exe 51 | 52 | # Mac extended attributes 53 | .DS_Store 54 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/googletest"] 2 | path = lib/googletest 3 | url = https://github.com/google/googletest.git 4 | branch = v1.8.x 5 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style: google 3 | indent_width: 2 4 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | env: 3 | - BD=esp8266:esp8266:nodemcuv2:xtal=80,eesz=4M3M,ip=lm2f,exception=disabled 4 | # - BD=esp8266:esp8266:d1_mini:xtal=80,eesz=4M3M,ip=lm2f,exception=disabled 5 | before_install: 6 | - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16" 7 | - sleep 3 8 | - export DISPLAY=:1.0 9 | - wget http://downloads.arduino.cc/arduino-1.8.8-linux64.tar.xz 10 | - tar xf arduino-1.8.8-linux64.tar.xz 11 | - sudo mv arduino-1.8.8 /usr/local/share/arduino 12 | - sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino 13 | - wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py 14 | install: 15 | - ln -s $PWD /usr/local/share/arduino/libraries/ 16 | - git clone https://github.com/tzapu/WiFiManager.git /usr/local/share/arduino/libraries/WiFiManager 17 | - git clone https://github.com/knolleary/pubsubclient.git /usr/local/share/arduino/libraries/PubSubClient 18 | - git clone https://github.com/bblanchon/ArduinoJson.git --branch 5.x /usr/local/share/arduino/libraries/ArduinoJson 19 | - arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs 20 | - arduino --install-boards esp8266:esp8266 21 | - arduino --board $BD --save-prefs 22 | - arduino --pref "compiler.warning_level=all" --save-prefs 23 | - sudo apt-get install jq 24 | - sudo apt-get purge python-enum34 25 | - sudo apt-get install pylint3 26 | script: echo Running checks 27 | notifications: 28 | email: 29 | on_success: change 30 | on_failure: change 31 | jobs: 32 | include: 33 | - script: 34 | # Check that everything compiles. (Part 1) 35 | - arduino --verify --board $BD $PWD/examples/IRrecvDemo/IRrecvDemo.ino 2> /dev/null 36 | - arduino --verify --board $BD $PWD/examples/IRGCSendDemo/IRGCSendDemo.ino 2> /dev/null 37 | - arduino --verify --board $BD $PWD/examples/IRGCTCPServer/IRGCTCPServer.ino 2> /dev/null 38 | - arduino --verify --board $BD $PWD/examples/IRServer/IRServer.ino 2> /dev/null 39 | - arduino --verify --board $BD $PWD/examples/IRrecvDumpV2/IRrecvDumpV2.ino 2> /dev/null 40 | - arduino --verify --board $BD $PWD/examples/IRsendDemo/IRsendDemo.ino 2> /dev/null 41 | - arduino --verify --board $BD $PWD/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino 2> /dev/null 42 | - arduino --verify --board $BD $PWD/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino 2> /dev/null 43 | - arduino --verify --board $BD $PWD/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino 2> /dev/null 44 | - arduino --verify --board $BD $PWD/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino 2> /dev/null 45 | - arduino --verify --board $BD $PWD/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino 2> /dev/null 46 | - script: 47 | # Check that everything compiles. (Part 2) 48 | - arduino --verify --board $BD $PWD/examples/IRsendProntoDemo/IRsendProntoDemo.ino 2> /dev/null 49 | - arduino --verify --board $BD $PWD/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino 2> /dev/null 50 | - arduino --verify --board $BD $PWD/examples/LGACSend/LGACSend.ino 2> /dev/null 51 | - arduino --verify --board $BD $PWD/examples/TurnOnArgoAC/TurnOnArgoAC.ino 2> /dev/null 52 | - arduino --verify --board $BD $PWD/examples/IRMQTTServer/IRMQTTServer.ino 2> /dev/null 53 | - arduino --verify --board $BD $PWD/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino 2> /dev/null 54 | - arduino --verify --board $BD $PWD/examples/ControlSamsungAC/ControlSamsungAC.ino 2> /dev/null 55 | - arduino --verify --board $BD $PWD/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino 2> /dev/null 56 | - arduino --verify --board $BD $PWD/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino 2> /dev/null 57 | - arduino --verify --board $BD $PWD/examples/DumbIRRepeater/DumbIRRepeater.ino 2> /dev/null 58 | - arduino --verify --board $BD $PWD/examples/SmartIRRepeater/SmartIRRepeater.ino 2> /dev/null 59 | - script: 60 | # Check the version numbers match. 61 | - LIB_VERSION=$(egrep "^#define\s+_IRREMOTEESP8266_VERSION_\s+" src/IRremoteESP8266.h | cut -d\" -f2) 62 | - test ${LIB_VERSION} == "$(jq -r .version library.json)" 63 | - grep -q "^version=${LIB_VERSION}$" library.properties 64 | # Check the tools programs compile. 65 | - (cd tools; make all) 66 | # Check for lint issues. 67 | - shopt -s nullglob 68 | - python cpplint.py --extensions=c,cc,cpp,ino --headers=h,hpp {src,test,tools}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino} 69 | - pylint3 -d F0001 {src,test,tools}/*.py 70 | - shopt -u nullglob 71 | # Build and run the unit tests. 72 | - (cd test; make run) 73 | - (cd tools; make run_tests) 74 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | set noparent 2 | root=src 3 | linelength=80 4 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/ControlSamsungAC/ControlSamsungAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRSamsungAc ac(kIrLed); // Set the GPIO used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Samsung A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | } 39 | 40 | void setup() { 41 | ac.begin(); 42 | Serial.begin(115200); 43 | delay(200); 44 | 45 | // Set up what we want to send. See ir_Samsung.cpp for all the options. 46 | Serial.println("Default state of the remote."); 47 | printState(); 48 | Serial.println("Setting initial state for A/C."); 49 | ac.off(); 50 | ac.setFan(kSamsungAcFanLow); 51 | ac.setMode(kSamsungAcCool); 52 | ac.setTemp(25); 53 | ac.setSwing(false); 54 | printState(); 55 | } 56 | 57 | void loop() { 58 | // Turn the A/C unit on 59 | Serial.println("Turn on the A/C ..."); 60 | ac.on(); 61 | ac.send(); 62 | printState(); 63 | delay(15000); // wait 15 seconds 64 | // and set to cooling mode. 65 | Serial.println("Set the A/C mode to cooling ..."); 66 | ac.setMode(kSamsungAcCool); 67 | ac.send(); 68 | printState(); 69 | delay(15000); // wait 15 seconds 70 | 71 | // Increase the fan speed. 72 | Serial.println("Set the fan to high and the swing on ..."); 73 | ac.setFan(kSamsungAcFanHigh); 74 | ac.setSwing(true); 75 | ac.send(); 76 | printState(); 77 | delay(15000); 78 | 79 | // Change to Fan mode, lower the speed, and stop the swing. 80 | Serial.println("Set the A/C to fan only with a low speed, & no swing ..."); 81 | ac.setSwing(false); 82 | ac.setMode(kSamsungAcFan); 83 | ac.setFan(kSamsungAcFanLow); 84 | ac.send(); 85 | printState(); 86 | delay(15000); 87 | 88 | // Turn the A/C unit off. 89 | Serial.println("Turn off the A/C ..."); 90 | ac.off(); 91 | ac.send(); 92 | printState(); 93 | delay(15000); // wait 15 seconds 94 | } 95 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/ControlSamsungAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/DumbIRRepeater/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRGCSendDemo/IRGCSendDemo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRsendGCDemo 3 | * demonstrates sending Global Cache-formatted IR codes with IRsend 4 | * Copyright 2009 Ken Shirriff 5 | * http://arcfn.com 6 | * 7 | * Version 0.2 June, 2017 8 | * Added helpful comments 9 | * Better includes files. 10 | * Version 0.1 30 March, 2016 11 | * Based on Ken Shirriff's IrsendDemo 12 | * Version 0.1 July, 2009 13 | * 14 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 15 | * as specified by IR_LED below. 16 | * 17 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 18 | * 19 | * Suggested circuit: 20 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 21 | * 22 | * Common mistakes & tips: 23 | * * Don't just connect the IR LED directly to the pin, it won't 24 | * have enough current to drive the IR LED effectively. 25 | * * Make sure you have the IR LED polarity correct. 26 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 27 | * * Typical digital camera/phones can be used to see if the IR LED is 28 | * flashed. Replace the IR LED with a normal LED if you don't have a digital 29 | * camera when debugging. 30 | * * Avoid using the following pins unless you really know what you are doing: 31 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 32 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will 33 | * interfere. 34 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 35 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 36 | * for your first time. e.g. ESP-12 etc. 37 | */ 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | // Codes are in Global Cache format less the emitter ID and request ID. 44 | // These codes can be found in GC's Control Tower database. 45 | 46 | uint16_t Samsung_power_toggle[71] = { 47 | 38000, 1, 1, 170, 170, 20, 63, 20, 63, 20, 63, 20, 20, 20, 20, 48 | 20, 20, 20, 20, 20, 20, 20, 63, 20, 63, 20, 63, 20, 20, 20, 49 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 63, 20, 20, 20, 20, 50 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 63, 20, 20, 20, 63, 20, 51 | 63, 20, 63, 20, 63, 20, 63, 20, 63, 20, 1798}; 52 | 53 | #define IR_LED 4 // ESP8266 GPIO pin to use. Recommended: 4 (D2). 54 | 55 | IRsend irsend(IR_LED); // Set the GPIO to be used to sending the message. 56 | 57 | void setup() { 58 | irsend.begin(); 59 | Serial.begin(115200); 60 | } 61 | 62 | void loop() { 63 | Serial.println("Toggling power"); 64 | #if SEND_GLOBALCACHE 65 | irsend.sendGC(Samsung_power_toggle, 71); 66 | #else // SEND_GLOBALCACHE 67 | Serial.println("Can't send because SEND_GLOBALCACHE has been disabled."); 68 | #endif // SEND_GLOBALCACHE 69 | delay(10000); 70 | } 71 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRGCSendDemo/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRGCTCPServer/IRGCTCPServer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRGCTCPServer - send Global Cache-formatted codes via TCP. 3 | * An IR emitter must be connected to GPIO pin 4. 4 | * Version 0.2 May, 2017 5 | * Copyright 2016 Hisham Khalifa, http://www.hishamkhalifa.com 6 | * Copyright 2017 David Conran 7 | * 8 | * Example command - Samsung TV power toggle: 38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798\r\n 9 | * For more codes, visit: https://irdb.globalcache.com/ 10 | * 11 | * How to use this program: 12 | * 1) Update "kSsid" and "kPassword" below for your WIFI network. 13 | * 2) Compile and upload the sketch to your ESP8266 module. 14 | * 3) (Optional) Use the serial connection to confirm it started and get the 15 | * IP address. 16 | * 4) From a client machine, connect to port 4998 on the ESP8266, using 17 | * 'telnet', 'nc' (netcat), 'putty' or similar command, etc. 18 | * You may need to install one. 19 | * Unix/OSX: 20 | * Start a shell. Then type: 21 | * telnet 4998 22 | * Windows: 23 | * Start a new CMD window, then type: 24 | * telnet 4998 25 | * 26 | * 5) Enter a Global Cache-formatted code, starting at the frequency, 27 | * and then a return/enter at the end. No spaces. e.g.: 28 | * 29 | * 38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798 30 | * 31 | * To exit the 'telnet' command: 32 | * press + <]> at the same time, then press 'q', and then . 33 | * or: 34 | * + might work. 35 | * 36 | * This program will display the ESP's IP address on the serial console, or you 37 | * can check your wifi router for it's address. 38 | */ 39 | 40 | #include 41 | #if defined(ESP8266) 42 | #include 43 | #endif // ESP8266 44 | #if defined(ESP32) 45 | #include 46 | #endif // ESP32 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | const char* kSsid = "..."; // Put your WIFI SSID here. 53 | const char* kPassword = "..."; // Put your WIFI Password here. 54 | 55 | WiFiServer server(4998); // Uses port 4998. 56 | WiFiClient client; 57 | 58 | uint16_t *code_array; 59 | #define IR_LED 4 // ESP8266 GPIO pin to use. Recommended: 4 (D2). 60 | 61 | IRsend irsend(IR_LED); // Set the GPIO to be used to sending the message. 62 | 63 | void sendGCString(String str) { 64 | int16_t index; 65 | uint16_t count; 66 | 67 | // Find out how many items there are in the string. 68 | index = -1; 69 | count = 1; 70 | do { 71 | index = str.indexOf(',', index + 1); 72 | count++; 73 | } while (index != -1); 74 | 75 | // Now we know how many there are, allocate the memory to store them all. 76 | code_array = reinterpret_cast(malloc(count * sizeof(uint16_t))); 77 | // Check we malloc'ed successfully. 78 | if (code_array == NULL) { // malloc failed, so give up. 79 | Serial.printf("\nCan't allocate %d bytes. (%d bytes free)\n", 80 | count * sizeof(uint16_t), ESP.getFreeHeap()); 81 | Serial.println("Giving up & forcing a reboot."); 82 | ESP.restart(); // Reboot. 83 | delay(500); // Wait for the restart to happen. 84 | return; // Should never get here, but just in case. 85 | } 86 | 87 | // Now convert the strings to integers and place them in code_array. 88 | count = 0; 89 | uint16_t start_from = 0; 90 | do { 91 | index = str.indexOf(',', start_from); 92 | code_array[count] = str.substring(start_from, index).toInt(); 93 | start_from = index + 1; 94 | count++; 95 | } while (index != -1); 96 | 97 | #if SEND_GLOBALCACHE 98 | irsend.sendGC(code_array, count); // All done. Send it. 99 | #endif // SEND_GLOBALCACHE 100 | free(code_array); // Free up the memory allocated. 101 | } 102 | 103 | void setup() { 104 | // initialize serial: 105 | Serial.begin(115200); 106 | delay(100); 107 | Serial.println(" "); 108 | Serial.println("IR TCP Server"); 109 | WiFi.begin(kSsid, kPassword); 110 | while (WiFi.status() != WL_CONNECTED) { 111 | delay(900); 112 | Serial.print("."); 113 | } 114 | 115 | server.begin(); 116 | IPAddress myAddress = WiFi.localIP(); 117 | Serial.println(myAddress.toString()); 118 | irsend.begin(); 119 | } 120 | 121 | void loop() { 122 | while (!client) 123 | client = server.available(); 124 | 125 | while (!client.connected()) { 126 | delay(900); 127 | client = server.available(); 128 | } 129 | 130 | if (client.available()) { 131 | String ir_code_str = client.readStringUntil('\r'); // Exclusive of \r 132 | client.readStringUntil('\n'); // Skip new line as well 133 | client.flush(); 134 | sendGCString(ir_code_str); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRGCTCPServer/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRMQTTServer/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = -DMQTT_MAX_PACKET_SIZE=768 9 | 10 | [common] 11 | lib_deps_builtin = 12 | lib_deps_external = 13 | PubSubClient 14 | ArduinoJson@<6.0 15 | 16 | [common_esp8266] 17 | lib_deps_external = 18 | ${common.lib_deps_builtin} 19 | ${common.lib_deps_external} 20 | WifiManager@>=0.14 21 | 22 | [common_esp32] 23 | lib_deps_external = 24 | ${common.lib_deps_builtin} 25 | ${common.lib_deps_external} 26 | https://github.com/tzapu/WiFiManager.git#development 27 | 28 | [env:nodemcuv2] 29 | platform = espressif8266 30 | framework = arduino 31 | board = nodemcuv2 32 | lib_deps = ${common_esp8266.lib_deps_external} 33 | 34 | [env:d1_mini] 35 | platform = espressif8266 36 | framework = arduino 37 | board = d1_mini 38 | lib_deps = ${common_esp8266.lib_deps_external} 39 | 40 | [env:d1_mini_no_mqtt] 41 | platform = espressif8266 42 | framework = arduino 43 | board = d1_mini 44 | build_flags = 45 | ${env.build_flags} 46 | -DMQTT_ENABLE=false 47 | lib_deps = ${common_esp8266.lib_deps_external} 48 | 49 | [env:esp32dev] 50 | platform = espressif32 51 | framework = arduino 52 | board = esp32dev 53 | lib_deps = ${common_esp32.lib_deps_external} 54 | 55 | [env:esp01_1m] 56 | platform = espressif8266 57 | framework = arduino 58 | board = esp01_1m 59 | build_flags = 60 | ${env.build_flags} 61 | -Wl,-Teagle.flash.1m64.ld 62 | lib_deps = ${common_esp8266.lib_deps_external} 63 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRServer/IRServer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRServer - demonstrates sending IR codes controlled from a webserver 3 | * Version 0.3 May, 2019 4 | * Version 0.2 June, 2017 5 | * Copyright 2015 Mark Szabo 6 | * Copyright 2019 David Conran 7 | * 8 | * An IR LED circuit *MUST* be connected to the ESP on a pin 9 | * as specified by kIrLed below. 10 | * 11 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 12 | * 13 | * Suggested circuit: 14 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 15 | * 16 | * Common mistakes & tips: 17 | * * Don't just connect the IR LED directly to the pin, it won't 18 | * have enough current to drive the IR LED effectively. 19 | * * Make sure you have the IR LED polarity correct. 20 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 21 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 22 | * Replace the IR LED with a normal LED if you don't have a digital camera 23 | * when debugging. 24 | * * Avoid using the following pins unless you really know what you are doing: 25 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 26 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 27 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 28 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 29 | * for your first time. e.g. ESP-12 etc. 30 | */ 31 | #include 32 | #if defined(ESP8266) 33 | #include 34 | #include 35 | #include 36 | #endif // ESP8266 37 | #if defined(ESP32) 38 | #include 39 | #include 40 | #include 41 | #endif // ESP32 42 | #include 43 | #include 44 | #include 45 | 46 | const char* kSsid = "....."; 47 | const char* kPassword = "....."; 48 | MDNSResponder mdns; 49 | 50 | #if defined(ESP8266) 51 | ESP8266WebServer server(80); 52 | #undef HOSTNAME 53 | #define HOSTNAME "esp8266" 54 | #endif // ESP8266 55 | #if defined(ESP32) 56 | WebServer server(80); 57 | #undef HOSTNAME 58 | #define HOSTNAME "esp32" 59 | #endif // ESP32 60 | 61 | const uint16_t kIrLed = 4; // ESP GPIO pin to use. Recommended: 4 (D2). 62 | 63 | IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message. 64 | 65 | void handleRoot() { 66 | server.send(200, "text/html", 67 | "" \ 68 | "" HOSTNAME " Demo" \ 69 | "" \ 70 | "

Hello from " HOSTNAME ", you can send NEC encoded IR" \ 71 | "signals from here!

" \ 72 | "

Send 0xFFE01F

" \ 73 | "

Send 0xFAB123

" \ 74 | "

Send 0xFFE896

" \ 75 | "" \ 76 | ""); 77 | } 78 | 79 | void handleIr() { 80 | for (uint8_t i = 0; i < server.args(); i++) { 81 | if (server.argName(i) == "code") { 82 | uint32_t code = strtoul(server.arg(i).c_str(), NULL, 10); 83 | #if SEND_NEC 84 | irsend.sendNEC(code, 32); 85 | #endif // SEND_NEC 86 | } 87 | } 88 | handleRoot(); 89 | } 90 | 91 | void handleNotFound() { 92 | String message = "File Not Found\n\n"; 93 | message += "URI: "; 94 | message += server.uri(); 95 | message += "\nMethod: "; 96 | message += (server.method() == HTTP_GET)?"GET":"POST"; 97 | message += "\nArguments: "; 98 | message += server.args(); 99 | message += "\n"; 100 | for (uint8_t i = 0; i < server.args(); i++) 101 | message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; 102 | server.send(404, "text/plain", message); 103 | } 104 | 105 | void setup(void) { 106 | irsend.begin(); 107 | 108 | Serial.begin(115200); 109 | WiFi.begin(kSsid, kPassword); 110 | Serial.println(""); 111 | 112 | // Wait for connection 113 | while (WiFi.status() != WL_CONNECTED) { 114 | delay(500); 115 | Serial.print("."); 116 | } 117 | Serial.println(""); 118 | Serial.print("Connected to "); 119 | Serial.println(kSsid); 120 | Serial.print("IP address: "); 121 | Serial.println(WiFi.localIP().toString()); 122 | 123 | #if defined(ESP8266) 124 | if (mdns.begin(HOSTNAME, WiFi.localIP())) { 125 | #else // ESP8266 126 | if (mdns.begin(HOSTNAME)) { 127 | #endif // ESP8266 128 | Serial.println("MDNS responder started"); 129 | } 130 | 131 | server.on("/", handleRoot); 132 | server.on("/ir", handleIr); 133 | 134 | server.on("/inline", [](){ 135 | server.send(200, "text/plain", "this works as well"); 136 | }); 137 | 138 | server.onNotFound(handleNotFound); 139 | 140 | server.begin(); 141 | Serial.println("HTTP server started"); 142 | } 143 | 144 | void loop(void) { 145 | server.handleClient(); 146 | } 147 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRServer/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRrecvDemo/IRrecvDemo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRrecvDemo - demonstrates receiving IR codes with IRrecv 3 | * This is very simple teaching code to show you how to use the library. 4 | * If you are trying to decode your Infra-Red remote(s) for later replay, 5 | * use the IRrecvDumpV2.ino example code instead of this. 6 | * An IR detector/demodulator must be connected to the input kRecvPin. 7 | * Copyright 2009 Ken Shirriff, http://arcfn.com 8 | * Example circuit diagram: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-receiving 10 | * Changes: 11 | * Version 0.2 June, 2017 12 | * Changed GPIO pin to the same as other examples. 13 | * Used our own method for printing a uint64_t. 14 | * Changed the baud rate to 115200. 15 | * Version 0.1 Sept, 2015 16 | * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | // An IR detector/demodulator is connected to GPIO pin 14(D5 on a NodeMCU 25 | // board). 26 | const uint16_t kRecvPin = 14; 27 | 28 | IRrecv irrecv(kRecvPin); 29 | 30 | decode_results results; 31 | 32 | void setup() { 33 | Serial.begin(115200); 34 | irrecv.enableIRIn(); // Start the receiver 35 | while (!Serial) // Wait for the serial connection to be establised. 36 | delay(50); 37 | Serial.println(); 38 | Serial.print("IRrecvDemo is now running and waiting for IR message on Pin "); 39 | Serial.println(kRecvPin); 40 | } 41 | 42 | void loop() { 43 | if (irrecv.decode(&results)) { 44 | // print() & println() can't handle printing long longs. (uint64_t) 45 | serialPrintUint64(results.value, HEX); 46 | Serial.println(""); 47 | irrecv.resume(); // Receive the next value 48 | } 49 | delay(100); 50 | } 51 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRrecvDemo/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRrecvDump/IRrecvDump.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRrecvDump - dump details of IR codes with IRrecv 3 | * Copyright 2009 Ken Shirriff, http://arcfn.com 4 | * 5 | ***** DEPRECATED - DO NOT USE ***** 6 | * Unless you know what you are doing, you should be using the 7 | * IRrecvDumpV2.ino sketch/example instead for capturing & decoding IR messages. 8 | * In almost ALL ways it is BETTER, FASTER, and MORE DETAILED. 9 | * 10 | * This code is left only for legacy reasons, and as another simple example of 11 | * how to use the IRremoteESP8266 library. 12 | * 13 | * As of November 2017 it will no longer be updated or supported. 14 | * You have been warned. 15 | ***** DEPRECATED - DO NOT USE ***** 16 | * 17 | * An IR detector/demodulator must be connected to the input RECV_PIN. 18 | * Version 0.2 Oct 2017 19 | * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, 20 | * JVC and Panasonic protocol added by Kristian Lauszus 21 | * (Thanks to zenwheel and other people at the original blog post) 22 | * LG added by Darryl Smith (based on the JVC protocol) 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // an IR detector/demodulator is connected to GPIO pin 2 31 | uint16_t RECV_PIN = 2; 32 | 33 | IRrecv irrecv(RECV_PIN); 34 | 35 | decode_results results; 36 | 37 | void setup() { 38 | Serial.begin(115200); 39 | irrecv.enableIRIn(); // Start the receiver 40 | } 41 | 42 | void dump(decode_results *results) { 43 | // Dumps out the decode_results structure. 44 | // Call this after IRrecv::decode() 45 | uint16_t count = results->rawlen; 46 | if (results->decode_type == UNKNOWN) { 47 | Serial.print("Unknown encoding: "); 48 | } else if (results->decode_type == NEC) { 49 | Serial.print("Decoded NEC: "); 50 | } else if (results->decode_type == SONY) { 51 | Serial.print("Decoded SONY: "); 52 | } else if (results->decode_type == RC5) { 53 | Serial.print("Decoded RC5: "); 54 | } else if (results->decode_type == RC5X) { 55 | Serial.print("Decoded RC5X: "); 56 | } else if (results->decode_type == RC6) { 57 | Serial.print("Decoded RC6: "); 58 | } else if (results->decode_type == RCMM) { 59 | Serial.print("Decoded RCMM: "); 60 | } else if (results->decode_type == PANASONIC) { 61 | Serial.print("Decoded PANASONIC - Address: "); 62 | Serial.print(results->address, HEX); 63 | Serial.print(" Value: "); 64 | } else if (results->decode_type == LG) { 65 | Serial.print("Decoded LG: "); 66 | } else if (results->decode_type == JVC) { 67 | Serial.print("Decoded JVC: "); 68 | } else if (results->decode_type == AIWA_RC_T501) { 69 | Serial.print("Decoded AIWA RC T501: "); 70 | } else if (results->decode_type == WHYNTER) { 71 | Serial.print("Decoded Whynter: "); 72 | } else if (results->decode_type == NIKAI) { 73 | Serial.print("Decoded Nikai: "); 74 | } 75 | serialPrintUint64(results->value, 16); 76 | Serial.print(" ("); 77 | Serial.print(results->bits, DEC); 78 | Serial.println(" bits)"); 79 | Serial.print("Raw ("); 80 | Serial.print(count, DEC); 81 | Serial.print("): {"); 82 | 83 | for (uint16_t i = 1; i < count; i++) { 84 | if (i % 100 == 0) 85 | yield(); // Preemptive yield every 100th entry to feed the WDT. 86 | if (i & 1) { 87 | Serial.print(results->rawbuf[i] * kRawTick, DEC); 88 | } else { 89 | Serial.print(", "); 90 | Serial.print((uint32_t) results->rawbuf[i] * kRawTick, DEC); 91 | } 92 | } 93 | Serial.println("};"); 94 | } 95 | 96 | void loop() { 97 | if (irrecv.decode(&results)) { 98 | dump(&results); 99 | Serial.println("DEPRECATED: Please use IRrecvDumpV2.ino instead!"); 100 | irrecv.resume(); // Receive the next value 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRrecvDump/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRrecvDumpV2/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRsendDemo/IRsendDemo.ino: -------------------------------------------------------------------------------- 1 | /* IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend. 2 | * 3 | * Version 1.1 January, 2019 4 | * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, 5 | * Copyright 2009 Ken Shirriff, http://arcfn.com 6 | * 7 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 8 | * as specified by kIrLed below. 9 | * 10 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 11 | * 12 | * Suggested circuit: 13 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 14 | * 15 | * Common mistakes & tips: 16 | * * Don't just connect the IR LED directly to the pin, it won't 17 | * have enough current to drive the IR LED effectively. 18 | * * Make sure you have the IR LED polarity correct. 19 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 20 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 21 | * Replace the IR LED with a normal LED if you don't have a digital camera 22 | * when debugging. 23 | * * Avoid using the following pins unless you really know what you are doing: 24 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 25 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 26 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 27 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 28 | * for your first time. e.g. ESP-12 etc. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 36 | 37 | IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message. 38 | 39 | // Example of data captured by IRrecvDumpV2.ino 40 | uint16_t rawData[67] = {9000, 4500, 650, 550, 650, 1650, 600, 550, 650, 550, 41 | 600, 1650, 650, 550, 600, 1650, 650, 1650, 650, 1650, 42 | 600, 550, 650, 1650, 650, 1650, 650, 550, 600, 1650, 43 | 650, 1650, 650, 550, 650, 550, 650, 1650, 650, 550, 44 | 650, 550, 650, 550, 600, 550, 650, 550, 650, 550, 45 | 650, 1650, 600, 550, 650, 1650, 650, 1650, 650, 1650, 46 | 650, 1650, 650, 1650, 650, 1650, 600}; 47 | // Example Samsung A/C state captured from IRrecvDumpV2.ino 48 | uint8_t samsungState[kSamsungAcStateLength] = { 49 | 0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, 50 | 0x01, 0xE2, 0xFE, 0x71, 0x40, 0x11, 0xF0}; 51 | 52 | void setup() { 53 | irsend.begin(); 54 | #if ESP8266 55 | Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY); 56 | #else // ESP8266 57 | Serial.begin(115200, SERIAL_8N1); 58 | #endif // ESP8266 59 | } 60 | 61 | void loop() { 62 | Serial.println("NEC"); 63 | irsend.sendNEC(0x00FFE01FUL); 64 | delay(2000); 65 | Serial.println("Sony"); 66 | irsend.sendSony(0xa90, 12, 2); // 12 bits & 2 repeats 67 | delay(2000); 68 | Serial.println("a rawData capture from IRrecvDumpV2"); 69 | irsend.sendRaw(rawData, 67, 38); // Send a raw data capture at 38kHz. 70 | delay(2000); 71 | Serial.println("a Samsung A/C state from IRrecvDumpV2"); 72 | irsend.sendSamsungAC(samsungState); 73 | delay(2000); 74 | } 75 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRsendDemo/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/IRsendProntoDemo/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/JVCPanasonicSendDemo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend 3 | * Version 0.1 June, 2015 4 | * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com 5 | * JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) 6 | * 7 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 8 | * as specified by kIrLed below. 9 | * 10 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 11 | * 12 | * Suggested circuit: 13 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 14 | * 15 | * Common mistakes & tips: 16 | * * Don't just connect the IR LED directly to the pin, it won't 17 | * have enough current to drive the IR LED effectively. 18 | * * Make sure you have the IR LED polarity correct. 19 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 20 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 21 | * Replace the IR LED with a normal LED if you don't have a digital camera 22 | * when debugging. 23 | * * Avoid using the following pins unless you really know what you are doing: 24 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 25 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 26 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 27 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 28 | * for your first time. e.g. ESP-12 etc. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | const uint16_t kPanasonicAddress = 0x4004; // Panasonic address (Pre data) 36 | const uint32_t kPanasonicPower = 0x100BCBD; // Panasonic Power button 37 | const uint16_t kJVCPower = 0xC5E8; 38 | 39 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 40 | 41 | IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message. 42 | 43 | void setup() { 44 | irsend.begin(); 45 | } 46 | 47 | void loop() { 48 | // This should turn your TV on and off 49 | #if SEND_PANASONIC 50 | irsend.sendPanasonic(kPanasonicAddress, kPanasonicPower); 51 | #else // SEND_PANASONIC 52 | Serial.println("Can't send because SEND_PANASONIC has been disabled."); 53 | #endif // SEND_PANASONIC 54 | 55 | #if SEND_JVC 56 | irsend.sendJVC(kJVCPower, 16, 1); // hex value, 16 bits, single repeat 57 | #else // SEND_JVC 58 | Serial.println("Can't send because SEND_JVC has been disabled."); 59 | #endif // SEND_JVC 60 | delay(10000); // Wait 10 seconds before we repeat everything. 61 | } 62 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/JVCPanasonicSendDemo/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/LGACSend/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/SmartIRRepeater/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/TurnOnArgoAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017, 2018 crankyoldgit 2 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 3 | * as specified by kIrLed below. 4 | * 5 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 6 | * 7 | * Suggested circuit: 8 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 9 | * 10 | * Common mistakes & tips: 11 | * * Don't just connect the IR LED directly to the pin, it won't 12 | * have enough current to drive the IR LED effectively. 13 | * * Make sure you have the IR LED polarity correct. 14 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 15 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 16 | * Replace the IR LED with a normal LED if you don't have a digital camera 17 | * when debugging. 18 | * * Avoid using the following pins unless you really know what you are doing: 19 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 20 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 21 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 22 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 23 | * for your first time. e.g. ESP-12 etc. 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRArgoAC ac(kIrLed); // Set the GPIO to be used to sending the message. 33 | 34 | void setup() { 35 | ac.begin(); 36 | Serial.begin(115200); 37 | } 38 | 39 | void loop() { 40 | Serial.println("Sending..."); 41 | 42 | // Set up what we want to send. See ir_Argo.cpp for all the options. 43 | ac.setPower(true); 44 | ac.setFan(kArgoFan1); 45 | ac.setMode(kArgoAuto); 46 | ac.setTemp(25); 47 | 48 | #if SEND_ARGO 49 | // Now send the IR signal. 50 | ac.send(); 51 | #else // SEND_ARGO 52 | Serial.println("Can't send because SEND_ARGO has been disabled."); 53 | #endif // SEND_ARGO 54 | 55 | delay(5000); 56 | } 57 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnArgoAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/TurnOnDaikinAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 sillyfrog 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 33 | IRDaikinESP ac(kIrLed); // Set the GPIO to be used to sending the message 34 | 35 | void setup() { 36 | ac.begin(); 37 | Serial.begin(115200); 38 | } 39 | 40 | 41 | void loop() { 42 | Serial.println("Sending..."); 43 | 44 | // Set up what we want to send. See ir_Daikin.cpp for all the options. 45 | ac.on(); 46 | ac.setFan(1); 47 | ac.setMode(kDaikinCool); 48 | ac.setTemp(25); 49 | ac.setSwingVertical(false); 50 | ac.setSwingHorizontal(false); 51 | 52 | // Set the current time to 1:33PM (13:33) 53 | // Time works in minutes past midnight 54 | ac.setCurrentTime(13 * 60 + 33); 55 | // Turn off about 1 hour later at 2:30PM (14:30) 56 | ac.enableOffTimer(14 * 60 + 30); 57 | 58 | // Display what we are going to send. 59 | Serial.println(ac.toString()); 60 | 61 | // Now send the IR signal. 62 | #if SEND_DAIKIN 63 | ac.send(); 64 | #endif // SEND_DAIKIN 65 | 66 | delay(15000); 67 | } 68 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnDaikinAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/TurnOnFujitsuAC.ino: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Jonny Graham, 2018 David Conran 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 8 | IRFujitsuAC ac(kIrLed); 9 | 10 | void printState() { 11 | // Display the settings. 12 | Serial.println("Fujitsu A/C remote is in the following state:"); 13 | Serial.printf(" %s\n", ac.toString().c_str()); 14 | // Display the encoded IR sequence. 15 | unsigned char* ir_code = ac.getRaw(); 16 | Serial.print("IR Code: 0x"); 17 | for (uint8_t i = 0; i < ac.getStateLength(); i++) 18 | Serial.printf("%02X", ir_code[i]); 19 | Serial.println(); 20 | } 21 | 22 | void setup() { 23 | ac.begin(); 24 | Serial.begin(115200); 25 | delay(200); 26 | 27 | // Set up what we want to send. See ir_Fujitsu.cpp for all the options. 28 | Serial.println("Default state of the remote."); 29 | printState(); 30 | Serial.println("Setting desired state for A/C."); 31 | // See `fujitsu_ac_remote_model_t` in `ir_Fujitsu.h` for a list of models. 32 | ac.setModel(ARRAH2E); 33 | ac.setSwing(kFujitsuAcSwingOff); 34 | ac.setMode(kFujitsuAcModeCool); 35 | ac.setFanSpeed(kFujitsuAcFanHigh); 36 | ac.setTemp(24); // 24C 37 | ac.setCmd(kFujitsuAcCmdTurnOn); 38 | } 39 | 40 | void loop() { 41 | // Now send the IR signal. 42 | Serial.println("Sending IR command to A/C ..."); 43 | #if SEND_FUJITSU_AC 44 | ac.send(); 45 | #else // SEND_FUJITSU_AC 46 | Serial.println("Can't send because SEND_FUJITSU_AC has been disabled."); 47 | #endif // SEND_FUJITSU_AC 48 | printState(); 49 | delay(5000); 50 | } 51 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnFujitsuAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/TurnOnKelvinatorAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2016, 2018 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRKelvinatorAC ac(kIrLed); // Set the GPIO to be used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Kelvinator A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | // Display the encoded IR sequence. 39 | unsigned char* ir_code = ac.getRaw(); 40 | Serial.print("IR Code: 0x"); 41 | for (uint8_t i = 0; i < kKelvinatorStateLength; i++) 42 | Serial.printf("%02X", ir_code[i]); 43 | Serial.println(); 44 | } 45 | 46 | void setup() { 47 | ac.begin(); 48 | Serial.begin(115200); 49 | delay(200); 50 | 51 | // Set up what we want to send. See ir_Kelvinator.cpp for all the options. 52 | // Most things default to off. 53 | Serial.println("Default state of the remote."); 54 | printState(); 55 | Serial.println("Setting desired state for A/C."); 56 | ac.on(); 57 | ac.setFan(1); 58 | ac.setMode(kKelvinatorCool); 59 | ac.setTemp(26); 60 | ac.setSwingVertical(false); 61 | ac.setSwingHorizontal(true); 62 | ac.setXFan(true); 63 | ac.setIonFilter(false); 64 | ac.setLight(true); 65 | } 66 | 67 | void loop() { 68 | // Now send the IR signal. 69 | #if SEND_KELVINATOR 70 | Serial.println("Sending IR command to A/C ..."); 71 | ac.send(); 72 | #endif // SEND_KELVINATOR 73 | printState(); 74 | delay(5000); 75 | } 76 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnKelvinatorAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/TurnOnMitsubishiAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017, 2018 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRMitsubishiAC ac(kIrLed); // Set the GPIO used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Mitsubishi A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | // Display the encoded IR sequence. 39 | unsigned char* ir_code = ac.getRaw(); 40 | Serial.print("IR Code: 0x"); 41 | for (uint8_t i = 0; i < kMitsubishiACStateLength; i++) 42 | Serial.printf("%02X", ir_code[i]); 43 | Serial.println(); 44 | } 45 | 46 | void setup() { 47 | ac.begin(); 48 | Serial.begin(115200); 49 | delay(200); 50 | 51 | // Set up what we want to send. See ir_Mitsubishi.cpp for all the options. 52 | Serial.println("Default state of the remote."); 53 | printState(); 54 | Serial.println("Setting desired state for A/C."); 55 | ac.on(); 56 | ac.setFan(1); 57 | ac.setMode(kMitsubishiAcCool); 58 | ac.setTemp(26); 59 | ac.setVane(kMitsubishiAcVaneAuto); 60 | } 61 | 62 | void loop() { 63 | // Now send the IR signal. 64 | #if SEND_MITSUBISHI_AC 65 | Serial.println("Sending IR command to A/C ..."); 66 | ac.send(); 67 | #endif // SEND_MITSUBISHI_AC 68 | printState(); 69 | delay(5000); 70 | } 71 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/TurnOnMitsubishiHeavyAc.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRMitsubishiHeavy152Ac ac(kIrLed); // Set the GPIO used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Mitsubishi Heavy A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | // Display the encoded IR sequence. 39 | unsigned char* ir_code = ac.getRaw(); 40 | Serial.print("IR Code: 0x"); 41 | for (uint8_t i = 0; i < kMitsubishiHeavy152StateLength; i++) 42 | Serial.printf("%02X", ir_code[i]); 43 | Serial.println(); 44 | } 45 | 46 | void setup() { 47 | ac.begin(); 48 | Serial.begin(115200); 49 | delay(200); 50 | 51 | // Set up what we want to send. See ir_MitsubishiHeavy.(cpp|h) for all the 52 | // options. 53 | Serial.println("Default state of the remote."); 54 | printState(); 55 | Serial.println("Setting desired state for A/C."); 56 | ac.setPower(true); // Turn it on. 57 | ac.setFan(kMitsubishiHeavy152FanMed); // Medium Fan 58 | ac.setMode(kMitsubishiHeavyCool); // Cool mode 59 | ac.setTemp(26); // Celsius 60 | ac.setSwingVertical(kMitsubishiHeavy152SwingVAuto); // Swing vertically 61 | ac.setSwingHorizontal(kMitsubishiHeavy152SwingHMiddle); // Swing Horizontally 62 | } 63 | 64 | void loop() { 65 | // Now send the IR signal. 66 | Serial.println("Sending IR command to A/C ..."); 67 | ac.send(); 68 | printState(); 69 | delay(5000); 70 | } 71 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnMitsubishiHeavyAc/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/TurnOnPanasonicAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017, 2018 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRPanasonicAc ac(kIrLed); // Set the GPIO used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Panasonic A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | // Display the encoded IR sequence. 39 | unsigned char* ir_code = ac.getRaw(); 40 | Serial.print("IR Code: 0x"); 41 | for (uint8_t i = 0; i < kPanasonicAcStateLength; i++) 42 | Serial.printf("%02X", ir_code[i]); 43 | Serial.println(); 44 | } 45 | 46 | void setup() { 47 | ac.begin(); 48 | Serial.begin(115200); 49 | delay(200); 50 | 51 | // Set up what we want to send. See ir_Panasonic.cpp for all the options. 52 | Serial.println("Default state of the remote."); 53 | printState(); 54 | Serial.println("Setting desired state for A/C."); 55 | ac.setModel(kPanasonicRkr); 56 | ac.on(); 57 | ac.setFan(kPanasonicAcFanAuto); 58 | ac.setMode(kPanasonicAcCool); 59 | ac.setTemp(26); 60 | ac.setSwingVertical(kPanasonicAcSwingVAuto); 61 | ac.setSwingHorizontal(kPanasonicAcSwingHAuto); 62 | } 63 | 64 | void loop() { 65 | // Now send the IR signal. 66 | #if SEND_PANASONIC_AC 67 | Serial.println("Sending IR command to A/C ..."); 68 | ac.send(); 69 | #endif // SEND_PANASONIC_AC 70 | printState(); 71 | delay(5000); 72 | } 73 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnPanasonicAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/TurnOnToshibaAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017, 2018 David Conran 2 | * 3 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 4 | * as specified by kIrLed below. 5 | * 6 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 7 | * 8 | * Suggested circuit: 9 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 10 | * 11 | * Common mistakes & tips: 12 | * * Don't just connect the IR LED directly to the pin, it won't 13 | * have enough current to drive the IR LED effectively. 14 | * * Make sure you have the IR LED polarity correct. 15 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 16 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 17 | * Replace the IR LED with a normal LED if you don't have a digital camera 18 | * when debugging. 19 | * * Avoid using the following pins unless you really know what you are doing: 20 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 21 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 22 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 23 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 24 | * for your first time. e.g. ESP-12 etc. 25 | */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRToshibaAC ac(kIrLed); // Set the GPIO to be used for sending messages. 33 | 34 | void printState() { 35 | // Display the settings. 36 | Serial.println("Toshiba A/C remote is in the following state:"); 37 | Serial.printf(" %s\n", ac.toString().c_str()); 38 | // Display the encoded IR sequence. 39 | unsigned char* ir_code = ac.getRaw(); 40 | Serial.print("IR Code: 0x"); 41 | for (uint8_t i = 0; i < kToshibaACStateLength; i++) 42 | Serial.printf("%02X", ir_code[i]); 43 | Serial.println(); 44 | } 45 | 46 | void setup() { 47 | ac.begin(); 48 | Serial.begin(115200); 49 | delay(200); 50 | 51 | // Set up what we want to send. See ir_Toshiba.cpp for all the options. 52 | Serial.println("Default state of the remote."); 53 | printState(); 54 | Serial.println("Setting desired state for A/C."); 55 | ac.on(); 56 | ac.setFan(1); 57 | ac.setMode(kToshibaAcCool); 58 | ac.setTemp(26); 59 | } 60 | 61 | void loop() { 62 | // Now send the IR signal. 63 | #if SEND_TOSHIBA_AC 64 | Serial.println("Sending IR command to A/C ..."); 65 | ac.send(); 66 | #endif // SEND_TOSHIBA_AC 67 | printState(); 68 | delay(5000); 69 | } 70 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnToshibaAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/TurnOnTrotecAC.ino: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 stufisher 2 | * An IR LED circuit *MUST* be connected to the ESP8266 on a pin 3 | * as specified by kIrLed below. 4 | * 5 | * TL;DR: The IR LED needs to be driven by a transistor for a good result. 6 | * 7 | * Suggested circuit: 8 | * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending 9 | * 10 | * Common mistakes & tips: 11 | * * Don't just connect the IR LED directly to the pin, it won't 12 | * have enough current to drive the IR LED effectively. 13 | * * Make sure you have the IR LED polarity correct. 14 | * See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity 15 | * * Typical digital camera/phones can be used to see if the IR LED is flashed. 16 | * Replace the IR LED with a normal LED if you don't have a digital camera 17 | * when debugging. 18 | * * Avoid using the following pins unless you really know what you are doing: 19 | * * Pin 0/D3: Can interfere with the boot/program mode & support circuits. 20 | * * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere. 21 | * * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere. 22 | * * ESP-01 modules are tricky. We suggest you use a module with more GPIOs 23 | * for your first time. e.g. ESP-12 etc. 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). 32 | IRTrotecESP ac(kIrLed); // Set the GPIO to be used for sending messages. 33 | 34 | void setup() { 35 | ac.begin(); 36 | Serial.begin(115200); 37 | } 38 | 39 | void loop() { 40 | Serial.println("Sending..."); 41 | 42 | // Set up what we want to send. See ir_Trotec.cpp for all the options. 43 | ac.setPower(true); 44 | ac.setSpeed(kTrotecFanLow); 45 | ac.setMode(kTrotecCool); 46 | ac.setTemp(25); 47 | 48 | // Now send the IR signal. 49 | #if SEND_TROTEC 50 | ac.send(); 51 | #else // SEND_TROTEC 52 | Serial.println("Can't send because SEND_TROTEC has been disabled."); 53 | #endif // SEND_TROTEC 54 | 55 | delay(5000); 56 | } 57 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/examples/TurnOnTrotecAC/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = . 3 | 4 | [env] 5 | lib_extra_dirs = ../../ 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:esp32dev] 16 | platform = espressif32 17 | framework = arduino 18 | board = esp32dev 19 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "IRremoteESP8266", 3 | "version": "2.6.4", 4 | "keywords": "infrared, ir, remote, esp8266, esp32", 5 | "description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)", 6 | "repository": 7 | { 8 | "type": "git", 9 | "url": "https://github.com/crankyoldgit/IRremoteESP8266.git" 10 | }, 11 | "authors": [ 12 | { 13 | "name": "David Conran", 14 | "url": "https://plus.google.com/+davidconran", 15 | "maintainer": true 16 | }, 17 | { 18 | "name": "Mark Szabo", 19 | "url": "http://nomartini-noparty.blogspot.com/", 20 | "maintainer": true 21 | }, 22 | { 23 | "name": "Sebastien Warin", 24 | "url": "http://sebastien.warin.fr", 25 | "maintainer": true 26 | }, 27 | { 28 | "name": "Ken Shirriff", 29 | "email": "zetoslab@gmail.com" 30 | }, 31 | { 32 | "name": "Roi Dayan", 33 | "url": "https://github.com/roidayan/", 34 | "maintainer": true 35 | }, 36 | { 37 | "name": "Massimiliano Pinto", 38 | "url": "https://github.com/pintomax/", 39 | "maintainer": true 40 | } 41 | ], 42 | "frameworks": "arduino", 43 | "platforms": ["espressif8266", "espressif32"] 44 | } 45 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/library.properties: -------------------------------------------------------------------------------- 1 | name=IRremoteESP8266 2 | version=2.6.4 3 | author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff 4 | maintainer=Mark Szabo, David Conran, Sebastien Warin, Roi Dayan, Massimiliano Pinto 5 | sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32) 6 | paragraph=This library enables you to send and receive infra-red signals on an ESP8266 or an ESP32. 7 | category=Device Control 8 | url=https://github.com/crankyoldgit/IRremoteESP8266 9 | architectures=esp8266,esp32 10 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/platformio.ini: -------------------------------------------------------------------------------- 1 | [platformio] 2 | src_dir = examples/IRrecvDumpV2 3 | 4 | [env] 5 | lib_extra_dirs = . 6 | lib_ldf_mode = deep+ 7 | lib_ignore = examples 8 | build_flags = 9 | 10 | [env:nodemcuv2] 11 | platform = espressif8266 12 | framework = arduino 13 | board = nodemcuv2 14 | 15 | [env:d1_mini] 16 | platform = espressif8266 17 | framework = arduino 18 | board = d1_mini 19 | 20 | [env:esp32dev] 21 | platform = espressif32 22 | framework = arduino 23 | board = esp32dev 24 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/pylintrc: -------------------------------------------------------------------------------- 1 | [REPORTS] 2 | 3 | # Tells whether to display a full report or only the messages 4 | reports=no 5 | 6 | [FORMAT] 7 | 8 | # Maximum number of characters on a single line. 9 | max-line-length=80 10 | 11 | # String used as indentation unit. 12 | indent-string=' ' 13 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/include,+build/include_alpha,+build/include_order,+build/include_what_you_use 2 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/IRtimer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #include "IRtimer.h" 4 | #ifndef UNIT_TEST 5 | #include 6 | #endif 7 | 8 | #ifdef UNIT_TEST 9 | // Used to help simulate elapsed time in unit tests. 10 | uint32_t _IRtimer_unittest_now = 0; 11 | uint32_t _TimerMs_unittest_now = 0; 12 | #endif // UNIT_TEST 13 | 14 | // This class performs a simple time in useconds since instantiated. 15 | // Handles when the system timer wraps around (once). 16 | IRtimer::IRtimer() { reset(); } 17 | 18 | void IRtimer::reset() { 19 | #ifndef UNIT_TEST 20 | start = micros(); 21 | #else 22 | start = _IRtimer_unittest_now; 23 | #endif 24 | } 25 | 26 | uint32_t IRtimer::elapsed() { 27 | #ifndef UNIT_TEST 28 | uint32_t now = micros(); 29 | #else 30 | uint32_t now = _IRtimer_unittest_now; 31 | #endif 32 | if (start <= now) // Check if the system timer has wrapped. 33 | return now - start; // No wrap. 34 | else 35 | return UINT32_MAX - start + now; // Has wrapped. 36 | } 37 | 38 | // Only used in unit testing. 39 | #ifdef UNIT_TEST 40 | void IRtimer::add(uint32_t usecs) { _IRtimer_unittest_now += usecs; } 41 | #endif // UNIT_TEST 42 | 43 | // This class performs a simple time in milli-seoncds since instantiated. 44 | // Handles when the system timer wraps around (once). 45 | TimerMs::TimerMs() { reset(); } 46 | 47 | void TimerMs::reset() { 48 | #ifndef UNIT_TEST 49 | start = millis(); 50 | #else 51 | start = _TimerMs_unittest_now; 52 | #endif 53 | } 54 | 55 | uint32_t TimerMs::elapsed() { 56 | #ifndef UNIT_TEST 57 | uint32_t now = millis(); 58 | #else 59 | uint32_t now = _TimerMs_unittest_now; 60 | #endif 61 | if (start <= now) // Check if the system timer has wrapped. 62 | return now - start; // No wrap. 63 | else 64 | return UINT32_MAX - start + now; // Has wrapped. 65 | } 66 | 67 | // Only used in unit testing. 68 | #ifdef UNIT_TEST 69 | void TimerMs::add(uint32_t msecs) { _IRtimer_unittest_now += msecs; } 70 | #endif // UNIT_TEST 71 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/IRtimer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #ifndef IRTIMER_H_ 4 | #define IRTIMER_H_ 5 | 6 | #define __STDC_LIMIT_MACROS 7 | #include 8 | 9 | // Classes 10 | class IRtimer { 11 | public: 12 | IRtimer(); 13 | void reset(); 14 | uint32_t elapsed(); 15 | #ifdef UNIT_TEST 16 | static void add(uint32_t usecs); 17 | #endif // UNIT_TEST 18 | 19 | private: 20 | uint32_t start; 21 | }; 22 | 23 | class TimerMs { 24 | public: 25 | TimerMs(); 26 | void reset(); 27 | uint32_t elapsed(); 28 | #ifdef UNIT_TEST 29 | static void add(uint32_t msecs); 30 | #endif // UNIT_TEST 31 | 32 | private: 33 | uint32_t start; 34 | }; 35 | #endif // IRTIMER_H_ 36 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/IRutils.h: -------------------------------------------------------------------------------- 1 | #ifndef IRUTILS_H_ 2 | #define IRUTILS_H_ 3 | 4 | // Copyright 2017 David Conran 5 | 6 | #ifndef UNIT_TEST 7 | #include 8 | #endif 9 | #define __STDC_LIMIT_MACROS 10 | #include 11 | #ifndef ARDUINO 12 | #include 13 | #endif 14 | #include "IRremoteESP8266.h" 15 | #include "IRrecv.h" 16 | 17 | uint64_t reverseBits(uint64_t input, uint16_t nbits); 18 | String uint64ToString(uint64_t input, uint8_t base = 10); 19 | String typeToString(const decode_type_t protocol, 20 | const bool isRepeat = false); 21 | void serialPrintUint64(uint64_t input, uint8_t base = 10); 22 | String resultToSourceCode(const decode_results * const results); 23 | String resultToTimingInfo(const decode_results * const results); 24 | String resultToHumanReadableBasic(const decode_results * const results); 25 | String resultToHexidecimal(const decode_results * const result); 26 | bool hasACState(const decode_type_t protocol); 27 | uint16_t getCorrectedRawLength(const decode_results * const results); 28 | uint16_t *resultToRawArray(const decode_results * const decode); 29 | uint8_t sumBytes(const uint8_t * const start, const uint16_t length, 30 | const uint8_t init = 0); 31 | uint8_t xorBytes(const uint8_t * const start, const uint16_t length, 32 | const uint8_t init = 0); 33 | uint16_t countBits(const uint8_t * const start, const uint16_t length, 34 | const bool ones = true, const uint16_t init = 0); 35 | uint16_t countBits(const uint64_t data, const uint8_t length, 36 | const bool ones = true, const uint16_t init = 0); 37 | uint64_t invertBits(const uint64_t data, const uint16_t nbits); 38 | decode_type_t strToDecodeType(const char *str); 39 | float celsiusToFahrenheit(const float deg); 40 | float fahrenheitToCelsius(const float deg); 41 | namespace irutils { 42 | String addBoolToString(const bool value, const String label, 43 | const bool precomma = true); 44 | String addIntToString(const uint16_t value, const String label, 45 | const bool precomma = true); 46 | String addLabeledString(const String value, const String label, 47 | const bool precomma = true); 48 | String addTempToString(const uint16_t degrees, const bool celsius = true, 49 | const bool precomma = true); 50 | String addModeToString(const uint8_t mode, const uint8_t automatic, 51 | const uint8_t cool, const uint8_t heat, 52 | const uint8_t dry, const uint8_t fan); 53 | String addFanToString(const uint8_t speed, const uint8_t high, 54 | const uint8_t low, const uint8_t automatic, 55 | const uint8_t quiet, const uint8_t medium); 56 | String htmlEscape(const String unescaped); 57 | String msToString(uint32_t const msecs); 58 | String minsToString(const uint16_t mins); 59 | uint8_t sumNibbles(const uint8_t * const start, const uint16_t length, 60 | const uint8_t init = 0); 61 | uint8_t bcdToUint8(const uint8_t bcd); 62 | uint8_t uint8ToBcd(const uint8_t integer); 63 | } // namespace irutils 64 | #endif // IRUTILS_H_ 65 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Aiwa.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #include "IRrecv.h" 4 | #include "IRsend.h" 5 | 6 | // AAA IIIII W W AAA 7 | // A A I W W A A 8 | // AAAAA I W W W AAAAA 9 | // A A I W W W A A 10 | // A A IIIII WWW A A 11 | 12 | // Based off the RC-T501 RCU 13 | // Added by David Conran. (Inspired by IRremoteESP8266's implementation: 14 | // https://github.com/z3t0/Arduino-IRremote) 15 | // Supports: 16 | // Brand: Aiwa, Model: RC-T501 RCU 17 | 18 | const uint16_t kAiwaRcT501PreBits = 26; 19 | const uint16_t kAiwaRcT501PostBits = 1; 20 | // NOTE: These are the compliment (inverted) of lirc values as 21 | // lirc uses a '0' for a mark, and a '1' for a space. 22 | const uint64_t kAiwaRcT501PreData = 0x1D8113FULL; // 26-bits 23 | const uint64_t kAiwaRcT501PostData = 1ULL; 24 | 25 | #if SEND_AIWA_RC_T501 26 | // Send an Aiwa RC T501 formatted message. 27 | // 28 | // Args: 29 | // data: The message to be sent. 30 | // nbits: The number of bits of the message to be sent. 31 | // Typically kAiwaRcT501Bits. Max is 37 = (64 - 27) 32 | // repeat: The number of times the command is to be repeated. 33 | // 34 | // Status: BETA / Should work. 35 | // 36 | // Ref: 37 | // http://lirc.sourceforge.net/remotes/aiwa/RC-T501 38 | void IRsend::sendAiwaRCT501(uint64_t data, uint16_t nbits, uint16_t repeat) { 39 | // Appears to be an extended NEC1 protocol. i.e. 42 bits instead of 32 bits. 40 | // So use sendNEC instead, however the twist is it has a fixed 26 bit 41 | // prefix, and a fixed postfix bit. 42 | uint64_t new_data = ((kAiwaRcT501PreData << (nbits + kAiwaRcT501PostBits)) | 43 | (data << kAiwaRcT501PostBits) | kAiwaRcT501PostData); 44 | nbits += kAiwaRcT501PreBits + kAiwaRcT501PostBits; 45 | if (nbits > sizeof(new_data) * 8) 46 | return; // We are overflowing. Abort, and don't send. 47 | sendNEC(new_data, nbits, repeat); 48 | } 49 | #endif 50 | 51 | #if DECODE_AIWA_RC_T501 52 | // Decode the supplied Aiwa RC T501 message. 53 | // 54 | // Args: 55 | // results: Ptr to the data to decode and where to store the decode result. 56 | // nbits: The number of data bits to expect. Typically kAiwaRcT501Bits. 57 | // strict: Flag indicating if we should perform strict matching. 58 | // Returns: 59 | // boolean: True if it can decode it, false if it can't. 60 | // 61 | // Status: BETA / Should work. 62 | // 63 | // Notes: 64 | // Aiwa RC T501 appears to be a 42 bit variant of the NEC1 protocol. 65 | // However, we historically (original Arduino IRremote project) treats it as 66 | // a 15 bit (data) protocol. So, we expect nbits to typically be 15, and we 67 | // will remove the prefix and postfix from the raw data, and use that as 68 | // the result. 69 | // 70 | // Ref: 71 | // http://www.sbprojects.com/knowledge/ir/nec.php 72 | bool IRrecv::decodeAiwaRCT501(decode_results *results, uint16_t nbits, 73 | bool strict) { 74 | // Compliance 75 | if (strict && nbits != kAiwaRcT501Bits) 76 | return false; // Doesn't match our protocol defn. 77 | 78 | // Add on the pre & post bits to our requested bit length. 79 | uint16_t expected_nbits = nbits + kAiwaRcT501PreBits + kAiwaRcT501PostBits; 80 | uint64_t new_data; 81 | if (expected_nbits > sizeof(new_data) * 8) 82 | return false; // We can't possibly match something that big. 83 | // Decode it as a much bigger (non-standard) NEC message, so we have to turn 84 | // off strict mode checking for NEC. 85 | if (!decodeNEC(results, expected_nbits, false)) 86 | return false; // The NEC decode had a problem, so we should too. 87 | uint16_t actual_bits = results->bits; 88 | new_data = results->value; 89 | if (actual_bits < expected_nbits) 90 | return false; // The data we caught was undersized. Throw it back. 91 | if ((new_data & 0x1ULL) != kAiwaRcT501PostData) 92 | return false; // The post data doesn't match, so it can't be this protocol. 93 | // Trim off the post data bit. 94 | new_data >>= kAiwaRcT501PostBits; 95 | actual_bits -= kAiwaRcT501PostBits; 96 | 97 | // Extract out our likely new value and put it back in the results. 98 | actual_bits -= kAiwaRcT501PreBits; 99 | results->value = new_data & ((1ULL << actual_bits) - 1); 100 | 101 | // Check the prefix data matches. 102 | new_data >>= actual_bits; // Trim off the new data to expose the prefix. 103 | if (new_data != kAiwaRcT501PreData) // Check the prefix. 104 | return false; 105 | 106 | // Compliance 107 | if (strict && results->bits != expected_nbits) return false; 108 | 109 | // Success 110 | results->decode_type = AIWA_RC_T501; 111 | results->bits = actual_bits; 112 | results->address = 0; 113 | results->command = 0; 114 | return true; 115 | } 116 | #endif 117 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Carrier.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2018 David Conran 2 | 3 | // Supports: 4 | // Brand: Carrier/Surrey, Model: 42QG5A55970 remote 5 | // Brand: Carrier/Surrey, Model: 619EGX0090E0 A/C 6 | // Brand: Carrier/Surrey, Model: 619EGX0120E0 A/C 7 | // Brand: Carrier/Surrey, Model: 619EGX0180E0 A/C 8 | // Brand: Carrier/Surrey, Model: 619EGX0220E0 A/C 9 | // Brand: Carrier/Surrey, Model: 53NGK009/012 Inverter 10 | 11 | #include "IRrecv.h" 12 | #include "IRsend.h" 13 | #include "IRutils.h" 14 | 15 | // Constants 16 | // Ref: 17 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/385 18 | const uint16_t kCarrierAcHdrMark = 8532; 19 | const uint16_t kCarrierAcHdrSpace = 4228; 20 | const uint16_t kCarrierAcBitMark = 628; 21 | const uint16_t kCarrierAcOneSpace = 1320; 22 | const uint16_t kCarrierAcZeroSpace = 532; 23 | const uint16_t kCarrierAcGap = 20000; 24 | 25 | #if SEND_CARRIER_AC 26 | // Send a Carrier HVAC formatted message. 27 | // 28 | // Args: 29 | // data: The message to be sent. 30 | // nbits: The bit size of the message being sent. typically kCarrierAcBits. 31 | // repeat: The number of times the message is to be repeated. 32 | // 33 | // Status: BETA / Appears to work on real devices. 34 | // 35 | void IRsend::sendCarrierAC(uint64_t data, uint16_t nbits, uint16_t repeat) { 36 | for (uint16_t r = 0; r <= repeat; r++) { 37 | uint64_t temp_data = data; 38 | // Carrier sends the data block three times. normal + inverted + normal. 39 | for (uint16_t i = 0; i < 3; i++) { 40 | sendGeneric(kCarrierAcHdrMark, kCarrierAcHdrSpace, kCarrierAcBitMark, 41 | kCarrierAcOneSpace, kCarrierAcBitMark, kCarrierAcZeroSpace, 42 | kCarrierAcBitMark, kCarrierAcGap, temp_data, nbits, 38, true, 43 | 0, kDutyDefault); 44 | temp_data = invertBits(temp_data, nbits); 45 | } 46 | } 47 | } 48 | #endif 49 | 50 | #if DECODE_CARRIER_AC 51 | // Decode the supplied Carrier HVAC message. 52 | // Carrier HVAC messages contain only 32 bits, but it is sent three(3) times. 53 | // i.e. normal + inverted + normal 54 | // Args: 55 | // results: Ptr to the data to decode and where to store the decode result. 56 | // nbits: Nr. of bits to expect in the data portion. 57 | // Typically kCarrierAcBits. 58 | // strict: Flag to indicate if we strictly adhere to the specification. 59 | // Returns: 60 | // boolean: True if it can decode it, false if it can't. 61 | // 62 | // Status: ALPHA / Untested. 63 | // 64 | bool IRrecv::decodeCarrierAC(decode_results *results, uint16_t nbits, 65 | bool strict) { 66 | if (results->rawlen < ((2 * nbits + kHeader + kFooter) * 3) - 1) 67 | return false; // Can't possibly be a valid Carrier message. 68 | if (strict && nbits != kCarrierAcBits) 69 | return false; // We expect Carrier to be 32 bits of message. 70 | 71 | uint64_t data = 0; 72 | uint64_t prev_data = 0; 73 | uint16_t offset = kStartOffset; 74 | 75 | for (uint8_t i = 0; i < 3; i++) { 76 | prev_data = data; 77 | // Match Header + Data + Footer 78 | uint16_t used; 79 | used = matchGeneric(results->rawbuf + offset, &data, 80 | results->rawlen - offset, nbits, 81 | kCarrierAcHdrMark, kCarrierAcHdrSpace, 82 | kCarrierAcBitMark, kCarrierAcOneSpace, 83 | kCarrierAcBitMark, kCarrierAcZeroSpace, 84 | kCarrierAcBitMark, kCarrierAcGap, true); 85 | if (!used) return false; 86 | offset += used; 87 | // Compliance. 88 | if (strict) { 89 | // Check if the data is an inverted copy of the previous data. 90 | if (i > 0 && prev_data != invertBits(data, nbits)) return false; 91 | } 92 | } 93 | 94 | // Success 95 | results->bits = nbits; 96 | results->value = data; 97 | results->decode_type = CARRIER_AC; 98 | results->address = data >> 16; 99 | results->command = data & 0xFFFF; 100 | return true; 101 | } 102 | #endif 103 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Denon.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Massimiliano Pinto 2 | // Copyright 2017 David Conran 3 | 4 | #include 5 | #include "IRrecv.h" 6 | #include "IRsend.h" 7 | #include "IRutils.h" 8 | 9 | // Original Denon support added by https://github.com/csBlueChip 10 | // Ported over by Massimiliano Pinto 11 | 12 | // Constants 13 | // Ref: 14 | // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Denon.cpp 15 | const uint16_t kDenonTick = 263; 16 | const uint16_t kDenonHdrMarkTicks = 1; 17 | const uint16_t kDenonHdrMark = kDenonHdrMarkTicks * kDenonTick; 18 | const uint16_t kDenonHdrSpaceTicks = 3; 19 | const uint16_t kDenonHdrSpace = kDenonHdrSpaceTicks * kDenonTick; 20 | const uint16_t kDenonBitMarkTicks = 1; 21 | const uint16_t kDenonBitMark = kDenonBitMarkTicks * kDenonTick; 22 | const uint16_t kDenonOneSpaceTicks = 7; 23 | const uint16_t kDenonOneSpace = kDenonOneSpaceTicks * kDenonTick; 24 | const uint16_t kDenonZeroSpaceTicks = 3; 25 | const uint16_t kDenonZeroSpace = kDenonZeroSpaceTicks * kDenonTick; 26 | const uint16_t kDenonMinCommandLengthTicks = 510; 27 | const uint16_t kDenonMinGapTicks = 28 | kDenonMinCommandLengthTicks - 29 | (kDenonHdrMarkTicks + kDenonHdrSpaceTicks + 30 | kDenonBits * (kDenonBitMarkTicks + kDenonOneSpaceTicks) + 31 | kDenonBitMarkTicks); 32 | const uint32_t kDenonMinGap = kDenonMinGapTicks * kDenonTick; 33 | const uint64_t kDenonManufacturer = 0x2A4CULL; 34 | 35 | #if SEND_DENON 36 | // Send a Denon message 37 | // 38 | // Args: 39 | // data: Contents of the message to be sent. 40 | // nbits: Nr. of bits of data to be sent. Typically kDenonBits. 41 | // repeat: Nr. of additional times the message is to be sent. 42 | // 43 | // Status: BETA / Should be working. 44 | // 45 | // Notes: 46 | // Some Denon devices use a Kaseikyo/Panasonic 48-bit format 47 | // Others use the Sharp protocol. 48 | // Ref: 49 | // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Denon.cpp 50 | // http://assets.denon.com/documentmaster/us/denon%20master%20ir%20hex.xls 51 | void IRsend::sendDenon(uint64_t data, uint16_t nbits, uint16_t repeat) { 52 | if (nbits >= kPanasonicBits) // Is this really Panasonic? 53 | sendPanasonic64(data, nbits, repeat); 54 | else if (nbits == kDenonLegacyBits) 55 | // Support legacy (broken) calls of sendDenon(). 56 | sendSharpRaw(data & (~0x2000ULL), nbits + 1, repeat); 57 | else 58 | sendSharpRaw(data, nbits, repeat); 59 | } 60 | #endif 61 | 62 | #if DECODE_DENON 63 | // Decode a Denon message. 64 | // 65 | // Args: 66 | // results: Ptr to the data to decode and where to store the decode result. 67 | // nbits: Expected nr. of data bits. (Typically kDenonBits) 68 | // Returns: 69 | // boolean: True if it can decode it, false if it can't. 70 | // 71 | // Status: BETA / Should work fine. 72 | // 73 | // Ref: 74 | // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Denon.cpp 75 | bool IRrecv::decodeDenon(decode_results *results, uint16_t nbits, bool strict) { 76 | // Compliance 77 | if (strict) { 78 | switch (nbits) { 79 | case kDenonBits: 80 | case kDenon48Bits: 81 | case kDenonLegacyBits: 82 | break; 83 | default: 84 | return false; 85 | } 86 | } 87 | 88 | // Denon uses the Sharp & Panasonic(Kaseikyo) protocol for some 89 | // devices, so check for those first. 90 | // It is not exactly like Sharp's protocols, but close enough. 91 | // e.g. The expansion bit is not set for Denon vs. set for Sharp. 92 | // Ditto for Panasonic, it's the same except for a different 93 | // manufacturer code. 94 | 95 | if (!decodeSharp(results, nbits, true, false) && 96 | !decodePanasonic(results, nbits, true, kDenonManufacturer)) { 97 | // We couldn't decode it as expected, so try the old legacy method. 98 | // NOTE: I don't think this following protocol actually exists. 99 | // Looks like a partial version of the Sharp protocol. 100 | if (strict && nbits != kDenonLegacyBits) return false; 101 | 102 | uint64_t data = 0; 103 | uint16_t offset = kStartOffset; 104 | 105 | // Match Header + Data + Footer 106 | if (!matchGeneric(results->rawbuf + offset, &data, 107 | results->rawlen - offset, nbits, 108 | kDenonHdrMark, kDenonHdrSpace, 109 | kDenonBitMark, kDenonOneSpace, 110 | kDenonBitMark, kDenonZeroSpace, 111 | kDenonBitMark, 0, false)) return false; 112 | 113 | // Success 114 | results->bits = nbits; 115 | results->value = data; 116 | results->address = 0; 117 | results->command = 0; 118 | } // Legacy decode. 119 | 120 | // Compliance 121 | if (strict && nbits != results->bits) return false; 122 | 123 | // Success 124 | results->decode_type = DENON; 125 | return true; 126 | } 127 | #endif 128 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Dish.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Todd Treece 2 | // Copyright 2017 David Conran 3 | 4 | #include "IRrecv.h" 5 | #include "IRsend.h" 6 | #include "IRutils.h" 7 | 8 | // DISH support originally by Todd Treece 9 | // http://unionbridge.org/design/ircommand 10 | 11 | // Supports: 12 | // Brand: DISH NETWORK, Model: echostar 301 13 | 14 | // Constants 15 | // Ref: 16 | // https://github.com/marcosamarinho/IRremoteESP8266/blob/master/ir_Dish.cpp 17 | // http://www.hifi-remote.com/wiki/index.php?title=Dish 18 | const uint16_t kDishTick = 100; 19 | const uint16_t kDishHdrMarkTicks = 4; 20 | const uint16_t kDishHdrMark = kDishHdrMarkTicks * kDishTick; 21 | const uint16_t kDishHdrSpaceTicks = 61; 22 | const uint16_t kDishHdrSpace = kDishHdrSpaceTicks * kDishTick; 23 | const uint16_t kDishBitMarkTicks = 4; 24 | const uint16_t kDishBitMark = kDishBitMarkTicks * kDishTick; 25 | const uint16_t kDishOneSpaceTicks = 17; 26 | const uint16_t kDishOneSpace = kDishOneSpaceTicks * kDishTick; 27 | const uint16_t kDishZeroSpaceTicks = 28; 28 | const uint16_t kDishZeroSpace = kDishZeroSpaceTicks * kDishTick; 29 | const uint16_t kDishRptSpaceTicks = kDishHdrSpaceTicks; 30 | const uint16_t kDishRptSpace = kDishRptSpaceTicks * kDishTick; 31 | 32 | #if SEND_DISH 33 | // Send an IR command to a DISH NETWORK device. 34 | // 35 | // Args: 36 | // data: The contents of the command you want to send. 37 | // nbits: The bit size of the command being sent. 38 | // repeat: The number of times you want the command to be repeated. 39 | // 40 | // Status: BETA / Previously working. 41 | // 42 | // Note: 43 | // Dishplayer is a different protocol. 44 | // Typically a DISH device needs to get a command a total of at least 4 45 | // times to accept it. e.g. repeat=3 46 | // 47 | // Here is the LIRC file I found that seems to match the remote codes from the 48 | // oscilloscope: 49 | // DISH NETWORK (echostar 301): 50 | // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx 51 | // 52 | // Ref: 53 | // http://www.hifi-remote.com/wiki/index.php?title=Dish 54 | void IRsend::sendDISH(uint64_t data, uint16_t nbits, uint16_t repeat) { 55 | enableIROut(57600); // Set modulation freq. to 57.6kHz. 56 | // Header is only ever sent once. 57 | mark(kDishHdrMark); 58 | space(kDishHdrSpace); 59 | 60 | sendGeneric(0, 0, // No headers from here on in. 61 | kDishBitMark, kDishOneSpace, kDishBitMark, kDishZeroSpace, 62 | kDishBitMark, kDishRptSpace, data, nbits, 57600, true, repeat, 63 | 50); 64 | } 65 | #endif 66 | 67 | #if DECODE_DISH 68 | // Decode the supplied DISH NETWORK message. 69 | // 70 | // Args: 71 | // results: Ptr to the data to decode and where to store the decode result. 72 | // nbits: Nr. of bits to expect in the data portion. Typically kDishBits. 73 | // strict: Flag to indicate if we strictly adhere to the specification. 74 | // Returns: 75 | // boolean: True if it can decode it, false if it can't. 76 | // 77 | // Status: ALPHA (untested and unconfirmed.) 78 | // 79 | // Note: 80 | // Dishplayer is a different protocol. 81 | // Typically a DISH device needs to get a command a total of at least 4 82 | // times to accept it. 83 | // Ref: 84 | // http://www.hifi-remote.com/wiki/index.php?title=Dish 85 | // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx 86 | // https://github.com/marcosamarinho/IRremoteESP8266/blob/master/ir_Dish.cpp 87 | bool IRrecv::decodeDISH(decode_results *results, uint16_t nbits, bool strict) { 88 | if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) 89 | return false; // Not enough entries to be valid. 90 | if (strict && nbits != kDishBits) return false; // Not strictly compliant. 91 | 92 | uint64_t data = 0; 93 | uint16_t offset = kStartOffset; 94 | 95 | // Match Header + Data + Footer 96 | if (!matchGeneric(results->rawbuf + offset, &data, 97 | results->rawlen - offset, nbits, 98 | kDishHdrMark, kDishHdrSpace, 99 | kDishBitMark, kDishOneSpace, 100 | kDishBitMark, kDishZeroSpace, 101 | kDishBitMark, 102 | // The DISH protocol calls for a repeated message, so 103 | // strictly speaking there should be a code following this. 104 | // Only require it if we are set to strict matching. 105 | strict ? kDishRptSpace : 0, false)) return false; 106 | 107 | // Success 108 | results->decode_type = DISH; 109 | results->bits = nbits; 110 | results->value = data; 111 | results->address = 0; 112 | results->command = 0; 113 | return true; 114 | } 115 | #endif 116 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Electra.h: -------------------------------------------------------------------------------- 1 | // Electra A/C 2 | // 3 | // Copyright 2019 David Conran 4 | 5 | #ifndef IR_ELECTRA_H_ 6 | #define IR_ELECTRA_H_ 7 | 8 | #define __STDC_LIMIT_MACROS 9 | #include 10 | #ifndef UNIT_TEST 11 | #include 12 | #endif 13 | #include "IRremoteESP8266.h" 14 | #include "IRsend.h" 15 | #ifdef UNIT_TEST 16 | #include "IRsend_test.h" 17 | #endif 18 | 19 | // Supports: 20 | // Brand: AUX, Model: KFR-35GW/BpNFW=3 A/C 21 | // Brand: AUX, Model: YKR-T/011 remote 22 | 23 | // Ref: 24 | // https://github.com/ToniA/arduino-heatpumpir/blob/master/AUXHeatpumpIR.cpp 25 | 26 | // Constants 27 | // state[1] 28 | const uint8_t kElectraAcTempMask = 0b11111000; 29 | const uint8_t kElectraAcMinTemp = 16; // 16C 30 | const uint8_t kElectraAcMaxTemp = 32; // 32C 31 | const uint8_t kElectraAcOffsetTemp = 8; 32 | const uint8_t kElectraAcSwingVMask = 0b00000111; 33 | // state[2] 34 | const uint8_t kElectraAcSwingHMask = 0b11100000; 35 | // state[4] 36 | const uint8_t kElectraAcFanMask = 0b11100000; 37 | const uint8_t kElectraAcFanAuto = 0b101; 38 | const uint8_t kElectraAcFanLow = 0b011; 39 | const uint8_t kElectraAcFanMed = 0b010; 40 | const uint8_t kElectraAcFanHigh = 0b001; 41 | // state[6] 42 | const uint8_t kElectraAcModeMask = 0b11100000; 43 | const uint8_t kElectraAcAuto = 0b000; 44 | const uint8_t kElectraAcCool = 0b001; 45 | const uint8_t kElectraAcDry = 0b010; 46 | const uint8_t kElectraAcHeat = 0b100; 47 | const uint8_t kElectraAcFan = 0b110; 48 | // state[9] 49 | const uint8_t kElectraAcPowerMask = 0b00100000; 50 | 51 | 52 | // Classes 53 | class IRElectraAc { 54 | public: 55 | explicit IRElectraAc(const uint16_t pin, const bool inverted = false, 56 | const bool use_modulation = true); 57 | 58 | void stateReset(void); 59 | #if SEND_ELECTRA_AC 60 | void send(const uint16_t repeat = kElectraAcMinRepeat); 61 | uint8_t calibrate(void) { return _irsend.calibrate(); } 62 | #endif // SEND_ELECTRA_AC 63 | void begin(void); 64 | void on(void); 65 | void off(void); 66 | void setPower(const bool on); 67 | bool getPower(void); 68 | void setMode(const uint8_t mode); 69 | uint8_t getMode(void); 70 | void setTemp(const uint8_t temp); 71 | uint8_t getTemp(void); 72 | void setFan(const uint8_t speed); 73 | uint8_t getFan(void); 74 | void setSwingV(const bool on); 75 | bool getSwingV(void); 76 | void setSwingH(const bool on); 77 | bool getSwingH(void); 78 | uint8_t* getRaw(void); 79 | void setRaw(const uint8_t new_code[], 80 | const uint16_t length = kElectraAcStateLength); 81 | static bool validChecksum(const uint8_t state[], 82 | const uint16_t length = kElectraAcStateLength); 83 | static uint8_t calcChecksum(const uint8_t state[], 84 | const uint16_t length = kElectraAcStateLength); 85 | String toString(void); 86 | uint8_t convertMode(const stdAc::opmode_t mode); 87 | uint8_t convertFan(const stdAc::fanspeed_t speed); 88 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 89 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 90 | stdAc::state_t toCommon(void); 91 | #ifndef UNIT_TEST 92 | 93 | private: 94 | IRsend _irsend; 95 | #else 96 | IRsendTest _irsend; 97 | #endif 98 | // The state of the IR remote in IR code form. 99 | uint8_t remote_state[kElectraAcStateLength]; 100 | void checksum(const uint16_t length = kElectraAcStateLength); 101 | }; 102 | #endif // IR_ELECTRA_H_ 103 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_GICable.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2018 David Conran 2 | // G.I. Cable 3 | 4 | #define __STDC_LIMIT_MACROS 5 | #include 6 | #include 7 | #include "IRrecv.h" 8 | #include "IRsend.h" 9 | #include "IRutils.h" 10 | 11 | // Ref: 12 | // https://github.com/cyborg5/IRLib2/blob/master/IRLibProtocols/IRLib_P09_GICable.h 13 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/447 14 | 15 | // Constants 16 | const uint16_t kGicableHdrMark = 9000; 17 | const uint16_t kGicableHdrSpace = 4400; 18 | const uint16_t kGicableBitMark = 550; 19 | const uint16_t kGicableOneSpace = 4400; 20 | const uint16_t kGicableZeroSpace = 2200; 21 | const uint16_t kGicableRptSpace = 2200; 22 | const uint32_t kGicableMinCommandLength = 99600; 23 | const uint32_t kGicableMinGap = 24 | kGicableMinCommandLength - 25 | (kGicableHdrMark + kGicableHdrSpace + 26 | kGicableBits * (kGicableBitMark + kGicableOneSpace) + kGicableBitMark); 27 | 28 | #if SEND_GICABLE 29 | // Send a raw G.I. Cable formatted message. 30 | // 31 | // Args: 32 | // data: The message to be sent. 33 | // nbits: The number of bits of the message to be sent. 34 | // Typically kGicableBits. 35 | // repeat: The number of times the command is to be repeated. 36 | // 37 | // Status: Alpha / Untested. 38 | // 39 | // Ref: 40 | void IRsend::sendGICable(uint64_t data, uint16_t nbits, uint16_t repeat) { 41 | sendGeneric(kGicableHdrMark, kGicableHdrSpace, kGicableBitMark, 42 | kGicableOneSpace, kGicableBitMark, kGicableZeroSpace, 43 | kGicableBitMark, kGicableMinGap, kGicableMinCommandLength, data, 44 | nbits, 39, true, 0, // Repeats are handled later. 45 | 50); 46 | // Message repeat sequence. 47 | if (repeat) 48 | sendGeneric(kGicableHdrMark, kGicableRptSpace, 0, 0, 0, 49 | 0, // No actual data sent. 50 | kGicableBitMark, kGicableMinGap, kGicableMinCommandLength, 0, 51 | 0, // No data to be sent. 52 | 39, true, repeat - 1, 50); 53 | } 54 | #endif // SEND_GICABLE 55 | 56 | #if DECODE_GICABLE 57 | // Decode the supplied G.I. Cable message. 58 | // 59 | // Args: 60 | // results: Ptr to the data to decode and where to store the decode result. 61 | // nbits: The number of data bits to expect. Typically kGicableBits. 62 | // strict: Flag indicating if we should perform strict matching. 63 | // Returns: 64 | // boolean: True if it can decode it, false if it can't. 65 | // 66 | // Status: Alpha / Not tested against a real device. 67 | bool IRrecv::decodeGICable(decode_results *results, uint16_t nbits, 68 | bool strict) { 69 | if (strict && nbits != kGicableBits) 70 | return false; // Not strictly an GICABLE message. 71 | 72 | uint64_t data = 0; 73 | uint16_t offset = kStartOffset; 74 | // Match Header + Data + Footer 75 | uint16_t used; 76 | used = matchGeneric(results->rawbuf + offset, &data, 77 | results->rawlen - offset, nbits, 78 | kGicableHdrMark, kGicableHdrSpace, 79 | kGicableBitMark, kGicableOneSpace, 80 | kGicableBitMark, kGicableZeroSpace, 81 | kGicableBitMark, kGicableMinGap, true); 82 | if (!used) return false; 83 | offset += used; 84 | // Compliance 85 | if (strict) { 86 | // We expect a repeat frame. 87 | if (!matchMark(results->rawbuf[offset++], kGicableHdrMark)) return false; 88 | if (!matchSpace(results->rawbuf[offset++], kGicableRptSpace)) return false; 89 | if (!matchMark(results->rawbuf[offset++], kGicableBitMark)) return false; 90 | } 91 | 92 | // Success 93 | results->bits = nbits; 94 | results->value = data; 95 | results->decode_type = GICABLE; 96 | results->command = 0; 97 | results->address = 0; 98 | return true; 99 | } 100 | #endif // DECODE_GICABLE 101 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_GlobalCache.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Hisham Khalifa 2 | // Copyright 2017 David Conran 3 | 4 | // Global Cache IR format sender originally added by Hisham Khalifa 5 | // (http://www.hishamkhalifa.com) 6 | 7 | #include 8 | #include "IRsend.h" 9 | 10 | // Constants 11 | const uint16_t kGlobalCacheMaxRepeat = 50; 12 | const uint32_t kGlobalCacheMinUsec = 80; 13 | const uint8_t kGlobalCacheFreqIndex = 0; 14 | const uint8_t kGlobalCacheRptIndex = kGlobalCacheFreqIndex + 1; 15 | const uint8_t kGlobalCacheRptStartIndex = kGlobalCacheRptIndex + 1; 16 | const uint8_t kGlobalCacheStartIndex = kGlobalCacheRptStartIndex + 1; 17 | 18 | #if SEND_GLOBALCACHE 19 | // Send a shortened GlobalCache (GC) IRdb/control tower formatted message. 20 | // 21 | // Args: 22 | // buf: An array of uint16_t containing the shortened GlobalCache data. 23 | // len: Nr. of entries in the buf[] array. 24 | // 25 | // Status: STABLE / Known working. 26 | // 27 | // Note: 28 | // Global Cache format without the emitter ID or request ID. 29 | // Starts at the frequency (Hertz), followed by nr. of times to emit (count), 30 | // then the offset for repeats (where a repeat will start from), 31 | // then the rest of entries are the actual IR message as units of periodic 32 | // time. 33 | // e.g. sendir,1:1,1,38000,1,1,9,70,9,30,9,... -> 38000,1,1,9,70,9,30,9,... 34 | // Ref: 35 | // https://irdb.globalcache.com/Home/Database 36 | void IRsend::sendGC(uint16_t buf[], uint16_t len) { 37 | uint16_t hz = buf[kGlobalCacheFreqIndex]; // GC frequency is in Hz. 38 | enableIROut(hz); 39 | uint32_t periodic_time = calcUSecPeriod(hz, false); 40 | uint8_t emits = 41 | std::min(buf[kGlobalCacheRptIndex], (uint16_t)kGlobalCacheMaxRepeat); 42 | // Repeat 43 | for (uint8_t repeat = 0; repeat < emits; repeat++) { 44 | // First time through, start at the beginning (kGlobalCacheStartIndex), 45 | // otherwise for repeats, we start a specified offset from that. 46 | uint16_t offset = kGlobalCacheStartIndex; 47 | if (repeat) offset += buf[kGlobalCacheRptStartIndex] - 1; 48 | // Data 49 | for (; offset < len; offset++) { 50 | // Convert periodic units to microseconds. 51 | // Minimum is kGlobalCacheMinUsec for actual GC units. 52 | uint32_t microseconds = 53 | std::max(buf[offset] * periodic_time, kGlobalCacheMinUsec); 54 | // These codes start at an odd index (not even as with sendRaw). 55 | if (offset & 1) // Odd bit. 56 | mark(microseconds); 57 | else // Even bit. 58 | space(microseconds); 59 | } 60 | } 61 | // It's possible that we've ended on a mark(), thus ensure the LED is off. 62 | ledOff(); 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Goodweather.h: -------------------------------------------------------------------------------- 1 | // Goodweather A/C 2 | // 3 | // Copyright 2019 ribeirodanielf 4 | // Copyright 2019 David Conran 5 | 6 | // Supports: 7 | // Brand: Goodweather, Model: ZH/JT-03 remote 8 | 9 | #ifndef IR_GOODWEATHER_H_ 10 | #define IR_GOODWEATHER_H_ 11 | 12 | #define __STDC_LIMIT_MACROS 13 | #include 14 | #ifndef UNIT_TEST 15 | #include 16 | #endif 17 | #include "IRremoteESP8266.h" 18 | #include "IRsend.h" 19 | #ifdef UNIT_TEST 20 | #include "IRsend_test.h" 21 | #endif 22 | 23 | // Ref: 24 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/697 25 | 26 | // Constants 27 | 28 | // Timing 29 | const uint16_t kGoodweatherBitMark = 640; 30 | const uint16_t kGoodweatherOneSpace = 580; 31 | const uint16_t kGoodweatherZeroSpace = 1600; 32 | const uint16_t kGoodweatherHdrMark = 6800; 33 | const uint16_t kGoodweatherHdrSpace = 6800; 34 | 35 | // Masks 36 | const uint8_t kGoodweatherBitLight = 8; 37 | const uint64_t kGoodweatherLightMask = 0x1ULL << kGoodweatherBitLight; 38 | const uint8_t kGoodweatherBitTurbo = kGoodweatherBitLight + 3; // 11 39 | const uint64_t kGoodweatherTurboMask = 0x1ULL << kGoodweatherBitTurbo; 40 | const uint8_t kGoodweatherBitCommand = kGoodweatherBitTurbo + 5; // 16 41 | const uint64_t kGoodweatherCommandMask = 0xFULL << kGoodweatherBitCommand; 42 | const uint8_t kGoodweatherBitSleep = kGoodweatherBitCommand + 8; // 24 43 | const uint64_t kGoodweatherSleepMask = 0x1ULL << kGoodweatherBitSleep; 44 | const uint8_t kGoodweatherBitPower = kGoodweatherBitSleep + 1; // 25 45 | const uint64_t kGoodweatherPowerMask = 0x1ULL << kGoodweatherBitPower; 46 | const uint8_t kGoodweatherBitSwing = kGoodweatherBitPower + 1; // 26 47 | const uint64_t kGoodweatherSwingMask = 0x3ULL << kGoodweatherBitSwing; 48 | const uint8_t kGoodweatherBitFan = kGoodweatherBitSwing + 3; // 29 49 | const uint64_t kGoodweatherFanMask = 0x3ULL << kGoodweatherBitFan; 50 | const uint8_t kGoodweatherBitTemp = kGoodweatherBitFan + 3; // 32 51 | const uint64_t kGoodweatherTempMask = 0xFULL << kGoodweatherBitTemp; 52 | const uint8_t kGoodweatherBitMode = kGoodweatherBitTemp + 5; // 37 53 | const uint64_t kGoodweatherModeMask = 0x7ULL << kGoodweatherBitMode; 54 | 55 | // Modes 56 | const uint8_t kGoodweatherAuto = 0b000; 57 | const uint8_t kGoodweatherCool = 0b001; 58 | const uint8_t kGoodweatherDry = 0b010; 59 | const uint8_t kGoodweatherFan = 0b011; 60 | const uint8_t kGoodweatherHeat = 0b100; 61 | const uint8_t kGoodweatherSwingFast = 0b00; 62 | const uint8_t kGoodweatherSwingSlow = 0b01; 63 | const uint8_t kGoodweatherSwingOff = 0b10; 64 | // Fan Control 65 | const uint8_t kGoodweatherFanAuto = 0b00; 66 | const uint8_t kGoodweatherFanHigh = 0b01; 67 | const uint8_t kGoodweatherFanMed = 0b10; 68 | const uint8_t kGoodweatherFanLow = 0b11; 69 | // Temperature 70 | const uint8_t kGoodweatherTempMin = 16; // Celsius 71 | const uint8_t kGoodweatherTempMax = 31; // Celsius 72 | // Commands 73 | const uint8_t kGoodweatherCmdPower = 0x00; 74 | const uint8_t kGoodweatherCmdMode = 0x01; 75 | const uint8_t kGoodweatherCmdUpTemp = 0x02; 76 | const uint8_t kGoodweatherCmdDownTemp = 0x03; 77 | const uint8_t kGoodweatherCmdSwing = 0x04; 78 | const uint8_t kGoodweatherCmdFan = 0x05; 79 | const uint8_t kGoodweatherCmdTimer = 0x06; 80 | const uint8_t kGoodweatherCmdAirFlow = 0x07; 81 | const uint8_t kGoodweatherCmdHold = 0x08; 82 | const uint8_t kGoodweatherCmdSleep = 0x09; 83 | const uint8_t kGoodweatherCmdTurbo = 0x0A; 84 | const uint8_t kGoodweatherCmdLight = 0x0B; 85 | 86 | 87 | // Classes 88 | class IRGoodweatherAc { 89 | public: 90 | explicit IRGoodweatherAc(const uint16_t pin, const bool inverted = false, 91 | const bool use_modulation = true); 92 | 93 | void stateReset(void); 94 | #if SEND_GOODWEATHER 95 | void send(const uint16_t repeat = kGoodweatherMinRepeat); 96 | uint8_t calibrate(void) { return _irsend.calibrate(); } 97 | #endif // SEND_GOODWEATHER 98 | void begin(void); 99 | void on(void); 100 | void off(void); 101 | void setPower(const bool on); 102 | bool getPower(void); 103 | void setTemp(const uint8_t temp); 104 | uint8_t getTemp(void); 105 | void setFan(const uint8_t speed); 106 | uint8_t getFan(void); 107 | void setMode(const uint8_t mode); 108 | uint8_t getMode(); 109 | void setSwing(const uint8_t speed); 110 | uint8_t getSwing(void); 111 | void setSleep(const bool toggle); 112 | bool getSleep(void); 113 | void setTurbo(const bool toggle); 114 | bool getTurbo(void); 115 | void setLight(const bool toggle); 116 | bool getLight(void); 117 | void setCommand(const uint8_t cmd); 118 | uint8_t getCommand(void); 119 | uint64_t getRaw(void); 120 | void setRaw(const uint64_t state); 121 | uint8_t convertMode(const stdAc::opmode_t mode); 122 | uint8_t convertFan(const stdAc::fanspeed_t speed); 123 | uint8_t convertSwingV(const stdAc::swingv_t swingv); 124 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 125 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 126 | stdAc::state_t toCommon(void); 127 | String toString(); 128 | #ifndef UNIT_TEST 129 | 130 | private: 131 | IRsend _irsend; 132 | #else 133 | IRsendTest _irsend; 134 | #endif 135 | uint64_t remote; // The state of the IR remote in IR code form. 136 | }; 137 | #endif // IR_GOODWEATHER_H_ 138 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Hitachi.h: -------------------------------------------------------------------------------- 1 | // Hitachi A/C 2 | // 3 | // Copyright 2018 David Conran 4 | 5 | // Supports: 6 | // Brand: Hitachi, Model: RAS-35THA6 remote 7 | // Brand: Hitachi, Model: LT0541-HTA remote 8 | // Brand: Hitachi, Model: Series VI A/C (Circa 2007) 9 | 10 | #ifndef IR_HITACHI_H_ 11 | #define IR_HITACHI_H_ 12 | 13 | #define __STDC_LIMIT_MACROS 14 | #include 15 | #ifndef UNIT_TEST 16 | #include 17 | #endif 18 | #include "IRremoteESP8266.h" 19 | #include "IRsend.h" 20 | #ifdef UNIT_TEST 21 | #include "IRsend_test.h" 22 | #endif 23 | 24 | // Constants 25 | const uint8_t kHitachiAcAuto = 2; 26 | const uint8_t kHitachiAcHeat = 3; 27 | const uint8_t kHitachiAcCool = 4; 28 | const uint8_t kHitachiAcDry = 5; 29 | const uint8_t kHitachiAcFan = 0xC; 30 | const uint8_t kHitachiAcFanAuto = 1; 31 | const uint8_t kHitachiAcFanLow = 2; 32 | const uint8_t kHitachiAcFanMed = 3; 33 | const uint8_t kHitachiAcFanHigh = 5; 34 | const uint8_t kHitachiAcMinTemp = 16; // 16C 35 | const uint8_t kHitachiAcMaxTemp = 32; // 32C 36 | const uint8_t kHitachiAcAutoTemp = 23; // 23C 37 | 38 | // Classes 39 | class IRHitachiAc { 40 | public: 41 | explicit IRHitachiAc(const uint16_t pin, const bool inverted = false, 42 | const bool use_modulation = true); 43 | 44 | void stateReset(void); 45 | #if SEND_HITACHI_AC 46 | void send(const uint16_t repeat = kHitachiAcDefaultRepeat); 47 | uint8_t calibrate(void) { return _irsend.calibrate(); } 48 | #endif // SEND_HITACHI_AC 49 | void begin(void); 50 | void on(void); 51 | void off(void); 52 | void setPower(const bool on); 53 | bool getPower(void); 54 | void setTemp(const uint8_t temp); 55 | uint8_t getTemp(void); 56 | void setFan(const uint8_t speed); 57 | uint8_t getFan(void); 58 | void setMode(const uint8_t mode); 59 | uint8_t getMode(void); 60 | void setSwingVertical(const bool on); 61 | bool getSwingVertical(void); 62 | void setSwingHorizontal(const bool on); 63 | bool getSwingHorizontal(void); 64 | uint8_t* getRaw(void); 65 | void setRaw(const uint8_t new_code[], 66 | const uint16_t length = kHitachiAcStateLength); 67 | static bool validChecksum(const uint8_t state[], 68 | const uint16_t length = kHitachiAcStateLength); 69 | static uint8_t calcChecksum(const uint8_t state[], 70 | const uint16_t length = kHitachiAcStateLength); 71 | uint8_t convertMode(const stdAc::opmode_t mode); 72 | uint8_t convertFan(const stdAc::fanspeed_t speed); 73 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 74 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 75 | stdAc::state_t toCommon(void); 76 | String toString(void); 77 | #ifndef UNIT_TEST 78 | 79 | private: 80 | IRsend _irsend; 81 | #else 82 | IRsendTest _irsend; 83 | #endif 84 | // The state of the IR remote in IR code form. 85 | uint8_t remote_state[kHitachiAcStateLength]; 86 | void checksum(const uint16_t length = kHitachiAcStateLength); 87 | uint8_t _previoustemp; 88 | }; 89 | 90 | #endif // IR_HITACHI_H_ 91 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Inax.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 David Conran (crankyoldgit) 2 | // Support for an IR controlled Robot Toilet 3 | 4 | #include 5 | #include "IRrecv.h" 6 | #include "IRsend.h" 7 | #include "IRutils.h" 8 | 9 | // Supports: 10 | // Brand: Lixil, Model: Inax DT-BA283 Toilet 11 | 12 | // Documentation: 13 | // https://www.lixil-manual.com/GCW-1365-16050/GCW-1365-16050.pdf 14 | 15 | // Constants 16 | // Ref: 17 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/706 18 | const uint16_t kInaxTick = 500; 19 | const uint16_t kInaxHdrMark = 9000; 20 | const uint16_t kInaxHdrSpace = 4500; 21 | const uint16_t kInaxBitMark = 560; 22 | const uint16_t kInaxOneSpace = 1675; 23 | const uint16_t kInaxZeroSpace = kInaxBitMark; 24 | const uint16_t kInaxMinGap = 40000; 25 | 26 | #if SEND_INAX 27 | // Send a Inax Toilet formatted message. 28 | // 29 | // Args: 30 | // data: The message to be sent. 31 | // nbits: The bit size of the message being sent. typically kInaxBits. 32 | // repeat: The number of times the message is to be repeated. 33 | // 34 | // Status: BETA / Should be working. 35 | // 36 | // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/706 37 | void IRsend::sendInax(const uint64_t data, const uint16_t nbits, 38 | const uint16_t repeat) { 39 | sendGeneric(kInaxHdrMark, kInaxHdrSpace, 40 | kInaxBitMark, kInaxOneSpace, 41 | kInaxBitMark, kInaxZeroSpace, 42 | kInaxBitMark, kInaxMinGap, 43 | data, nbits, 38, true, repeat, kDutyDefault); 44 | } 45 | #endif 46 | 47 | #if DECODE_INAX 48 | // Decode the supplied Inax Toilet message. 49 | // 50 | // Args: 51 | // results: Ptr to the data to decode and where to store the decode result. 52 | // nbits: Nr. of bits to expect in the data portion. 53 | // Typically kInaxBits. 54 | // strict: Flag to indicate if we strictly adhere to the specification. 55 | // Returns: 56 | // boolean: True if it can decode it, false if it can't. 57 | // 58 | // Status: Stable / Known working. 59 | // 60 | bool IRrecv::decodeInax(decode_results *results, const uint16_t nbits, 61 | const bool strict) { 62 | if (strict && nbits != kInaxBits) 63 | return false; // We expect Inax to be a certain sized message. 64 | 65 | uint64_t data = 0; 66 | uint16_t offset = kStartOffset; 67 | 68 | // Match Header + Data + Footer 69 | if (!matchGeneric(results->rawbuf + offset, &data, 70 | results->rawlen - offset, nbits, 71 | kInaxHdrMark, kInaxHdrSpace, 72 | kInaxBitMark, kInaxOneSpace, 73 | kInaxBitMark, kInaxZeroSpace, 74 | kInaxBitMark, kInaxMinGap, true)) return false; 75 | // Success 76 | results->bits = nbits; 77 | results->value = data; 78 | results->decode_type = INAX; 79 | results->command = 0; 80 | results->address = 0; 81 | return true; 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_LG.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | // Supports: 4 | // Brand: LG, Model: 6711A20083V remote 5 | // Brand: LG, Model: AKB74395308 remote 6 | 7 | #ifndef IR_LG_H_ 8 | #define IR_LG_H_ 9 | 10 | #define __STDC_LIMIT_MACROS 11 | #include 12 | 13 | uint8_t calcLGChecksum(uint16_t data); 14 | 15 | #endif // IR_LG_H_ 16 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Lasertag.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | // Lasertag 3 | 4 | #include 5 | #include "IRrecv.h" 6 | #include "IRsend.h" 7 | #include "IRutils.h" 8 | 9 | // Constants 10 | const uint16_t kLasertagMinSamples = 13; 11 | const uint16_t kLasertagTick = 333; 12 | const uint32_t kLasertagMinGap = kDefaultMessageGap; // Just a guess. 13 | const uint8_t kLasertagTolerance = 0; // Percentage error margin. 14 | const uint16_t kLasertagExcess = 0; // See kMarkExcess. 15 | const uint16_t kLasertagDelta = 150; // Use instead of Excess and Tolerance. 16 | const int16_t kSpace = 1; 17 | const int16_t kMark = 0; 18 | 19 | #if SEND_LASERTAG 20 | // Send a Lasertag packet. 21 | // This protocol is pretty much just raw Manchester encoding. 22 | // 23 | // Args: 24 | // data: The message you wish to send. 25 | // nbits: Bit size of the protocol you want to send. 26 | // repeat: Nr. of extra times the data will be sent. 27 | // 28 | // Status: STABLE / Working. 29 | // 30 | void IRsend::sendLasertag(uint64_t data, uint16_t nbits, uint16_t repeat) { 31 | if (nbits > sizeof(data) * 8) return; // We can't send something that big. 32 | 33 | // Set 36kHz IR carrier frequency & a 1/4 (25%) duty cycle. 34 | // NOTE: duty cycle is not confirmed. Just guessing based on RC5/6 protocols. 35 | enableIROut(36, 25); 36 | 37 | for (uint16_t i = 0; i <= repeat; i++) { 38 | // Data 39 | for (uint64_t mask = 1ULL << (nbits - 1); mask; mask >>= 1) 40 | if (data & mask) { // 1 41 | space(kLasertagTick); // 1 is space, then mark. 42 | mark(kLasertagTick); 43 | } else { // 0 44 | mark(kLasertagTick); // 0 is mark, then space. 45 | space(kLasertagTick); 46 | } 47 | // Footer 48 | space(kLasertagMinGap); 49 | } 50 | } 51 | #endif // SEND_LASERTAG 52 | 53 | #if DECODE_LASERTAG 54 | // Decode the supplied Lasertag message. 55 | // This protocol is pretty much just raw Manchester encoding. 56 | // 57 | // Args: 58 | // results: Ptr to the data to decode and where to store the decode result. 59 | // nbits: The number of data bits to expect. 60 | // strict: Flag indicating if we should perform strict matching. 61 | // Returns: 62 | // boolean: True if it can decode it, false if it can't. 63 | // 64 | // Status: BETA / Appears to be working 90% of the time. 65 | // 66 | // Ref: 67 | // http://www.sbprojects.com/knowledge/ir/rc5.php 68 | // https://en.wikipedia.org/wiki/RC-5 69 | // https://en.wikipedia.org/wiki/Manchester_code 70 | bool IRrecv::decodeLasertag(decode_results *results, uint16_t nbits, 71 | bool strict) { 72 | if (results->rawlen < kLasertagMinSamples) return false; 73 | 74 | // Compliance 75 | if (strict && nbits != kLasertagBits) return false; 76 | 77 | uint16_t offset = kStartOffset; 78 | uint16_t used = 0; 79 | uint64_t data = 0; 80 | uint16_t actual_bits = 0; 81 | 82 | // No Header 83 | 84 | // Data 85 | for (; offset <= results->rawlen; actual_bits++) { 86 | int16_t levelA = 87 | getRClevel(results, &offset, &used, kLasertagTick, kLasertagTolerance, 88 | kLasertagExcess, kLasertagDelta); 89 | int16_t levelB = 90 | getRClevel(results, &offset, &used, kLasertagTick, kLasertagTolerance, 91 | kLasertagExcess, kLasertagDelta); 92 | if (levelA == kSpace && levelB == kMark) { 93 | data = (data << 1) | 1; // 1 94 | } else { 95 | if (levelA == kMark && levelB == kSpace) { 96 | data <<= 1; // 0 97 | } else { 98 | break; 99 | } 100 | } 101 | } 102 | // Footer (None) 103 | 104 | // Compliance 105 | if (actual_bits < nbits) return false; // Less data than we expected. 106 | if (strict && actual_bits != kLasertagBits) return false; 107 | 108 | // Success 109 | results->decode_type = LASERTAG; 110 | results->value = data; 111 | results->address = data & 0xF; // Unit 112 | results->command = data >> 4; // Team 113 | results->repeat = false; 114 | results->bits = actual_bits; 115 | return true; 116 | } 117 | #endif // DECODE_LASERTAG 118 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Lego.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 David Conran 2 | 3 | #include 4 | #include "IRrecv.h" 5 | #include "IRsend.h" 6 | #include "IRutils.h" 7 | 8 | // LEGO 9 | // (LEGO is a Registrated Trademark of the Lego Group.) 10 | // 11 | // Supports: 12 | // Brand: LEGO Power Functions, Model: IR Receiver 13 | // 14 | // Ref: 15 | // - https://github.com/crankyoldgit/IRremoteESP8266/issues/641 16 | // - https://github.com/crankyoldgit/IRremoteESP8266/files/2974525/LEGO_Power_Functions_RC_v120.pdf 17 | 18 | // Constants 19 | const uint16_t kLegoPfBitMark = 158; 20 | const uint16_t kLegoPfHdrSpace = 1026; 21 | const uint16_t kLegoPfZeroSpace = 263; 22 | const uint16_t kLegoPfOneSpace = 553; 23 | const uint32_t kLegoPfMinCommandLength = 16000; // 16ms 24 | 25 | 26 | #if SEND_LEGOPF 27 | // Send a LEGO Power Functions message. 28 | // 29 | // Args: 30 | // data: Contents of the message to be sent. 31 | // nbits: Nr. of bits of data to be sent. Typically kLegoPfBits. 32 | // repeat: Nr. of additional times the message is to be sent. 33 | // Note: Non-zero repeats results in at least 5 messages per spec. 34 | // 35 | // Status: Beta / Should work. 36 | void IRsend::sendLegoPf(const uint64_t data, const uint16_t nbits, 37 | const uint16_t repeat) { 38 | uint8_t channelid = ((data >> (nbits - 4)) & 0b11) + 1; 39 | if (repeat) { 40 | // We are in repeat mode. 41 | // Spec says a pause before transmittion. 42 | if (channelid < 4) space((4 - channelid) * kLegoPfMinCommandLength); 43 | // Spec says there are a minimum of 5 message repeats. 44 | for (uint16_t r = 0; r < std::max(repeat, (uint16_t)5); r++) { 45 | // Lego has a special repeat mode which repeats a message with varying 46 | // start to start times. 47 | sendGeneric(kLegoPfBitMark, kLegoPfHdrSpace, 48 | kLegoPfBitMark, kLegoPfOneSpace, 49 | kLegoPfBitMark, kLegoPfZeroSpace, 50 | kLegoPfBitMark, kLegoPfHdrSpace, 51 | ((r < 2) ? 5 : (6 + 2 * channelid)) * kLegoPfMinCommandLength, 52 | data, nbits, 38000, true, 0, kDutyDefault); 53 | } 54 | } else { // No repeat, just a simple message. 55 | sendGeneric(kLegoPfBitMark, kLegoPfHdrSpace, 56 | kLegoPfBitMark, kLegoPfOneSpace, 57 | kLegoPfBitMark, kLegoPfZeroSpace, 58 | kLegoPfBitMark, kLegoPfHdrSpace, 59 | kLegoPfMinCommandLength * 5, 60 | data, nbits, 38000, true, 0, kDutyDefault); 61 | } 62 | } 63 | #endif // SEND_LEGO 64 | 65 | #if DECODE_LEGOPF 66 | // Decode the supplied LEGO Power Functions message. 67 | // 68 | // Args: 69 | // results: Ptr to the data to decode and where to store the decode result. 70 | // nbits: The number of data bits to expect. Typically kLegoPfBits. 71 | // strict: Flag indicating if we should perform strict matching. 72 | // Returns: 73 | // boolean: True if it can decode it, false if it can't. 74 | // 75 | // Status: Alpha / Untested. 76 | bool IRrecv::decodeLegoPf(decode_results* results, 77 | const uint16_t nbits, const bool strict) { 78 | // Check if can possibly be a valid LEGO message. 79 | if (results->rawlen < 2 * nbits + kHeader + kFooter - 1) return false; 80 | if (strict && nbits != kLegoPfBits) return false; // Not what is expected 81 | 82 | uint64_t data = 0; 83 | uint16_t offset = kStartOffset; 84 | 85 | // Match Header + Data + Footer 86 | if (!matchGeneric(results->rawbuf + offset, &data, 87 | results->rawlen - offset, nbits, 88 | kLegoPfBitMark, kLegoPfHdrSpace, 89 | kLegoPfBitMark, kLegoPfOneSpace, 90 | kLegoPfBitMark, kLegoPfZeroSpace, 91 | kLegoPfBitMark, kLegoPfMinCommandLength, 92 | true)) return false; 93 | // Compliance 94 | if (strict) { 95 | // Verify the Longitudinal Redundancy Check (LRC) 96 | uint16_t lrc_data = data; 97 | uint8_t lrc = 0xF; 98 | for (uint8_t i = 0; i < 4; i++) { 99 | lrc ^= (lrc_data & 0xF); 100 | lrc_data >>= 4; 101 | } 102 | if (lrc) return false; 103 | } 104 | 105 | // Success 106 | results->decode_type = LEGOPF; 107 | results->bits = nbits; 108 | results->value = data; 109 | results->address = ((data >> (nbits - 4)) & 0b11) + 1; // Channel Id 110 | results->command = (data >> 4) & 0xFF; // Stuff between Channel Id and LRC. 111 | return true; 112 | } 113 | #endif // DECODE_LEGOPF 114 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Magiquest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 mpflaga 2 | // Copyright 2015 kitlaan 3 | // Copyright 2017 Jason kendall, David Conran 4 | 5 | #ifndef IR_MAGIQUEST_H_ 6 | #define IR_MAGIQUEST_H_ 7 | 8 | #define __STDC_LIMIT_MACROS 9 | #include 10 | #include "IRremoteESP8266.h" 11 | #include "IRsend.h" 12 | 13 | // MagiQuest packet is both Wand ID and magnitude of swish and flick 14 | union magiquest { 15 | uint64_t llword; 16 | uint8_t byte[8]; 17 | // uint16_t word[4]; 18 | uint32_t lword[2]; 19 | struct { 20 | uint16_t magnitude; 21 | uint32_t wand_id; 22 | uint8_t padding; 23 | uint8_t scrap; 24 | } cmd; 25 | }; 26 | 27 | const uint16_t kMagiQuestTotalUsec = 1150; 28 | const uint8_t kMagiQuestZeroRatio = 30; // usually <= ~25% 29 | const uint8_t kMagiQuestOneRatio = 38; // usually >= ~50% 30 | const uint16_t kMagiQuestMarkZero = 280; 31 | const uint16_t kMagiQuestSpaceZero = 850; 32 | const uint16_t kMagiQuestMarkOne = 580; 33 | const uint16_t kMagiQuestSpaceOne = 600; 34 | const uint32_t kMagiQuestGap = kDefaultMessageGap; // Just a guess. 35 | #endif // IR_MAGIQUEST_H_ 36 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Midea.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | // Midea 3 | 4 | // Supports: 5 | // Brand: Pioneer System, Model: RYBO12GMFILCAD A/C (12K BTU) 6 | // Brand: Pioneer System, Model: RUBO18GMFILCAD A/C (18K BTU) 7 | // Brand: Comfee, Model: MPD1-12CRN7 A/C 8 | // Brand: Keystone, Model: RG57H4(B)BGEF remote 9 | 10 | #ifndef IR_MIDEA_H_ 11 | #define IR_MIDEA_H_ 12 | 13 | #define __STDC_LIMIT_MACROS 14 | #include 15 | #ifdef ARDUINO 16 | #include 17 | #endif 18 | #include "IRremoteESP8266.h" 19 | #include "IRsend.h" 20 | #ifdef UNIT_TEST 21 | #include "IRsend_test.h" 22 | #endif 23 | 24 | // Midea added by crankyoldgit & bwze 25 | // Ref: 26 | // https://docs.google.com/spreadsheets/d/1TZh4jWrx4h9zzpYUI9aYXMl1fYOiqu-xVuOOMqagxrs/edit?usp=sharing 27 | 28 | // Constants 29 | const uint8_t kMideaACCool = 0; // 0b000 30 | const uint8_t kMideaACDry = 1; // 0b001 31 | const uint8_t kMideaACAuto = 2; // 0b010 32 | const uint8_t kMideaACHeat = 3; // 0b011 33 | const uint8_t kMideaACFan = 4; // 0b100 34 | const uint8_t kMideaACFanAuto = 0; // 0b000 35 | const uint8_t kMideaACFanLow = 1; // 0b001 36 | const uint8_t kMideaACFanMed = 2; // 0b010 37 | const uint8_t kMideaACFanHigh = 3; // 0b011 38 | const uint64_t kMideaACPower = 1ULL << 39; 39 | const uint64_t kMideaACSleep = 1ULL << 38; 40 | const uint8_t kMideaACMinTempF = 62; // Fahrenheit 41 | const uint8_t kMideaACMaxTempF = 86; // Fahrenheit 42 | const uint8_t kMideaACMinTempC = 17; // Celsius 43 | const uint8_t kMideaACMaxTempC = 30; // Celsius 44 | const uint64_t kMideaACStateMask = 0x0000FFFFFFFFFFFF; 45 | const uint64_t kMideaACCelsiusBit = 0x0000000020000000; 46 | const uint64_t kMideaACTempMask = 0x0000FFFFE0FFFFFF; 47 | const uint64_t kMideaACFanMask = 0x0000FFC7FFFFFFFF; 48 | const uint64_t kMideaACModeMask = 0x0000FFF8FFFFFFFF; 49 | const uint64_t kMideaACChecksumMask = 0x0000FFFFFFFFFF00; 50 | const uint64_t kMideaACToggleSwingV = 0x0000A201FFFFFF7C; 51 | 52 | // Legacy defines. (Deprecated) 53 | #define MIDEA_AC_COOL kMideaACCool 54 | #define MIDEA_AC_DRY kMideaACDry 55 | #define MIDEA_AC_AUTO kMideaACAuto 56 | #define MIDEA_AC_HEAT kMideaACHeat 57 | #define MIDEA_AC_FAN kMideaACFan 58 | #define MIDEA_AC_FAN_AUTO kMideaACFanAuto 59 | #define MIDEA_AC_FAN_LOW kMideaACFanLow 60 | #define MIDEA_AC_FAN_MED kMideaACFanMed 61 | #define MIDEA_AC_FAN_HI kMideaACFanHigh 62 | #define MIDEA_AC_POWER kMideaACPower 63 | #define MIDEA_AC_SLEEP kMideaACSleep 64 | #define MIDEA_AC_MIN_TEMP_F kMideaACMinTempF 65 | #define MIDEA_AC_MAX_TEMP_F kMideaACMaxTempF 66 | #define MIDEA_AC_MIN_TEMP_C kMideaACMinTempC 67 | #define MIDEA_AC_MAX_TEMP_C kMideaACMaxTempC 68 | 69 | class IRMideaAC { 70 | public: 71 | explicit IRMideaAC(const uint16_t pin, const bool inverted = false, 72 | const bool use_modulation = true); 73 | 74 | void stateReset(void); 75 | #if SEND_MIDEA 76 | void send(const uint16_t repeat = kMideaMinRepeat); 77 | uint8_t calibrate(void) { return _irsend.calibrate(); } 78 | #endif // SEND_MIDEA 79 | void begin(void); 80 | void on(void); 81 | void off(void); 82 | void setPower(const bool on); 83 | bool getPower(void); 84 | bool getUseCelsius(void); 85 | void setUseCelsius(const bool celsius); 86 | void setTemp(const uint8_t temp, const bool useCelsius = false); 87 | uint8_t getTemp(const bool useCelsius = false); 88 | void setFan(const uint8_t fan); 89 | uint8_t getFan(void); 90 | void setMode(const uint8_t mode); 91 | uint8_t getMode(void); 92 | void setRaw(const uint64_t newState); 93 | uint64_t getRaw(void); 94 | static bool validChecksum(const uint64_t state); 95 | void setSleep(const bool on); 96 | bool getSleep(void); 97 | bool isSwingVToggle(void); 98 | void setSwingVToggle(const bool on); 99 | bool getSwingVToggle(void); 100 | uint8_t convertMode(const stdAc::opmode_t mode); 101 | uint8_t convertFan(const stdAc::fanspeed_t speed); 102 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 103 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 104 | stdAc::state_t toCommon(const stdAc::state_t *prev = NULL); 105 | String toString(void); 106 | #ifndef UNIT_TEST 107 | 108 | private: 109 | IRsend _irsend; 110 | #else 111 | IRsendTest _irsend; 112 | #endif 113 | uint64_t remote_state; 114 | bool _SwingVToggle; 115 | void checksum(void); 116 | static uint8_t calcChecksum(const uint64_t state); 117 | }; 118 | 119 | #endif // IR_MIDEA_H_ 120 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Mitsubishi.h: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Ken Shirriff 2 | // Copyright 2017 David Conran 3 | 4 | // Mitsubishi 5 | 6 | // Supports: 7 | // Brand: Mitsubishi, Model: TV 8 | // Brand: Mitsubishi, Model: HC3000 Projector 9 | 10 | #ifndef IR_MITSUBISHI_H_ 11 | #define IR_MITSUBISHI_H_ 12 | 13 | #define __STDC_LIMIT_MACROS 14 | #include 15 | #ifndef UNIT_TEST 16 | #include 17 | #endif 18 | #include "IRremoteESP8266.h" 19 | #include "IRsend.h" 20 | #ifdef UNIT_TEST 21 | #include "IRsend_test.h" 22 | #endif 23 | 24 | // Mitsubishi (TV) decoding added from https://github.com/z3t0/Arduino-IRremote 25 | // Mitsubishi (TV) sending & Mitsubishi A/C support added by David Conran 26 | 27 | // Constants 28 | const uint8_t kMitsubishiAcAuto = 0x20; 29 | const uint8_t kMitsubishiAcCool = 0x18; 30 | const uint8_t kMitsubishiAcDry = 0x10; 31 | const uint8_t kMitsubishiAcHeat = 0x08; 32 | const uint8_t kMitsubishiAcPower = 0x20; 33 | const uint8_t kMitsubishiAcFanAuto = 0; 34 | const uint8_t kMitsubishiAcFanMax = 5; 35 | const uint8_t kMitsubishiAcFanRealMax = 4; 36 | const uint8_t kMitsubishiAcFanSilent = 6; 37 | const uint8_t kMitsubishiAcFanQuiet = kMitsubishiAcFanSilent; 38 | const uint8_t kMitsubishiAcMinTemp = 16; // 16C 39 | const uint8_t kMitsubishiAcMaxTemp = 31; // 31C 40 | const uint8_t kMitsubishiAcVaneAuto = 0; 41 | const uint8_t kMitsubishiAcVaneAutoMove = 7; 42 | const uint8_t kMitsubishiAcNoTimer = 0; 43 | const uint8_t kMitsubishiAcStartTimer = 5; 44 | const uint8_t kMitsubishiAcStopTimer = 3; 45 | const uint8_t kMitsubishiAcStartStopTimer = 7; 46 | const uint8_t kMitsubishiAcWideVaneAuto = 8; 47 | 48 | // Legacy defines (Deprecated) 49 | #define MITSUBISHI_AC_VANE_AUTO_MOVE kMitsubishiAcVaneAutoMove 50 | #define MITSUBISHI_AC_VANE_AUTO kMitsubishiAcVaneAuto 51 | #define MITSUBISHI_AC_POWER kMitsubishiAcPower 52 | #define MITSUBISHI_AC_MIN_TEMP kMitsubishiAcMinTemp 53 | #define MITSUBISHI_AC_MAX_TEMP kMitsubishiAcMaxTemp 54 | #define MITSUBISHI_AC_HEAT kMitsubishiAcHeat 55 | #define MITSUBISHI_AC_FAN_SILENT kMitsubishiAcFanSilent 56 | #define MITSUBISHI_AC_FAN_REAL_MAX kMitsubishiAcFanRealMax 57 | #define MITSUBISHI_AC_FAN_MAX kMitsubishiAcFanMax 58 | #define MITSUBISHI_AC_FAN_AUTO kMitsubishiAcFanAuto 59 | #define MITSUBISHI_AC_DRY kMitsubishiAcDry 60 | #define MITSUBISHI_AC_COOL kMitsubishiAcCool 61 | #define MITSUBISHI_AC_AUTO kMitsubishiAcAuto 62 | 63 | class IRMitsubishiAC { 64 | public: 65 | explicit IRMitsubishiAC(const uint16_t pin, const bool inverted = false, 66 | const bool use_modulation = true); 67 | 68 | static uint8_t calculateChecksum(const uint8_t* data); 69 | 70 | void stateReset(void); 71 | #if SEND_MITSUBISHI_AC 72 | void send(const uint16_t repeat = kMitsubishiACMinRepeat); 73 | uint8_t calibrate(void) { return _irsend.calibrate(); } 74 | #endif // SEND_MITSUBISHI_AC 75 | void begin(void); 76 | void on(void); 77 | void off(void); 78 | void setPower(const bool on); 79 | bool getPower(void); 80 | void setTemp(const uint8_t degrees); 81 | uint8_t getTemp(void); 82 | void setFan(const uint8_t speed); 83 | uint8_t getFan(void); 84 | void setMode(const uint8_t mode); 85 | uint8_t getMode(void); 86 | void setVane(const uint8_t position); 87 | void setWideVane(const uint8_t position); 88 | uint8_t getVane(void); 89 | uint8_t getWideVane(void); 90 | uint8_t* getRaw(void); 91 | void setRaw(const uint8_t* data); 92 | uint8_t getClock(void); 93 | void setClock(const uint8_t clock); 94 | uint8_t getStartClock(void); 95 | void setStartClock(const uint8_t clock); 96 | uint8_t getStopClock(void); 97 | void setStopClock(const uint8_t clock); 98 | uint8_t getTimer(void); 99 | void setTimer(const uint8_t timer); 100 | uint8_t convertMode(const stdAc::opmode_t mode); 101 | uint8_t convertFan(const stdAc::fanspeed_t speed); 102 | uint8_t convertSwingV(const stdAc::swingv_t position); 103 | uint8_t convertSwingH(const stdAc::swingh_t position); 104 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 105 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 106 | static stdAc::swingv_t toCommonSwingV(const uint8_t pos); 107 | static stdAc::swingh_t toCommonSwingH(const uint8_t pos); 108 | stdAc::state_t toCommon(void); 109 | String toString(void); 110 | #ifndef UNIT_TEST 111 | 112 | private: 113 | IRsend _irsend; 114 | #else 115 | IRsendTest _irsend; 116 | #endif 117 | uint8_t remote_state[kMitsubishiACStateLength]; 118 | void checksum(void); 119 | }; 120 | 121 | #endif // IR_MITSUBISHI_H_ 122 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_NEC.h: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Ken Shirriff 2 | // Copyright 2017, 2018 David Conran 3 | 4 | // NEC originally added from https://github.com/shirriff/Arduino-IRremote/ 5 | 6 | #ifndef IR_NEC_H_ 7 | #define IR_NEC_H_ 8 | 9 | #include 10 | #include "IRremoteESP8266.h" 11 | 12 | // Constants 13 | // Ref: 14 | // http://www.sbprojects.com/knowledge/ir/nec.php 15 | const uint16_t kNecTick = 560; 16 | const uint16_t kNecHdrMarkTicks = 16; 17 | const uint16_t kNecHdrMark = kNecHdrMarkTicks * kNecTick; 18 | const uint16_t kNecHdrSpaceTicks = 8; 19 | const uint16_t kNecHdrSpace = kNecHdrSpaceTicks * kNecTick; 20 | const uint16_t kNecBitMarkTicks = 1; 21 | const uint16_t kNecBitMark = kNecBitMarkTicks * kNecTick; 22 | const uint16_t kNecOneSpaceTicks = 3; 23 | const uint16_t kNecOneSpace = kNecOneSpaceTicks * kNecTick; 24 | const uint16_t kNecZeroSpaceTicks = 1; 25 | const uint16_t kNecZeroSpace = kNecZeroSpaceTicks * kNecTick; 26 | const uint16_t kNecRptSpaceTicks = 4; 27 | const uint16_t kNecRptSpace = kNecRptSpaceTicks * kNecTick; 28 | const uint16_t kNecRptLength = 4; 29 | const uint16_t kNecMinCommandLengthTicks = 193; 30 | const uint32_t kNecMinCommandLength = kNecMinCommandLengthTicks * kNecTick; 31 | const uint32_t kNecMinGap = 32 | kNecMinCommandLength - 33 | (kNecHdrMark + kNecHdrSpace + kNECBits * (kNecBitMark + kNecOneSpace) + 34 | kNecBitMark); 35 | const uint16_t kNecMinGapTicks = 36 | kNecMinCommandLengthTicks - 37 | (kNecHdrMarkTicks + kNecHdrSpaceTicks + 38 | kNECBits * (kNecBitMarkTicks + kNecOneSpaceTicks) + kNecBitMarkTicks); 39 | 40 | #endif // IR_NEC_H_ 41 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Nikai.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Ken Shirriff 2 | // Copyright 2017 David Conran 3 | 4 | // Nikai 5 | 6 | #include 7 | #include "IRrecv.h" 8 | #include "IRsend.h" 9 | #include "IRutils.h" 10 | 11 | // Constants 12 | // Ref: 13 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/309 14 | const uint16_t kNikaiTick = 500; 15 | const uint16_t kNikaiHdrMarkTicks = 8; 16 | const uint16_t kNikaiHdrMark = kNikaiHdrMarkTicks * kNikaiTick; 17 | const uint16_t kNikaiHdrSpaceTicks = 8; 18 | const uint16_t kNikaiHdrSpace = kNikaiHdrSpaceTicks * kNikaiTick; 19 | const uint16_t kNikaiBitMarkTicks = 1; 20 | const uint16_t kNikaiBitMark = kNikaiBitMarkTicks * kNikaiTick; 21 | const uint16_t kNikaiOneSpaceTicks = 2; 22 | const uint16_t kNikaiOneSpace = kNikaiOneSpaceTicks * kNikaiTick; 23 | const uint16_t kNikaiZeroSpaceTicks = 4; 24 | const uint16_t kNikaiZeroSpace = kNikaiZeroSpaceTicks * kNikaiTick; 25 | const uint16_t kNikaiMinGapTicks = 17; 26 | const uint16_t kNikaiMinGap = kNikaiMinGapTicks * kNikaiTick; 27 | 28 | #if SEND_NIKAI 29 | // Send a Nikai TV formatted message. 30 | // 31 | // Args: 32 | // data: The message to be sent. 33 | // nbits: The bit size of the message being sent. typically kNikaiBits. 34 | // repeat: The number of times the message is to be repeated. 35 | // 36 | // Status: STABLE / Working. 37 | // 38 | // Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/309 39 | void IRsend::sendNikai(uint64_t data, uint16_t nbits, uint16_t repeat) { 40 | sendGeneric(kNikaiHdrMark, kNikaiHdrSpace, kNikaiBitMark, kNikaiOneSpace, 41 | kNikaiBitMark, kNikaiZeroSpace, kNikaiBitMark, kNikaiMinGap, data, 42 | nbits, 38, true, repeat, 33); 43 | } 44 | #endif 45 | 46 | #if DECODE_NIKAI 47 | // Decode the supplied Nikai message. 48 | // 49 | // Args: 50 | // results: Ptr to the data to decode and where to store the decode result. 51 | // nbits: Nr. of bits to expect in the data portion. 52 | // Typically kNikaiBits. 53 | // strict: Flag to indicate if we strictly adhere to the specification. 54 | // Returns: 55 | // boolean: True if it can decode it, false if it can't. 56 | // 57 | // Status: STABLE / Working. 58 | // 59 | bool IRrecv::decodeNikai(decode_results *results, uint16_t nbits, bool strict) { 60 | if (strict && nbits != kNikaiBits) 61 | return false; // We expect Nikai to be a certain sized message. 62 | 63 | uint64_t data = 0; 64 | uint16_t offset = kStartOffset; 65 | 66 | // Match Header + Data + Footer 67 | if (!matchGeneric(results->rawbuf + offset, &data, 68 | results->rawlen - offset, nbits, 69 | kNikaiHdrMark, kNikaiHdrSpace, 70 | kNikaiBitMark, kNikaiOneSpace, 71 | kNikaiBitMark, kNikaiZeroSpace, 72 | kNikaiBitMark, kNikaiMinGap, true)) return false; 73 | // Success 74 | results->bits = nbits; 75 | results->value = data; 76 | results->decode_type = NIKAI; 77 | results->command = 0; 78 | results->address = 0; 79 | return true; 80 | } 81 | #endif 82 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Pronto.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | // Pronto code message generation 4 | 5 | #include 6 | #include "IRsend.h" 7 | 8 | // Constants 9 | const float kProntoFreqFactor = 0.241246; 10 | const uint16_t kProntoTypeOffset = 0; 11 | const uint16_t kProntoFreqOffset = 1; 12 | const uint16_t kProntoSeq1LenOffset = 2; 13 | const uint16_t kProntoSeq2LenOffset = 3; 14 | const uint16_t kProntoDataOffset = 4; 15 | 16 | #if SEND_PRONTO 17 | // Send a Pronto Code formatted message. 18 | // 19 | // Args: 20 | // data: An array of uint16_t containing the pronto codes. 21 | // len: Nr. of entries in the data[] array. 22 | // repeat: Nr. of times to repeat the message. 23 | // 24 | // Status: ALPHA / Not tested in the real world. 25 | // 26 | // Note: 27 | // Pronto codes are typically represented in hexadecimal. 28 | // You will need to convert the code to an array of integers, and calculate 29 | // it's length. 30 | // e.g. 31 | // A Sony 20 bit DVD remote command. 32 | // "0000 0067 0000 0015 0060 0018 0018 0018 0030 0018 0030 0018 0030 0018 33 | // 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0030 0018 34 | // 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 35 | // 0030 0018 0018 03f6" 36 | // 37 | // converts to: 38 | // 39 | // uint16_t prontoCode[46] = { 40 | // 0x0000, 0x0067, 0x0000, 0x0015, 41 | // 0x0060, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 0x0030, 0x0018, 42 | // 0x0030, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018, 43 | // 0x0018, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 44 | // 0x0030, 0x0018, 0x0030, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 45 | // 0x0030, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0030, 0x0018, 46 | // 0x0018, 0x03f6}; 47 | // // Send the Pronto(Sony) code. Repeat twice as Sony's require that. 48 | // sendPronto(prontoCode, 46, kSonyMinRepeat); 49 | // 50 | // Ref: 51 | // http://www.etcwiki.org/wiki/Pronto_Infrared_Format 52 | // http://www.remotecentral.com/features/irdisp2.htm 53 | void IRsend::sendPronto(uint16_t data[], uint16_t len, uint16_t repeat) { 54 | // Check we have enough data to work out what to send. 55 | if (len < kProntoMinLength) return; 56 | 57 | // We only know how to deal with 'raw' pronto codes types. Reject all others. 58 | if (data[kProntoTypeOffset] != 0) return; 59 | 60 | // Pronto frequency is in Hz. 61 | uint16_t hz = 62 | (uint16_t)(1000000U / (data[kProntoFreqOffset] * kProntoFreqFactor)); 63 | enableIROut(hz); 64 | 65 | // Grab the length of the two sequences. 66 | uint16_t seq_1_len = data[kProntoSeq1LenOffset] * 2; 67 | uint16_t seq_2_len = data[kProntoSeq2LenOffset] * 2; 68 | // Calculate where each sequence starts in the buffer. 69 | uint16_t seq_1_start = kProntoDataOffset; 70 | uint16_t seq_2_start = kProntoDataOffset + seq_1_len; 71 | 72 | uint32_t periodic_time = calcUSecPeriod(hz, false); 73 | 74 | // Normal (1st sequence) case. 75 | // Is there a first (normal) sequence to send? 76 | if (seq_1_len > 0) { 77 | // Check we have enough data to send the complete first sequence. 78 | if (seq_1_len + seq_1_start > len) return; 79 | // Send the contents of the 1st sequence. 80 | for (uint16_t i = seq_1_start; i < seq_1_start + seq_1_len; i += 2) { 81 | mark(data[i] * periodic_time); 82 | space(data[i + 1] * periodic_time); 83 | } 84 | } else { 85 | // There was no first sequence to send, it is implied that we have to send 86 | // the 2nd/repeat sequence an additional time. i.e. At least once. 87 | repeat++; 88 | } 89 | 90 | // Repeat (2nd sequence) case. 91 | // Is there a second (repeat) sequence to be sent? 92 | if (seq_2_len > 0) { 93 | // Check we have enough data to send the complete second sequence. 94 | if (seq_2_len + seq_2_start > len) return; 95 | 96 | // Send the contents of the 2nd sequence. 97 | for (uint16_t r = 0; r < repeat; r++) 98 | for (uint16_t i = seq_2_start; i < seq_2_start + seq_2_len; i += 2) { 99 | mark(data[i] * periodic_time); 100 | space(data[i + 1] * periodic_time); 101 | } 102 | } 103 | } 104 | #endif 105 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Samsung.h: -------------------------------------------------------------------------------- 1 | // Samsung A/C 2 | // 3 | // Copyright 2018 David Conran 4 | 5 | #ifndef IR_SAMSUNG_H_ 6 | #define IR_SAMSUNG_H_ 7 | 8 | #define __STDC_LIMIT_MACROS 9 | #include 10 | #ifndef UNIT_TEST 11 | #include 12 | #endif 13 | #include "IRremoteESP8266.h" 14 | #include "IRsend.h" 15 | #ifdef UNIT_TEST 16 | #include "IRsend_test.h" 17 | #endif 18 | 19 | // Supports: 20 | // Brand: Samsung, Model: UA55H6300 TV 21 | // Brand: Samsung, Model: IEC-R03 remote 22 | // Brand: Samsung, Model: AR12KSFPEWQNET A/C 23 | // Brand: Samsung, Model: AR12HSSDBWKNEU A/C 24 | 25 | // Ref: 26 | // https://github.com/crankyoldgit/IRremoteESP8266/issues/505 27 | 28 | // Constants 29 | const uint8_t kSamsungAcAuto = 0; 30 | const uint8_t kSamsungAcCool = 1; 31 | const uint8_t kSamsungAcDry = 2; 32 | const uint8_t kSamsungAcFan = 3; 33 | const uint8_t kSamsungAcHeat = 4; 34 | const uint8_t kSamsungAcModeMask = 0x70; // 0b01110000 35 | const uint8_t kSamsungAcFanAuto = 0; 36 | const uint8_t kSamsungAcFanLow = 2; 37 | const uint8_t kSamsungAcFanMed = 4; 38 | const uint8_t kSamsungAcFanHigh = 5; 39 | const uint8_t kSamsungAcFanAuto2 = 6; 40 | const uint8_t kSamsungAcFanTurbo = 7; 41 | const uint8_t kSamsungAcMinTemp = 16; // 16C 42 | const uint8_t kSamsungAcMaxTemp = 30; // 30C 43 | const uint8_t kSamsungAcAutoTemp = 25; // 25C 44 | const uint8_t kSamsungAcTempMask = 0xF0; // 0b11110000 45 | const uint8_t kSamsungAcPowerMask1 = 0x20; // 0b00100000 46 | const uint8_t kSamsungAcPowerMask6 = 0x30; // 0b00110000 47 | const uint8_t kSamsungAcFanMask = 0x0E; // 0b00001110 48 | const uint8_t kSamsungAcSwingMask = 0x70; // 0b01110000 49 | const uint8_t kSamsungAcSwingMove = 0b010; 50 | const uint8_t kSamsungAcSwingStop = 0b111; 51 | const uint8_t kSamsungAcBeepMask = 0x02; // 0b00000010 52 | const uint8_t kSamsungAcCleanMask10 = 0x80; // 0b10000000 53 | const uint8_t kSamsungAcCleanMask11 = 0x02; // 0b00000010 54 | const uint8_t kSamsungAcQuietMask1 = 0x10; // 0b00010000 55 | const uint8_t kSamsungAcQuietMask5 = 0x20; // 0b00100000 56 | const uint8_t kSamsungAcPowerfulMask8 = 0x50; // 0b01010000 57 | const uint8_t kSamsungAcPowerfulMask10 = 0x06; // 0b00000110 58 | 59 | const uint16_t kSamsungACSectionLength = 7; 60 | const uint64_t kSamsungAcPowerSection = 0x1D20F00000000; 61 | 62 | // Classes 63 | class IRSamsungAc { 64 | public: 65 | explicit IRSamsungAc(const uint16_t pin, const bool inverted = false, 66 | const bool use_modulation = true); 67 | 68 | void stateReset(void); 69 | #if SEND_SAMSUNG_AC 70 | void send(const uint16_t repeat = kSamsungAcDefaultRepeat, 71 | const bool calcchecksum = true); 72 | void sendExtended(const uint16_t repeat = kSamsungAcDefaultRepeat, 73 | const bool calcchecksum = true); 74 | void sendOn(const uint16_t repeat = kSamsungAcDefaultRepeat); 75 | void sendOff(const uint16_t repeat = kSamsungAcDefaultRepeat); 76 | uint8_t calibrate(void) { return _irsend.calibrate(); } 77 | #endif // SEND_SAMSUNG_AC 78 | void begin(void); 79 | void on(void); 80 | void off(void); 81 | void setPower(const bool on); 82 | bool getPower(void); 83 | void setTemp(const uint8_t temp); 84 | uint8_t getTemp(void); 85 | void setFan(const uint8_t speed); 86 | uint8_t getFan(void); 87 | void setMode(const uint8_t mode); 88 | uint8_t getMode(void); 89 | void setSwing(const bool on); 90 | bool getSwing(void); 91 | void setBeep(const bool on); 92 | bool getBeep(void); 93 | void setClean(const bool on); 94 | bool getClean(void); 95 | void setQuiet(const bool on); 96 | bool getQuiet(void); 97 | void setPowerful(const bool on); 98 | bool getPowerful(void); 99 | uint8_t* getRaw(void); 100 | void setRaw(const uint8_t new_code[], 101 | const uint16_t length = kSamsungAcStateLength); 102 | static bool validChecksum(const uint8_t state[], 103 | const uint16_t length = kSamsungAcStateLength); 104 | static uint8_t calcChecksum(const uint8_t state[], 105 | const uint16_t length = kSamsungAcStateLength); 106 | uint8_t convertMode(const stdAc::opmode_t mode); 107 | uint8_t convertFan(const stdAc::fanspeed_t speed); 108 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 109 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 110 | stdAc::state_t toCommon(void); 111 | String toString(void); 112 | #ifndef UNIT_TEST 113 | 114 | private: 115 | IRsend _irsend; 116 | #else 117 | IRsendTest _irsend; 118 | #endif 119 | // The state of the IR remote in IR code form. 120 | uint8_t remote_state[kSamsungAcExtendedStateLength]; 121 | bool _sendpower; // Hack to know when we need to send a special power mesg. 122 | void checksum(const uint16_t length = kSamsungAcStateLength); 123 | }; 124 | 125 | #endif // IR_SAMSUNG_H_ 126 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Sharp.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 crankyoldgit 2 | 3 | // Supports: 4 | // Brand: Sharp, Model: LC-52D62U TV 5 | // Brand: Sharp, Model: AY-ZP40KR A/C 6 | 7 | #ifndef IR_SHARP_H_ 8 | #define IR_SHARP_H_ 9 | 10 | #ifndef UNIT_TEST 11 | #include 12 | #endif 13 | #include "IRrecv.h" 14 | #include "IRremoteESP8266.h" 15 | #include "IRsend.h" 16 | #ifdef UNIT_TEST 17 | #include "IRsend_test.h" 18 | #endif 19 | 20 | // Constants 21 | const uint16_t kSharpAcHdrMark = 3800; 22 | const uint16_t kSharpAcHdrSpace = 1900; 23 | const uint16_t kSharpAcBitMark = 470; 24 | const uint16_t kSharpAcZeroSpace = 500; 25 | const uint16_t kSharpAcOneSpace = 1400; 26 | const uint32_t kSharpAcGap = kDefaultMessageGap; 27 | 28 | const uint8_t kSharpAcAuto = 0b000; 29 | const uint8_t kSharpAcDry = 0b011; 30 | const uint8_t kSharpAcCool = 0b010; 31 | const uint8_t kSharpAcHeat = 0b001; 32 | const uint8_t kSharpAcMinTemp = 15; // Celsius 33 | const uint8_t kSharpAcMaxTemp = 30; // Celsius 34 | const uint8_t kSharpAcFanAuto = 0b010; // 2 35 | const uint8_t kSharpAcFanMin = 0b100; // 4 (FAN1) 36 | const uint8_t kSharpAcFanMed = 0b011; // 3 (FAN2) 37 | const uint8_t kSharpAcFanHigh = 0b101; // 5 (FAN3) 38 | const uint8_t kSharpAcFanMax = 0b111; // 7 (FAN4) 39 | const uint8_t kSharpAcByteTemp = 4; 40 | const uint8_t kSharpAcMaskTemp = 0b00001111; 41 | const uint8_t kSharpAcBytePower = 5; 42 | const uint8_t kSharpAcBitPower = 0b00010000; 43 | const uint8_t kSharpAcByteMode = 6; 44 | const uint8_t kSharpAcMaskMode = 0b00000011; 45 | const uint8_t kSharpAcByteFan = kSharpAcByteMode; 46 | const uint8_t kSharpAcMaskFan = 0b01110000; 47 | const uint8_t kSharpAcByteManual = 10; 48 | const uint8_t kSharpAcBitFanManual = 0b00000001; 49 | const uint8_t kSharpAcBitTempManual = 0b00000100; 50 | 51 | 52 | class IRSharpAc { 53 | public: 54 | explicit IRSharpAc(const uint16_t pin, const bool inverted = false, 55 | const bool use_modulation = true); 56 | 57 | #if SEND_SHARP_AC 58 | void send(const uint16_t repeat = kSharpAcDefaultRepeat); 59 | uint8_t calibrate(void) { return _irsend.calibrate(); } 60 | #endif // SEND_SHARP_AC 61 | void begin(void); 62 | void on(void); 63 | void off(void); 64 | void setPower(const bool on); 65 | bool getPower(void); 66 | void setTemp(const uint8_t temp); 67 | uint8_t getTemp(void); 68 | void setFan(const uint8_t fan); 69 | uint8_t getFan(void); 70 | void setMode(const uint8_t mode); 71 | uint8_t getMode(void); 72 | uint8_t* getRaw(void); 73 | void setRaw(const uint8_t new_code[], 74 | const uint16_t length = kSharpAcStateLength); 75 | static bool validChecksum(uint8_t state[], 76 | const uint16_t length = kSharpAcStateLength); 77 | static uint8_t convertMode(const stdAc::opmode_t mode); 78 | static uint8_t convertFan(const stdAc::fanspeed_t speed); 79 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 80 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 81 | stdAc::state_t toCommon(void); 82 | String toString(void); 83 | #ifndef UNIT_TEST 84 | 85 | private: 86 | IRsend _irsend; 87 | #else 88 | IRsendTest _irsend; 89 | #endif 90 | // # of bytes per command 91 | uint8_t remote[kSharpAcStateLength]; 92 | void stateReset(void); 93 | void checksum(void); 94 | static uint8_t calcChecksum(uint8_t state[], 95 | const uint16_t length = kSharpAcStateLength); 96 | }; 97 | 98 | #endif // IR_SHARP_H_ 99 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Sherwood.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | // Sherwood IR remote emulation 4 | 5 | // Supports: 6 | // Brand: Sherwood, Model: RC-138 remote 7 | // Brand: Sherwood, Model: RD6505(B) Receiver 8 | 9 | #include 10 | #include "IRsend.h" 11 | 12 | #if SEND_SHERWOOD 13 | // Send an IR command to a Sherwood device. 14 | // 15 | // Args: 16 | // data: The contents of the command you want to send. 17 | // nbits: The bit size of the command being sent. (kSherwoodBits) 18 | // repeat: The nr. of times you want the command to be repeated. (Default: 1) 19 | // 20 | // Status: STABLE / Known working. 21 | // 22 | // Note: 23 | // Sherwood remote codes appear to be NEC codes with a manditory repeat code. 24 | // i.e. repeat should be >= kSherwoodMinRepeat (1). 25 | void IRsend::sendSherwood(uint64_t data, uint16_t nbits, uint16_t repeat) { 26 | sendNEC(data, nbits, std::max((uint16_t)kSherwoodMinRepeat, repeat)); 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Tcl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 David Conran 2 | 3 | // Supports: 4 | // Brand: Leberg, Model: LBS-TOR07 A/C 5 | 6 | #ifndef IR_TCL_H_ 7 | #define IR_TCL_H_ 8 | 9 | #ifndef UNIT_TEST 10 | #include 11 | #endif 12 | #include "IRremoteESP8266.h" 13 | #include "IRsend.h" 14 | #include "IRrecv.h" 15 | #ifdef UNIT_TEST 16 | #include "IRsend_test.h" 17 | #endif 18 | 19 | // Constants 20 | const uint16_t kTcl112AcHdrMark = 3000; 21 | const uint16_t kTcl112AcHdrSpace = 1650; 22 | const uint16_t kTcl112AcBitMark = 500; 23 | const uint16_t kTcl112AcOneSpace = 1050; 24 | const uint16_t kTcl112AcZeroSpace = 325; 25 | const uint32_t kTcl112AcGap = kDefaultMessageGap; // Just a guess. 26 | const uint8_t kTcl112AcTolerance = kTolerance + 5; // Percent 27 | 28 | const uint8_t kTcl112AcHeat = 1; 29 | const uint8_t kTcl112AcDry = 2; 30 | const uint8_t kTcl112AcCool = 3; 31 | const uint8_t kTcl112AcFan = 7; 32 | const uint8_t kTcl112AcAuto = 8; 33 | const uint8_t kTcl112AcFanMask = 0b00000111; 34 | const uint8_t kTcl112AcFanAuto = 0b00000000; 35 | const uint8_t kTcl112AcFanLow = 0b00000010; 36 | const uint8_t kTcl112AcFanMed = 0b00000011; 37 | const uint8_t kTcl112AcFanHigh = 0b00000101; 38 | 39 | const uint8_t kTcl112AcHalfDegree = 0b00100000; 40 | const float kTcl112AcTempMax = 31.0; 41 | const float kTcl112AcTempMin = 16.0; 42 | 43 | const uint8_t kTcl112AcPowerMask = 0b00000100; 44 | const uint8_t kTcl112AcBitEcono = 0b10000000; 45 | const uint8_t kTcl112AcBitLight = 0b01000000; 46 | const uint8_t kTcl112AcBitHealth = 0b00010000; 47 | const uint8_t kTcl112AcBitSwingH = 0b00001000; 48 | const uint8_t kTcl112AcBitSwingV = 0b00111000; 49 | const uint8_t kTcl112AcBitTurbo = 0b01000000; 50 | 51 | 52 | class IRTcl112Ac { 53 | public: 54 | explicit IRTcl112Ac(const uint16_t pin, const bool inverted = false, 55 | const bool use_modulation = true); 56 | 57 | #if SEND_TCL112AC 58 | void send(const uint16_t repeat = kTcl112AcDefaultRepeat); 59 | uint8_t calibrate(void) { return _irsend.calibrate(); } 60 | #endif // SEND_TCL 61 | void begin(void); 62 | uint8_t* getRaw(void); 63 | void setRaw(const uint8_t new_code[], 64 | const uint16_t length = kTcl112AcStateLength); 65 | void on(void); 66 | void off(void); 67 | void setPower(const bool on); 68 | bool getPower(void); 69 | void setTemp(const float celsius); // Celsius in 0.5 increments 70 | float getTemp(void); 71 | void setMode(const uint8_t mode); 72 | uint8_t getMode(void); 73 | static uint8_t calcChecksum(uint8_t state[], 74 | const uint16_t length = kTcl112AcStateLength); 75 | static bool validChecksum(uint8_t state[], 76 | const uint16_t length = kTcl112AcStateLength); 77 | void setFan(const uint8_t speed); 78 | uint8_t getFan(void); 79 | void setEcono(const bool on); 80 | bool getEcono(void); 81 | void setHealth(const bool on); 82 | bool getHealth(void); 83 | void setLight(const bool on); 84 | bool getLight(void); 85 | void setSwingHorizontal(const bool on); 86 | bool getSwingHorizontal(void); 87 | void setSwingVertical(const bool on); 88 | bool getSwingVertical(void); 89 | void setTurbo(const bool on); 90 | bool getTurbo(void); 91 | uint8_t convertMode(const stdAc::opmode_t mode); 92 | uint8_t convertFan(const stdAc::fanspeed_t speed); 93 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 94 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 95 | stdAc::state_t toCommon(void); 96 | String toString(void); 97 | #ifndef UNIT_TEST 98 | 99 | private: 100 | IRsend _irsend; 101 | #else 102 | IRsendTest _irsend; 103 | #endif 104 | uint8_t remote_state[kTcl112AcStateLength]; 105 | void stateReset(void); 106 | void checksum(const uint16_t length = kTcl112AcStateLength); 107 | }; 108 | 109 | #endif // IR_TCL_H_ 110 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Teco.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Fabien Valthier 2 | 3 | #ifndef IR_TECO_H_ 4 | #define IR_TECO_H_ 5 | 6 | #ifndef UNIT_TEST 7 | #include 8 | #endif 9 | #include "IRremoteESP8266.h" 10 | #include "IRsend.h" 11 | #ifdef UNIT_TEST 12 | #include "IRsend_test.h" 13 | #endif 14 | 15 | // Constants. Using LSB to be able to send only 35bits. 16 | const uint8_t kTecoAuto = 0; // 0b000 17 | const uint8_t kTecoCool = 1; // 0b001 18 | const uint8_t kTecoDry = 2; // 0b010 19 | const uint8_t kTecoFan = 3; // 0b110 20 | const uint8_t kTecoHeat = 4; // 0b001 21 | const uint8_t kTecoFanAuto = 0; // 0b00 22 | const uint8_t kTecoFanHigh = 3; // 0b11 23 | const uint8_t kTecoFanMed = 2; // 0b10 24 | const uint8_t kTecoFanLow = 1; // 0b01 25 | const uint8_t kTecoMinTemp = 16; // 16C 26 | const uint8_t kTecoMaxTemp = 30; // 30C 27 | 28 | const uint64_t kTecoModeMask = 0b00000000000000000000000000000000111; 29 | const uint64_t kTecoPower = 0b00000000000000000000000000000001000; 30 | const uint64_t kTecoFanMask = 0b00000000000000000000000000000110000; 31 | const uint64_t kTecoSwing = 0b00000000000000000000000000001000000; 32 | const uint64_t kTecoSleep = 0b00000000000000000000000000010000000; 33 | const uint64_t kTecoTempMask = 0b00000000000000000000000111100000000; 34 | const uint64_t kTecoTimerHalfH = 0b00000000000000000000001000000000000; 35 | const uint64_t kTecoTimerTenHr = 0b00000000000000000000110000000000000; 36 | const uint64_t kTecoTimerOn = 0b00000000000000000001000000000000000; 37 | const uint64_t kTecoTimerUniHr = 0b00000000000000011110000000000000000; 38 | const uint64_t kTecoReset = 0b01001010000000000000010000000000000; 39 | /* 40 | (header mark and space) 41 | Teco AC map read and to be sent in LSB with number of bits 42 | 43 | byte 0 = Cst 0x02 44 | byte 1 = Cst 0x50 45 | byte 2: 46 | b0-3 = 0b0000 47 | b4-7 = Timer hours (unit, not thenth) 48 | hours: 49 | 0000 (0) = +0 hour 50 | 0001 (1) = +1 hour 51 | ... 52 | 1001 (9) = +9 hours 53 | byte 3: = timer and Temperature 54 | b0 = Timer (1 = On, 0 = Off) 55 | b1-2 = Timer - number of 10hours 56 | 10Hours: 57 | 00 = 0 * 10hours of timer 58 | 01 = 1 * 10 hours of timer 59 | 10 = 2 * 10hours of timer 60 | b3 = Timer - half hour (1=half hour on, 0 = round hour) 61 | b4-7: Degrees C. 62 | 0000 (0) = 16C 63 | 0001 (1) = 17C 64 | 0010 (2) = 18C 65 | ... 66 | 1101 (13) = 29C 67 | 1110 (14) = 30C 68 | byte 4: Basics 69 | b0 = Sleep Mode (1 = On, 0 = Off) 70 | b1 = Vent swing (1 = On, 0 = Off) 71 | b2-3 = Fan 72 | Fan: 73 | 00 = Auto 74 | 01 = Fan 1 75 | 10 = Fan 2 76 | 11 = Fan 3 or higher 77 | b4 = Power Status (1 = On, 0 = Off) 78 | b5-7 = Modes LSB first 79 | Modes: 80 | 000 = Auto (temp = 25C) 81 | 001 = Cool 82 | 010 = Dry (temp = 25C, but not shown) 83 | 011 = Fan 84 | 100 = Heat 85 | */ 86 | 87 | // Classes 88 | class IRTecoAc { 89 | public: 90 | explicit IRTecoAc(const uint16_t pin, const bool inverted = false, 91 | const bool use_modulation = true); 92 | 93 | void stateReset(void); 94 | #if SEND_TECO 95 | void send(const uint16_t repeat = kTecoDefaultRepeat); 96 | #endif // SEND_TECO 97 | void begin(void); 98 | void on(void); 99 | void off(void); 100 | 101 | void setPower(const bool on); 102 | bool getPower(void); 103 | 104 | void setTemp(const uint8_t temp); 105 | uint8_t getTemp(void); 106 | 107 | void setFan(const uint8_t fan); 108 | uint8_t getFan(void); 109 | 110 | void setMode(const uint8_t mode); 111 | uint8_t getMode(void); 112 | 113 | void setSwing(const bool state); 114 | bool getSwing(void); 115 | 116 | void setSleep(const bool state); 117 | bool getSleep(void); 118 | 119 | // void setTimer(uint8_t time); // To check unit 120 | // uint8_t getTimer(uint8_t); 121 | 122 | uint64_t getRaw(void); 123 | void setRaw(const uint64_t new_code); 124 | 125 | uint8_t convertMode(const stdAc::opmode_t mode); 126 | uint8_t convertFan(const stdAc::fanspeed_t speed); 127 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 128 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 129 | stdAc::state_t toCommon(void); 130 | String toString(void); 131 | #ifndef UNIT_TEST 132 | 133 | private: 134 | IRsend _irsend; 135 | #else 136 | IRsendTest _irsend; 137 | #endif 138 | // The state of the IR remote in IR code form. 139 | uint64_t remote_state; 140 | }; 141 | 142 | #endif // IR_TECO_H_ 143 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Toshiba.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | // Toshiba A/C support added by David Conran 4 | 5 | // Supports: 6 | // Brand: Toshiba, Model: RAS-B13N3KV2 7 | // Brand: Toshiba, Model: Akita EVO II 8 | // Brand: Toshiba, Model: RAS-B13N3KVP-E 9 | // Brand: Toshiba, Model: RAS 18SKP-ES 10 | // Brand: Toshiba, Model: WH-TA04NE 11 | // Brand: Toshiba, Model: WC-L03SE 12 | 13 | #ifndef IR_TOSHIBA_H_ 14 | #define IR_TOSHIBA_H_ 15 | 16 | #define __STDC_LIMIT_MACROS 17 | #include 18 | #ifdef ARDUINO 19 | #include 20 | #endif 21 | #include "IRremoteESP8266.h" 22 | #include "IRsend.h" 23 | #ifdef UNIT_TEST 24 | #include "IRsend_test.h" 25 | #endif 26 | 27 | // Constants 28 | const uint8_t kToshibaAcAuto = 0; 29 | const uint8_t kToshibaAcCool = 1; 30 | const uint8_t kToshibaAcDry = 2; 31 | const uint8_t kToshibaAcHeat = 3; 32 | const uint8_t kToshibaAcPower = 4; 33 | const uint8_t kToshibaAcFanAuto = 0; 34 | const uint8_t kToshibaAcFanMin = 1; 35 | const uint8_t kToshibaAcFanMed = 3; 36 | const uint8_t kToshibaAcFanMax = 5; 37 | const uint8_t kToshibaAcMinTemp = 17; // 17C 38 | const uint8_t kToshibaAcMaxTemp = 30; // 30C 39 | 40 | // Legacy defines. (Deperecated) 41 | #define TOSHIBA_AC_AUTO kToshibaAcAuto 42 | #define TOSHIBA_AC_COOL kToshibaAcCool 43 | #define TOSHIBA_AC_DRY kToshibaAcDry 44 | #define TOSHIBA_AC_HEAT kToshibaAcHeat 45 | #define TOSHIBA_AC_POWER kToshibaAcPower 46 | #define TOSHIBA_AC_FAN_AUTO kToshibaAcFanAuto 47 | #define TOSHIBA_AC_FAN_MAX kToshibaAcFanMax 48 | #define TOSHIBA_AC_MIN_TEMP kToshibaAcMinTemp 49 | #define TOSHIBA_AC_MAX_TEMP kToshibaAcMaxTemp 50 | 51 | class IRToshibaAC { 52 | public: 53 | explicit IRToshibaAC(const uint16_t pin, const bool inverted = false, 54 | const bool use_modulation = true); 55 | 56 | void stateReset(void); 57 | #if SEND_TOSHIBA_AC 58 | void send(const uint16_t repeat = kToshibaACMinRepeat); 59 | uint8_t calibrate(void) { return _irsend.calibrate(); } 60 | #endif // SEND_TOSHIBA_AC 61 | void begin(void); 62 | void on(void); 63 | void off(void); 64 | void setPower(const bool on); 65 | bool getPower(void); 66 | void setTemp(const uint8_t degrees); 67 | uint8_t getTemp(void); 68 | void setFan(const uint8_t speed); 69 | uint8_t getFan(void); 70 | void setMode(const uint8_t mode); 71 | uint8_t getMode(const bool useRaw = false); 72 | void setRaw(const uint8_t newState[]); 73 | uint8_t* getRaw(void); 74 | static bool validChecksum(const uint8_t state[], 75 | const uint16_t length = kToshibaACStateLength); 76 | uint8_t convertMode(const stdAc::opmode_t mode); 77 | uint8_t convertFan(const stdAc::fanspeed_t speed); 78 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 79 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 80 | stdAc::state_t toCommon(void); 81 | String toString(void); 82 | #ifndef UNIT_TEST 83 | 84 | private: 85 | IRsend _irsend; 86 | #else 87 | IRsendTest _irsend; 88 | #endif 89 | uint8_t remote_state[kToshibaACStateLength]; 90 | void checksum(const uint16_t length = kToshibaACStateLength); 91 | static uint8_t calcChecksum(const uint8_t state[], 92 | const uint16_t length = kToshibaACStateLength); 93 | uint8_t mode_state; 94 | }; 95 | 96 | #endif // IR_TOSHIBA_H_ 97 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Trotec.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 stufisher 2 | // Copyright 2019 crankyoldgit 3 | 4 | #ifndef IR_TROTEC_H_ 5 | #define IR_TROTEC_H_ 6 | 7 | #ifndef UNIT_TEST 8 | #include 9 | #endif 10 | #include "IRremoteESP8266.h" 11 | #include "IRsend.h" 12 | #ifdef UNIT_TEST 13 | #include "IRsend_test.h" 14 | #endif 15 | 16 | // Constants 17 | // Byte 0 18 | const uint8_t kTrotecIntro1 = 0x12; 19 | 20 | // Byte 1 21 | const uint8_t kTrotecIntro2 = 0x34; 22 | 23 | // Byte 2 24 | const uint8_t kTrotecAuto = 0; 25 | const uint8_t kTrotecCool = 1; 26 | const uint8_t kTrotecDry = 2; 27 | const uint8_t kTrotecFan = 3; 28 | 29 | const uint8_t kTrotecPowerBit = 0b00001000; 30 | 31 | const uint8_t kTrotecFanLow = 1; 32 | const uint8_t kTrotecFanMed = 2; 33 | const uint8_t kTrotecFanHigh = 3; 34 | 35 | // Byte 3 36 | const uint8_t kTrotecMinTemp = 18; 37 | const uint8_t kTrotecDefTemp = 25; 38 | const uint8_t kTrotecMaxTemp = 32; 39 | 40 | const uint8_t kTrotecSleepBit = 0b10000000; 41 | 42 | // Byte 5 43 | const uint8_t kTrotecTimerBit = 0b01000000; 44 | 45 | // Byte 6 46 | const uint8_t kTrotecMaxTimer = 23; 47 | 48 | // Legacy defines. (Deperecated) 49 | #define TROTEC_AUTO kTrotecAuto 50 | #define TROTEC_COOL kTrotecCool 51 | #define TROTEC_DRY kTrotecDry 52 | #define TROTEC_FAN kTrotecFan 53 | #define TROTEC_FAN_LOW kTrotecFanLow 54 | #define TROTEC_FAN_MED kTrotecFanMed 55 | #define TROTEC_FAN_HIGH kTrotecFanHigh 56 | #define TROTEC_MIN_TEMP kTrotecMinTemp 57 | #define TROTEC_MAX_TEMP kTrotecMaxTemp 58 | #define TROTEC_MAX_TIMER kTrotecMaxTimer 59 | 60 | class IRTrotecESP { 61 | public: 62 | explicit IRTrotecESP(const uint16_t pin, const bool inverted = false, 63 | const bool use_modulation = true); 64 | 65 | #if SEND_TROTEC 66 | void send(const uint16_t repeat = kTrotecDefaultRepeat); 67 | uint8_t calibrate(void) { return _irsend.calibrate(); } 68 | #endif // SEND_TROTEC 69 | void begin(void); 70 | 71 | void setPower(const bool state); 72 | bool getPower(void); 73 | 74 | void setTemp(const uint8_t celsius); 75 | uint8_t getTemp(void); 76 | 77 | void setSpeed(const uint8_t fan); 78 | uint8_t getSpeed(void); 79 | 80 | uint8_t getMode(void); 81 | void setMode(const uint8_t mode); 82 | 83 | bool getSleep(void); 84 | void setSleep(const bool on); 85 | 86 | uint8_t getTimer(void); 87 | void setTimer(const uint8_t timer); 88 | 89 | uint8_t* getRaw(void); 90 | void setRaw(const uint8_t state[]); 91 | static bool validChecksum(const uint8_t state[], 92 | const uint16_t length = kTrotecStateLength); 93 | uint8_t convertMode(const stdAc::opmode_t mode); 94 | uint8_t convertFan(const stdAc::fanspeed_t speed); 95 | static stdAc::opmode_t toCommonMode(const uint8_t mode); 96 | static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); 97 | stdAc::state_t toCommon(void); 98 | String toString(void); 99 | #ifndef UNIT_TEST 100 | 101 | private: 102 | IRsend _irsend; 103 | #else 104 | IRsendTest _irsend; 105 | #endif 106 | uint8_t remote_state[kTrotecStateLength]; 107 | static uint8_t calcChecksum(const uint8_t state[], 108 | const uint16_t length = kTrotecStateLength); 109 | void stateReset(void); 110 | void checksum(void); 111 | }; 112 | 113 | #endif // IR_TROTEC_H_ 114 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/src/ir_Whynter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Ken Shirriff 2 | // Copyright 2017 David Conran 3 | 4 | // Whynter A/C ARC-110WD added by Francesco Meschia 5 | // Whynter originally added from https://github.com/shirriff/Arduino-IRremote/ 6 | 7 | // Supports: 8 | // Brand: Whynter, Model: ARC-110WD A/C 9 | 10 | #include 11 | #include "IRrecv.h" 12 | #include "IRsend.h" 13 | #include "IRutils.h" 14 | 15 | // Constants 16 | 17 | const uint16_t kWhynterTick = 50; 18 | const uint16_t kWhynterHdrMarkTicks = 57; 19 | const uint16_t kWhynterHdrMark = kWhynterHdrMarkTicks * kWhynterTick; 20 | const uint16_t kWhynterHdrSpaceTicks = 57; 21 | const uint16_t kWhynterHdrSpace = kWhynterHdrSpaceTicks * kWhynterTick; 22 | const uint16_t kWhynterBitMarkTicks = 15; 23 | const uint16_t kWhynterBitMark = kWhynterBitMarkTicks * kWhynterTick; 24 | const uint16_t kWhynterOneSpaceTicks = 43; 25 | const uint16_t kWhynterOneSpace = kWhynterOneSpaceTicks * kWhynterTick; 26 | const uint16_t kWhynterZeroSpaceTicks = 15; 27 | const uint16_t kWhynterZeroSpace = kWhynterZeroSpaceTicks * kWhynterTick; 28 | const uint16_t kWhynterMinCommandLengthTicks = 2160; // Totally made up value. 29 | const uint32_t kWhynterMinCommandLength = 30 | kWhynterMinCommandLengthTicks * kWhynterTick; 31 | const uint16_t kWhynterMinGapTicks = 32 | kWhynterMinCommandLengthTicks - 33 | (2 * (kWhynterBitMarkTicks + kWhynterZeroSpaceTicks) + 34 | kWhynterBits * (kWhynterBitMarkTicks + kWhynterOneSpaceTicks)); 35 | const uint16_t kWhynterMinGap = kWhynterMinGapTicks * kWhynterTick; 36 | 37 | #if SEND_WHYNTER 38 | // Send a Whynter message. 39 | // 40 | // Args: 41 | // data: message to be sent. 42 | // nbits: Nr. of bits of the message to be sent. 43 | // repeat: Nr. of additional times the message is to be sent. 44 | // 45 | // Status: STABLE 46 | // 47 | // Ref: 48 | // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Whynter.cpp 49 | void IRsend::sendWhynter(uint64_t data, uint16_t nbits, uint16_t repeat) { 50 | // Set IR carrier frequency 51 | enableIROut(38); 52 | 53 | for (uint16_t i = 0; i <= repeat; i++) { 54 | // (Pre-)Header 55 | mark(kWhynterBitMark); 56 | space(kWhynterZeroSpace); 57 | sendGeneric( 58 | kWhynterHdrMark, kWhynterHdrSpace, kWhynterBitMark, kWhynterOneSpace, 59 | kWhynterBitMark, kWhynterZeroSpace, kWhynterBitMark, kWhynterMinGap, 60 | kWhynterMinCommandLength - (kWhynterBitMark + kWhynterZeroSpace), data, 61 | nbits, 38, true, 0, // Repeats are already handled. 62 | 50); 63 | } 64 | } 65 | #endif 66 | 67 | #if DECODE_WHYNTER 68 | // Decode the supplied Whynter message. 69 | // 70 | // Args: 71 | // results: Ptr to the data to decode and where to store the decode result. 72 | // nbits: Nr. of data bits to expect. 73 | // strict: Flag indicating if we should perform strict matching. 74 | // Returns: 75 | // boolean: True if it can decode it, false if it can't. 76 | // 77 | // Status: BETA Strict mode is ALPHA. 78 | // 79 | // Ref: 80 | // https://github.com/z3t0/Arduino-IRremote/blob/master/ir_Whynter.cpp 81 | bool IRrecv::decodeWhynter(decode_results *results, uint16_t nbits, 82 | bool strict) { 83 | if (results->rawlen < 2 * nbits + 2 * kHeader + kFooter - 1) 84 | return false; // We don't have enough entries to possibly match. 85 | 86 | // Compliance 87 | if (strict && nbits != kWhynterBits) 88 | return false; // Incorrect nr. of bits per spec. 89 | 90 | uint16_t offset = kStartOffset; 91 | uint64_t data = 0; 92 | // Pre-Header 93 | // Sequence begins with a bit mark and a zero space. 94 | if (!matchMark(results->rawbuf[offset++], kWhynterBitMark)) return false; 95 | if (!matchSpace(results->rawbuf[offset++], kWhynterZeroSpace)) return false; 96 | // Match Main Header + Data + Footer 97 | if (!matchGeneric(results->rawbuf + offset, &data, 98 | results->rawlen - offset, nbits, 99 | kWhynterHdrMark, kWhynterHdrSpace, 100 | kWhynterBitMark, kWhynterOneSpace, 101 | kWhynterBitMark, kWhynterZeroSpace, 102 | kWhynterBitMark, kWhynterMinGap, true)) return false; 103 | // Success 104 | results->decode_type = WHYNTER; 105 | results->bits = nbits; 106 | results->value = data; 107 | results->address = 0; 108 | results->command = 0; 109 | return true; 110 | } 111 | #endif 112 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/IRrecv_test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #ifndef TEST_IRRECV_TEST_H_ 4 | #define TEST_IRRECV_TEST_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "IRutils.h" 10 | 11 | #define EXPECT_STATE_EQ(a, b, c) \ 12 | for (uint8_t i = 0; i < c / 8; ++i) { \ 13 | EXPECT_EQ(a[i], b[i]) << "Expected state " \ 14 | "differs at i = " \ 15 | << uint64ToString(i); \ 16 | } 17 | #endif // TEST_IRRECV_TEST_H_ 18 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/IRsend_test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #ifndef TEST_IRSEND_TEST_H_ 4 | #define TEST_IRSEND_TEST_H_ 5 | 6 | #define __STDC_LIMIT_MACROS 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "IRrecv.h" 12 | #include "IRsend.h" 13 | #include "IRtimer.h" 14 | 15 | #define OUTPUT_BUF 10000U 16 | #define RAW_BUF 10000U 17 | 18 | #ifdef UNIT_TEST 19 | // Used to help simulate elapsed time in unit tests. 20 | extern uint32_t _IRtimer_unittest_now; 21 | #endif // UNIT_TEST 22 | 23 | class IRsendTest : public IRsend { 24 | public: 25 | uint32_t output[OUTPUT_BUF]; 26 | uint32_t freq[OUTPUT_BUF]; 27 | uint8_t duty[OUTPUT_BUF]; 28 | uint16_t last; 29 | uint16_t rawbuf[RAW_BUF]; 30 | decode_results capture; 31 | 32 | explicit IRsendTest(uint16_t x, bool i = false, bool j = true) 33 | : IRsend(x, i, j) { 34 | reset(); 35 | } 36 | 37 | void reset() { 38 | last = 0; 39 | for (uint16_t i = 0; i < OUTPUT_BUF; i++) output[i] = 0; 40 | for (uint16_t i = 0; i < RAW_BUF; i++) rawbuf[i] = 0; 41 | } 42 | 43 | std::string outputStr() { 44 | std::stringstream result; 45 | uint8_t lastduty = UINT8_MAX; // An impossible duty cycle value. 46 | uint32_t lastfreq = 0; // An impossible frequency value. 47 | if (last == 0 && output[0] == 0) return ""; 48 | for (uint16_t i = 0; i <= last; i++) { 49 | // Display the frequency only if it changes. 50 | if (freq[i] != lastfreq) { 51 | result << "f"; 52 | result << freq[i]; 53 | lastfreq = freq[i]; 54 | } 55 | // Display the duty cycle only if it changes. 56 | if (duty[i] != lastduty) { 57 | result << "d"; 58 | result << static_cast(duty[i]); 59 | lastduty = duty[i]; 60 | } 61 | if ((i & 1) != outputOff) // Odd XOR outputOff 62 | result << "s"; 63 | else 64 | result << "m"; 65 | result << output[i]; 66 | } 67 | reset(); 68 | return result.str(); 69 | } 70 | 71 | void makeDecodeResult(uint16_t offset = 0) { 72 | capture.decode_type = UNKNOWN; 73 | capture.bits = 0; 74 | capture.rawlen = last + 2 - offset; 75 | capture.overflow = (last - offset >= (int16_t)RAW_BUF); 76 | capture.repeat = false; 77 | capture.address = 0; 78 | capture.command = 0; 79 | capture.value = 0; 80 | capture.rawbuf = rawbuf; 81 | for (uint16_t i = 0; (i < RAW_BUF - 1) && (offset < OUTPUT_BUF); 82 | i++, offset++) 83 | if (output[offset] / kRawTick > UINT16_MAX) 84 | rawbuf[i + 1] = UINT16_MAX; 85 | else 86 | rawbuf[i + 1] = output[offset] / kRawTick; 87 | } 88 | 89 | void dumpRawResult() { 90 | std::cout << std::dec; 91 | if (capture.rawlen == 0) return; 92 | std::cout << "uint16_t rawbuf[" << capture.rawlen - 1 << "] = {"; 93 | for (uint16_t i = 1; i < capture.rawlen; i++) { 94 | if (i % 8 == 1) std::cout << std::endl << " "; 95 | std::cout << (capture.rawbuf[i] * kRawTick); 96 | // std::cout << "(" << capture.rawbuf[i] << ")"; 97 | if (i < capture.rawlen - 1) std::cout << ", "; 98 | } 99 | std::cout << "};" << std::endl; 100 | } 101 | 102 | void addGap(uint32_t usecs) { space(usecs); } 103 | 104 | uint16_t mark(uint16_t usec) { 105 | IRtimer::add(usec); 106 | if (last >= OUTPUT_BUF) return 0; 107 | if (last & 1) // Is odd? (i.e. last call was a space()) 108 | output[++last] = usec; 109 | else 110 | output[last] += usec; 111 | duty[last] = _dutycycle; 112 | freq[last] = _freq_unittest; 113 | return 0; 114 | } 115 | 116 | void space(uint32_t time) { 117 | IRtimer::add(time); 118 | if (last >= OUTPUT_BUF) return; 119 | if (last & 1) { // Is odd? (i.e. last call was a space()) 120 | output[last] += time; 121 | } else { 122 | output[++last] = time; 123 | } 124 | duty[last] = _dutycycle; 125 | freq[last] = _freq_unittest; 126 | } 127 | }; 128 | 129 | #ifdef UNIT_TEST 130 | class IRsendLowLevelTest : public IRsend { 131 | public: 132 | std::string low_level_sequence; 133 | 134 | explicit IRsendLowLevelTest(uint16_t x, bool i = false, bool j = true) 135 | : IRsend(x, i, j) { 136 | reset(); 137 | } 138 | 139 | void reset() { low_level_sequence = ""; } 140 | 141 | protected: 142 | void _delayMicroseconds(uint32_t usec) { 143 | _IRtimer_unittest_now += usec; 144 | std::ostringstream Convert; 145 | Convert << usec; 146 | low_level_sequence += Convert.str() + "usecs"; 147 | } 148 | 149 | void ledOff() { low_level_sequence += "[Off]"; } 150 | 151 | void ledOn() { low_level_sequence += "[On]"; } 152 | }; 153 | #endif // UNIT_TEST 154 | 155 | #endif // TEST_IRSEND_TEST_H_ 156 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/ir_GlobalCache_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #include "IRsend.h" 4 | #include "IRsend_test.h" 5 | #include "gtest/gtest.h" 6 | 7 | // Tests for sendGlobalCache(). 8 | 9 | // Test sending a typical command wihtout a repeat. 10 | TEST(TestSendGlobalCache, NonRepeatingCode) { 11 | IRsendTest irsend(4); 12 | IRrecv irrecv(4); 13 | irsend.begin(); 14 | irsend.reset(); 15 | 16 | // Modified NEC TV "Power On" from Global Cache with no repeats 17 | uint16_t gc_test[71] = {38000, 1, 1, 342, 172, 21, 22, 21, 21, 21, 65, 21, 18 | 21, 21, 22, 21, 22, 21, 21, 21, 22, 21, 65, 21, 19 | 65, 21, 22, 21, 65, 21, 65, 21, 65, 21, 65, 21, 20 | 65, 21, 65, 21, 22, 21, 22, 21, 21, 21, 22, 21, 21 | 22, 21, 65, 21, 22, 21, 21, 21, 65, 21, 65, 21, 22 | 65, 21, 64, 22, 65, 21, 22, 21, 65, 21, 1519}; 23 | irsend.sendGC(gc_test, 71); 24 | irsend.makeDecodeResult(); 25 | EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture)); 26 | EXPECT_EQ(NEC, irsend.capture.decode_type); 27 | EXPECT_EQ(kNECBits, irsend.capture.bits); 28 | EXPECT_EQ(0x20DF827D, irsend.capture.value); 29 | EXPECT_EQ(0x4, irsend.capture.address); 30 | EXPECT_EQ(0x41, irsend.capture.command); 31 | EXPECT_EQ( 32 | "f38000d50" 33 | "m8892s4472m546s572m546s546m546s1690m546s546m546s572m546s572" 34 | "m546s546m546s572m546s1690m546s1690m546s572m546s1690m546s1690" 35 | "m546s1690m546s1690m546s1690m546s1690m546s572m546s572m546s546" 36 | "m546s572m546s572m546s1690m546s572m546s546m546s1690m546s1690" 37 | "m546s1690m546s1664m572s1690m546s572m546s1690m546s39494", 38 | irsend.outputStr()); 39 | } 40 | 41 | // Test sending typical command with repeats. 42 | TEST(TestSendGlobalCache, RepeatCode) { 43 | IRsendTest irsend(4); 44 | IRrecv irrecv(4); 45 | irsend.begin(); 46 | irsend.reset(); 47 | 48 | // Sherwood (NEC-like) "Power On" from Global Cache with 2 repeats 49 | uint16_t gc_test[75] = { 50 | 38000, 2, 69, 341, 171, 21, 64, 21, 64, 21, 21, 21, 21, 21, 21, 51 | 21, 21, 21, 21, 21, 64, 21, 64, 21, 21, 21, 64, 21, 21, 21, 52 | 21, 21, 21, 21, 64, 21, 21, 21, 64, 21, 21, 21, 21, 21, 21, 53 | 21, 64, 21, 21, 21, 21, 21, 21, 21, 21, 21, 64, 21, 64, 21, 54 | 64, 21, 21, 21, 64, 21, 64, 21, 64, 21, 1600, 341, 85, 21, 3647}; 55 | irsend.sendGC(gc_test, 75); 56 | irsend.makeDecodeResult(); 57 | EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture)); 58 | EXPECT_EQ(NEC, irsend.capture.decode_type); 59 | EXPECT_EQ(kNECBits, irsend.capture.bits); 60 | EXPECT_EQ(0xC1A28877, irsend.capture.value); 61 | EXPECT_EQ(0x4583, irsend.capture.address); 62 | EXPECT_EQ(0x11, irsend.capture.command); 63 | EXPECT_EQ( 64 | "f38000d50" 65 | "m8866s4446m546s1664m546s1664m546s546m546s546m546s546m546s546" 66 | "m546s546m546s1664m546s1664m546s546m546s1664m546s546m546s546" 67 | "m546s546m546s1664m546s546m546s1664m546s546m546s546m546s546" 68 | "m546s1664m546s546m546s546m546s546m546s546m546s1664m546s1664" 69 | "m546s1664m546s546m546s1664m546s1664m546s1664m546s41600" 70 | "m8866s2210m546s94822" 71 | "m8866s2210m546s94822", 72 | irsend.outputStr()); 73 | } 74 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/ir_Inax_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 crankyoldgit (David Conran) 2 | 3 | #include "IRsend.h" 4 | #include "IRsend_test.h" 5 | #include "IRutils.h" 6 | #include "gtest/gtest.h" 7 | 8 | 9 | // General housekeeping 10 | TEST(TestInax, Housekeeping) { 11 | ASSERT_EQ("INAX", typeToString(INAX)); 12 | ASSERT_FALSE(hasACState(INAX)); 13 | } 14 | 15 | // Tests for sendInax(). 16 | // Test sending typical data only. 17 | TEST(TestSendInax, SendDataOnly) { 18 | IRsendTest irsend(0); 19 | irsend.begin(); 20 | 21 | irsend.reset(); 22 | irsend.sendInax(0x5C32CD); // Small flush. 23 | EXPECT_EQ( 24 | "f38000d50" 25 | "m9000s4500" 26 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 27 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 28 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 29 | "m560s40000" 30 | "m9000s4500" 31 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 32 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 33 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 34 | "m560s40000", 35 | irsend.outputStr()); 36 | 37 | irsend.reset(); 38 | } 39 | 40 | // Test sending with different repeats. 41 | TEST(TestSendInax, SendWithRepeats) { 42 | IRsendTest irsend(0); 43 | irsend.begin(); 44 | 45 | irsend.reset(); 46 | irsend.sendInax(0x5C32CD, kInaxBits, 0); // 0 repeats. 47 | EXPECT_EQ( 48 | "f38000d50" 49 | "m9000s4500" 50 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 51 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 52 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 53 | "m560s40000", 54 | irsend.outputStr()); 55 | irsend.sendInax(0x5C32CD, kInaxBits, 2); // 2 repeats. 56 | EXPECT_EQ( 57 | "f38000d50" 58 | "m9000s4500" 59 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 60 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 61 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 62 | "m560s40000" 63 | "m9000s4500" 64 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 65 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 66 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 67 | "m560s40000" 68 | "m9000s4500" 69 | "m560s560m560s1675m560s560m560s1675m560s1675m560s1675m560s560m560s560" 70 | "m560s560m560s560m560s1675m560s1675m560s560m560s560m560s1675m560s560" 71 | "m560s1675m560s1675m560s560m560s560m560s1675m560s1675m560s560m560s1675" 72 | "m560s40000", 73 | irsend.outputStr()); 74 | } 75 | 76 | // Tests for decodeInax(). 77 | 78 | // Decode normal Inax messages. 79 | TEST(TestDecodeInax, SyntheticDecode) { 80 | IRsendTest irsend(0); 81 | IRrecv irrecv(0); 82 | irsend.begin(); 83 | 84 | // Normal Inax 24-bit message. 85 | irsend.reset(); 86 | irsend.sendInax(0x5C32CD); 87 | irsend.makeDecodeResult(); 88 | ASSERT_TRUE(irrecv.decode(&irsend.capture)); 89 | EXPECT_EQ(INAX, irsend.capture.decode_type); 90 | EXPECT_EQ(kInaxBits, irsend.capture.bits); 91 | EXPECT_EQ(0x5C32CD, irsend.capture.value); 92 | EXPECT_EQ(0, irsend.capture.address); 93 | EXPECT_EQ(0, irsend.capture.command); 94 | } 95 | 96 | // Decode real example via Issue #704 97 | TEST(TestDecodeInax, DecodeExamples) { 98 | IRsendTest irsend(0); 99 | IRrecv irrecv(0); 100 | irsend.begin(); 101 | 102 | irsend.reset(); 103 | // Inax Small Flush from Issue #309 104 | uint16_t smallFlushRawData[51] = { 105 | 8996, 4474, 568, 556, 560, 1676, 568, 556, 562, 1676, 562, 1678, 566, 106 | 1674, 566, 558, 560, 560, 566, 556, 566, 556, 560, 1678, 562, 1676, 566, 107 | 556, 562, 560, 564, 1672, 566, 556, 562, 1676, 562, 1678, 562, 560, 564, 108 | 558, 564, 1674, 560, 1678, 564, 560, 566, 1670, 562}; 109 | 110 | irsend.sendRaw(smallFlushRawData, 51, 38); 111 | irsend.makeDecodeResult(); 112 | 113 | ASSERT_TRUE(irrecv.decode(&irsend.capture)); 114 | EXPECT_EQ(INAX, irsend.capture.decode_type); 115 | EXPECT_EQ(kInaxBits, irsend.capture.bits); 116 | EXPECT_EQ(0x5C32CD, irsend.capture.value); 117 | EXPECT_EQ(0, irsend.capture.address); 118 | EXPECT_EQ(0, irsend.capture.command); 119 | } 120 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/ir_MWM_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | // Copyright 2018 Brett T. Warden 3 | 4 | #include "IRrecv.h" 5 | #include "IRrecv_test.h" 6 | #include "IRsend.h" 7 | #include "IRsend_test.h" 8 | #include "gtest/gtest.h" 9 | 10 | // MM MM WW WW MM MM 11 | // MMM MMM WW WW MMM MMM 12 | // MM M MM WW W WW MM M MM 13 | // MM MM WWW WWW MM MM 14 | // MM MM WW WW MM MM 15 | 16 | // Tests for sendMWM(). 17 | 18 | // Test sending simplest case data only. 19 | TEST(TestSendMWM, SendDataOnly) { 20 | IRsendTest irsend(4); 21 | irsend.begin(); 22 | 23 | irsend.reset(); 24 | unsigned char test1[] = {0x96, 0x19, 0x10, 0x24, 0x0A, 25 | 0x6B, 0x20, 0x03, 0x82}; 26 | /* 27 | ++--+-++-- 28 | +-++--+++- 29 | +++++-+++- 30 | +++-++-++- 31 | ++-+-++++- 32 | +--+-+--+- 33 | ++++++-++- 34 | +--++++++- 35 | ++-+++++-- 36 | */ 37 | irsend.sendMWM(test1, sizeof(test1), 0); 38 | EXPECT_EQ( 39 | "f38000d25" 40 | "m834s834m417s417m834s834" 41 | "m417s417m834s834m1251s417" 42 | "m2085s417m1251s417" 43 | "m1251s417m834s417m834s417" 44 | "m834s417m417s417m1668s417" 45 | "m417s834m417s417m417s834m417s417" 46 | "m2502s417m834s417" 47 | "m417s834m2502s417" 48 | "m834s417m2085s30834", irsend.outputStr()); 49 | 50 | irsend.reset(); 51 | unsigned char test2[] = { 52 | 0x99, 0x26, 0x66, 0x6E, 0xD1, 0x42, 0x06, 53 | 0x20, 0xD0, 0x32, 0xF0, 0x0B 54 | // +-++--++-- 55 | // ++--++-++- 56 | // ++--++--+- 57 | // ++---+--+- 58 | // +-+++-+--- 59 | // ++-++++-+- 60 | // ++--+++++- 61 | // ++++++-++- 62 | // +++++-+--- 63 | // ++-++--++- 64 | // +++++----- 65 | // +--+-++++- 66 | }; 67 | irsend.sendMWM(test2, sizeof(test2), 0); 68 | EXPECT_EQ( 69 | "f38000d25" 70 | "m417s417m834s834m834s834" 71 | "m834s834m834s417m834s417" 72 | "m834s834m834s834m417s417" 73 | "m834s1251m417s834m417s417" 74 | "m417s417m1251s417m417s1251" 75 | "m834s417m1668s417m417s417" 76 | "m834s834m2085s417" 77 | "m2502s417m834s417" 78 | "m2085s417m417s1251" 79 | "m834s417m834s834m834s417" 80 | "m2085s2085" 81 | "m417s834m417s417m1668s30417", irsend.outputStr()); 82 | } 83 | 84 | // Tests for decodeMWM(). 85 | 86 | // Example data 87 | TEST(TestDecodeMWM, RealExamples) { 88 | IRsendTest irsend(0); 89 | IRrecv irrecv(0); 90 | irsend.begin(); 91 | 92 | irsend.reset(); 93 | uint16_t short_code[] = { 94 | 915, 793, 488, 366, 915, 793, 427, 366, 915, 793, 1281, 427, 95 | 2136, 366, 1281, 366, 915, 793, 427, 854, 854, 366, 1281, 854, 96 | 1708, 366, 488, 793, 854, 427, 427, 427, 427, 366, 854, 427, 97 | 2563, 366, 488, 793, 2563, 366, 488, 2075, 427, 34057}; 98 | unsigned char short_expected[] = {0x96, 0x19, 0x10, 0x36, 0x0C, 99 | 0x53, 0x02, 0x03, 0xDF}; 100 | irsend.sendRaw(short_code, sizeof(short_code) / sizeof(short_code[0]), 38000); 101 | irsend.makeDecodeResult(); 102 | ASSERT_TRUE(irrecv.decode(&irsend.capture)); 103 | EXPECT_EQ(MWM, irsend.capture.decode_type); 104 | EXPECT_EQ(8 * sizeof(short_expected) / sizeof(short_expected[0]), 105 | irsend.capture.bits); 106 | EXPECT_STATE_EQ(short_expected, irsend.capture.state, irsend.capture.bits); 107 | 108 | irsend.reset(); 109 | uint16_t long_code[] = { 110 | 427, 427, 854, 854, 854, 793, 915, 793, 854, 366, 915, 366, 854, 111 | 854, 854, 793, 488, 366, 915, 1220, 427, 793, 488, 366, 488, 366, 112 | 1281, 427, 427, 1220, 915, 366, 1708, 366, 488, 366, 854, 854, 2136, 113 | 366, 2563, 366, 854, 427, 2136, 366, 488, 1220, 854, 427, 854, 793, 114 | 915, 366, 2136, 2075, 427, 793, 488, 366, 1708, 30517}; 115 | unsigned char long_expected[] = {0x99, 0x26, 0x66, 0x6E, 0xD1, 0x42, 116 | 0x06, 0x20, 0xD0, 0x32, 0xF0, 0x0B}; 117 | irsend.sendRaw(long_code, sizeof(long_code) / sizeof(long_code[0]), 38000); 118 | irsend.makeDecodeResult(); 119 | ASSERT_TRUE(irrecv.decode(&irsend.capture)); 120 | EXPECT_EQ(MWM, irsend.capture.decode_type); 121 | EXPECT_EQ(8 * sizeof(long_expected) / sizeof(long_expected[0]), 122 | irsend.capture.bits); 123 | EXPECT_STATE_EQ(long_expected, irsend.capture.state, irsend.capture.bits); 124 | } 125 | 126 | // vim: et:ts=2:sw=2 127 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/test/ir_Sherwood_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 David Conran 2 | 3 | #include "IRsend.h" 4 | #include "IRsend_test.h" 5 | #include "gtest/gtest.h" 6 | 7 | // Tests for sendSherwood(). 8 | 9 | // Test sending typical data only. 10 | TEST(TestSendSherwood, SendDataOnly) { 11 | IRsendTest irsend(4); 12 | irsend.begin(); 13 | 14 | irsend.reset(); 15 | irsend.sendSherwood(0xC1A28877); 16 | EXPECT_EQ( 17 | "f38000d33" 18 | "m8960s4480m560s1680m560s1680m560s560m560s560m560s560m560s560" 19 | "m560s560m560s1680m560s1680m560s560m560s1680m560s560m560s560" 20 | "m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560" 21 | "m560s1680m560s560m560s560m560s560m560s560m560s1680m560s1680" 22 | "m560s1680m560s560m560s1680m560s1680m560s1680m560s42560" 23 | "m8960s2240m560s96320", 24 | irsend.outputStr()); 25 | } 26 | 27 | // Test sending typical data with extra repeats. 28 | TEST(TestSendSherwood, SendDataWithRepeats) { 29 | IRsendTest irsend(4); 30 | irsend.begin(); 31 | 32 | irsend.reset(); 33 | irsend.sendSherwood(0xC1A28877, 32, 2); 34 | EXPECT_EQ( 35 | "f38000d33" 36 | "m8960s4480m560s1680m560s1680m560s560m560s560m560s560m560s560" 37 | "m560s560m560s1680m560s1680m560s560m560s1680m560s560m560s560" 38 | "m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560" 39 | "m560s1680m560s560m560s560m560s560m560s560m560s1680m560s1680" 40 | "m560s1680m560s560m560s1680m560s1680m560s1680m560s42560" 41 | "m8960s2240m560s96320" 42 | "m8960s2240m560s96320", 43 | irsend.outputStr()); 44 | } 45 | 46 | // Test sending typical data with explicit no repeats. 47 | TEST(TestSendSherwood, SendDataWithZeroRepeats) { 48 | IRsendTest irsend(4); 49 | irsend.begin(); 50 | 51 | irsend.reset(); 52 | irsend.sendSherwood(0xC1A28877, 32, 0); 53 | // Should have a single NEC repeat, as we always send one. 54 | EXPECT_EQ( 55 | "f38000d33" 56 | "m8960s4480m560s1680m560s1680m560s560m560s560m560s560m560s560" 57 | "m560s560m560s1680m560s1680m560s560m560s1680m560s560m560s560" 58 | "m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560" 59 | "m560s1680m560s560m560s560m560s560m560s560m560s1680m560s1680" 60 | "m560s1680m560s560m560s1680m560s1680m560s1680m560s42560" 61 | "m8960s2240m560s96320", 62 | irsend.outputStr()); 63 | } 64 | 65 | // Test that a typical Sherwood send decodes as the appropriate NEC value. 66 | TEST(TestSendSherwood, DecodesAsNEC) { 67 | IRsendTest irsend(4); 68 | IRrecv irrecv(0); 69 | irsend.begin(); 70 | 71 | irsend.reset(); 72 | irsend.sendSherwood(0xC1A28877); 73 | irsend.makeDecodeResult(); 74 | 75 | EXPECT_TRUE(irrecv.decodeNEC(&irsend.capture)); 76 | EXPECT_EQ(NEC, irsend.capture.decode_type); 77 | EXPECT_EQ(kNECBits, irsend.capture.bits); 78 | EXPECT_EQ(0xC1A28877, irsend.capture.value); 79 | EXPECT_EQ(0x4583, irsend.capture.address); 80 | EXPECT_EQ(0x11, irsend.capture.command); 81 | } 82 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/tools/RawToGlobalCache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Convert IRremoteESP8266's rawData output into Global Cache format. 3 | 4 | function isDigits() 5 | { 6 | [[ "$1" =~ ^[0-9]+$ ]] 7 | } 8 | 9 | function usage() 10 | { 11 | cat << EOF 12 | Usage: $0 Frequency_in_Hz 13 | Reads an IRremoteESP8266 rawData declaration from STDIN and converts it to 14 | GlobalCache format. 15 | e.g. 16 | uint16_t rawbuf[37] = { 17 | 7930, 3952, 494, 1482, 520, 1482, 494, 1508, 18 | 494, 520, 494, 1482, 494, 520, 494, 1482, 19 | 494, 1482, 494, 3978, 494, 520, 494, 520, 20 | 494, 520, 494, 520, 520, 520, 494, 520, 21 | 494, 520, 494, 520, 494}; 22 | EOF 23 | exit 1 24 | } 25 | 26 | # We need a frequency argument. 27 | if [[ $# -ne 1 ]]; then 28 | usage 29 | fi 30 | HZ="$1" 31 | # HZ must be a positive number 32 | if ! isDigits "${HZ}"; then 33 | usage 34 | fi 35 | # HZ must not be zero. 36 | if [[ ${HZ} == 0 ]]; then 37 | usage 38 | fi 39 | 40 | 41 | PERIOD_OFFSET=0 42 | period=$((((1000000 + (${HZ} / 2)) / ${HZ}) + ${PERIOD_OFFSET})) 43 | result="${HZ},1,1" 44 | while read line; do 45 | # Quick and Dirty Removal of any array declaration syntax, and any commas. 46 | line="$(echo ${line} | sed 's/uint.*{//i' | sed 's/,//g' | sed 's/};.*//g')" 47 | for msecs in ${line}; do 48 | if isDigits "${msecs}"; then 49 | result="${result},$((${msecs} / ${period}))" 50 | fi 51 | done 52 | done 53 | echo "GlobalCache code = \"${result}\"" 54 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/tools/gc_decode.cpp: -------------------------------------------------------------------------------- 1 | // Quick and dirty tool to decode GlobalCache (GC) codes 2 | // and ProntoHex codes 3 | // Copyright 2017 Jorge Cisneros 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "IRsend.h" 11 | #include "IRsend_test.h" 12 | #include "IRutils.h" 13 | 14 | const uint16_t kMaxGcCodeLength = 10000; 15 | 16 | void str_to_uint16(char *str, uint16_t *res, uint8_t base) { 17 | char *end; 18 | errno = 0; 19 | intmax_t val = strtoimax(str, &end, base); 20 | if (errno == ERANGE || val < 0 || val > UINT16_MAX || end == str || 21 | *end != '\0') 22 | return; 23 | *res = (uint16_t)val; 24 | } 25 | 26 | void usage_error(char *name) { 27 | std::cerr << "Usage: " << name << " [-raw] " << std::endl 28 | << "Usage: " << name << " -prontohex [-raw] " 29 | << std::endl; 30 | } 31 | 32 | int main(int argc, char *argv[]) { 33 | int argv_offset = 1; 34 | bool dumpraw = false; 35 | bool prontohex = false; 36 | 37 | // Check the invocation/calling usage. 38 | if (argc < 2 || argc > 4) { 39 | usage_error(argv[0]); 40 | return 1; 41 | } 42 | if (strncmp("-prontohex", argv[argv_offset], 10) == 0) { 43 | prontohex = true; 44 | argv_offset++; 45 | } 46 | 47 | if (strncmp("-raw", argv[argv_offset], 4) == 0) { 48 | dumpraw = true; 49 | argv_offset++; 50 | } 51 | if (argc - argv_offset != 1) { 52 | usage_error(argv[0]); 53 | return 1; 54 | } 55 | 56 | uint16_t gc_test[kMaxGcCodeLength]; 57 | int index = 0; 58 | char *pch; 59 | char *saveptr1; 60 | char *sep = const_cast(","); 61 | int codebase = 10; 62 | 63 | if (prontohex) { 64 | sep = const_cast(" "); 65 | codebase = 16; 66 | } 67 | 68 | pch = strtok_r(argv[argv_offset], sep, &saveptr1); 69 | while (pch != NULL && index < kMaxGcCodeLength) { 70 | str_to_uint16(pch, &gc_test[index], codebase); 71 | pch = strtok_r(NULL, sep, &saveptr1); 72 | index++; 73 | } 74 | 75 | IRsendTest irsend(4); 76 | IRrecv irrecv(4); 77 | irsend.begin(); 78 | irsend.reset(); 79 | 80 | if (prontohex) { 81 | irsend.sendPronto(gc_test, index); 82 | } else { 83 | irsend.sendGC(gc_test, index); 84 | } 85 | irsend.makeDecodeResult(); 86 | irrecv.decode(&irsend.capture); 87 | 88 | std::cout << "Code length " << index << std::endl 89 | << "Code type " << irsend.capture.decode_type << " (" 90 | << typeToString(irsend.capture.decode_type) << ")" << std::endl 91 | << "Code bits " << irsend.capture.bits << std::endl; 92 | if (hasACState(irsend.capture.decode_type)) { 93 | std::cout << "State value 0x"; 94 | for (uint16_t i = 0; i < irsend.capture.bits / 8; i++) 95 | printf("%02X", irsend.capture.state[i]); 96 | std::cout << std::endl; 97 | } else { 98 | std::cout << "Code value 0x" << std::hex << irsend.capture.value 99 | << std::endl 100 | << "Code address 0x" << std::hex << irsend.capture.address 101 | << std::endl 102 | << "Code command 0x" << std::hex << irsend.capture.command 103 | << std::endl; 104 | } 105 | 106 | if (dumpraw || irsend.capture.decode_type == UNKNOWN) irsend.dumpRawResult(); 107 | 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/tools/mkkeywords: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Generate a keywords.txt for the library that is suitable for the Arduino IDE. 3 | # Expects to run from the top directory of the library. 4 | 5 | # Set the locale for sorting 6 | export LC_ALL=C 7 | 8 | cat << EndOfTextEndOfTextEndOfText 9 | ######################################### 10 | # Syntax Coloring Map For IRremoteESP8266 11 | ######################################### 12 | 13 | ################################################ 14 | # WARNING: Do NOT edit this file directly. 15 | # It is generated by 'tools/mkkeywords' 16 | # e.g. tools/mkkeywords > keywords.txt 17 | ################################################ 18 | 19 | ####################################################### 20 | # The Arduino IDE requires the use of a tab separator 21 | # between the name and identifier. Without this tab the 22 | # keyword is not highlighted. 23 | # 24 | # Reference: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords 25 | ####################################################### 26 | 27 | ####################################### 28 | # Datatypes & Classes (KEYWORD1) 29 | ####################################### 30 | 31 | EndOfTextEndOfTextEndOfText 32 | 33 | CLASSES=$(egrep -h "^ *((enum|class) |} [a-zA-Z0-9_]+_t;$)" src/*.h | 34 | sed 's/^ *//;s/enum class//;s/\;$//' | cut -d' ' -f2 | sort -u) 35 | for i in ${CLASSES}; do 36 | echo -e "${i}\tKEYWORD1" 37 | done | sort -du 38 | 39 | cat << EndOfTextEndOfTextEndOfText 40 | 41 | ####################################### 42 | # Methods and Functions (KEYWORD2) 43 | ####################################### 44 | 45 | EndOfTextEndOfTextEndOfText 46 | CTYPES="u?int(8|16|32|64)?(_t)?|void|bool|char|float|long|double|String|static" 47 | OURTYPES="match_result_t|state_t|decode_type_t" 48 | METHODS=$(egrep -h "^[ ]{0,2}(${CTYPES}|${OURTYPES})\*? [^ ]*\(" src/*.cpp | 49 | sed 's/^ //' | cut -d' ' -f2 | sed 's/^\([^:]*::\| *\* *\)//' | 50 | cut -d'(' -f1 | sort -u | grep -v RAM_ATTR) 51 | for i in ${METHODS}; do 52 | echo -e "${i}\tKEYWORD2" 53 | done | sort -u 54 | 55 | cat << EndOfTextEndOfTextEndOfText 56 | 57 | ####################################### 58 | # Constants (LITERAL1) 59 | ####################################### 60 | 61 | EndOfTextEndOfTextEndOfText 62 | LITERALS=$(grep "^#define [A-Z]" src/*.cpp src/*.h | 63 | while read ignore define ignore; do 64 | echo ${define}; 65 | done | sort -u | 66 | grep -v [\(\)] | grep -v ^_ | grep -v _\$ | grep -v VIRTUAL) 67 | CONSTS=$(grep "^const " src/*.cpp src/*.h | 68 | sed 's/\[.*\] =.*//;s/ =.*//;s/^.* k/k/') 69 | ENUMS=$(cat src/*.h | while read a b; do 70 | if [[ ${a} == "};" ]]; then 71 | ENUM=0; 72 | fi; 73 | if [[ ${ENUM} -eq 1 ]]; then 74 | echo $a | sed 's/,//g'; 75 | fi; 76 | if [[ ${a} == "enum" ]]; then 77 | ENUM=1; 78 | fi; 79 | done) 80 | for i in ${LITERALS} ${CONSTS} ${ENUMS}; do 81 | echo -e "${i}\tLITERAL1" 82 | done | sort -u 83 | -------------------------------------------------------------------------------- /IRremoteESP8266-2.6.4/tools/mode2_decode.cpp: -------------------------------------------------------------------------------- 1 | // Quick and dirty tool to decode mode2 data from LIRC 2 | // Copyright 2018 Brett T. Warden 3 | // based on c2_decode.cpp, Copyright 2017 Jorge Cisneros 4 | 5 | // Usage example: 6 | // mode2 -H udp -d 5000 | ./mode2_decode 7 | 8 | /* Sample input (alternating space and pulse durations in microseconds): 9 | space 500000 10 | pulse 915 11 | space 793 12 | pulse 488 13 | space 366 14 | pulse 915 15 | space 793 16 | pulse 427 17 | space 500000 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "IRsend.h" 28 | #include "IRsend_test.h" 29 | #include "IRutils.h" 30 | 31 | const uint16_t kMaxGcCodeLength = 10000; 32 | 33 | void str_to_uint16(char *str, uint16_t *res, uint8_t base) { 34 | char *end; 35 | errno = 0; 36 | intmax_t val = strtoimax(str, &end, base); 37 | if (errno == ERANGE || val < 0 || val > UINT16_MAX || end == str || 38 | *end != '\0') 39 | return; 40 | *res = (uint16_t)val; 41 | } 42 | 43 | void usage_error(char *name) { 44 | std::cerr << "Usage: " << name << " [-raw]" << std::endl; 45 | } 46 | 47 | int main(int argc, char *argv[]) { 48 | bool dumpraw = false; 49 | 50 | // Check the invocation/calling usage. 51 | if (argc > 2) { 52 | usage_error(argv[0]); 53 | return 1; 54 | } 55 | 56 | if (argc == 2 && strncmp("-raw", argv[1], 4) == 0) { 57 | dumpraw = true; 58 | } 59 | 60 | int index = 0; 61 | std::string line, type; 62 | std::string pulse = "pulse"; 63 | std::string space = "space"; 64 | int duration; 65 | 66 | IRsendTest irsend(4); 67 | IRrecv irrecv(4); 68 | irsend.begin(); 69 | irsend.reset(); 70 | 71 | while (getline(std::cin, line)) { 72 | std::istringstream iss1(line); 73 | iss1 >> type; 74 | iss1 >> duration; 75 | 76 | // Clamp duration to int16_t 77 | if (duration > 0xFFFF) { 78 | duration = 0xFFFF; 79 | } 80 | if (pulse.compare(type) == 0) { 81 | irsend.mark(duration); 82 | } else if (space.compare(type) == 0) { 83 | irsend.space(duration); 84 | } 85 | index++; 86 | 87 | if (duration > 20000 || index >= kMaxGcCodeLength) { 88 | // Skip long spaces at beginning 89 | if (index > 1) { 90 | irsend.makeDecodeResult(); 91 | irrecv.decode(&irsend.capture); 92 | 93 | std::cout << "Code length " << index << std::endl 94 | << "Code type " << irsend.capture.decode_type << " (" 95 | << typeToString(irsend.capture.decode_type) << ")" 96 | << std::endl 97 | << "Code bits " << irsend.capture.bits << std::endl; 98 | if (hasACState(irsend.capture.decode_type)) { 99 | std::cout << "State value 0x"; 100 | for (uint16_t i = 0; i < irsend.capture.bits / 8; i++) 101 | printf("%02X", irsend.capture.state[i]); 102 | std::cout << std::endl; 103 | } else { 104 | std::cout << "Code value 0x" << std::hex << irsend.capture.value 105 | << std::endl 106 | << "Code address 0x" << std::hex << irsend.capture.address 107 | << std::endl 108 | << "Code command 0x" << std::hex << irsend.capture.command 109 | << std::endl; 110 | } 111 | 112 | if (dumpraw || irsend.capture.decode_type == UNKNOWN) 113 | irsend.dumpRawResult(); 114 | } 115 | 116 | irsend.reset(); 117 | index = 0; 118 | } 119 | } 120 | 121 | return 0; 122 | } 123 | -------------------------------------------------------------------------------- /bom/IRMQTT_POS.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/bom/IRMQTT_POS.csv -------------------------------------------------------------------------------- /fimware/IRMQTT-MINI.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/fimware/IRMQTT-MINI.bin -------------------------------------------------------------------------------- /fimware/IRMQTTServer.ino.generic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/fimware/IRMQTTServer.ino.generic.bin -------------------------------------------------------------------------------- /fimware/hkusb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/fimware/hkusb.bin -------------------------------------------------------------------------------- /gerber/IRMQTT-B.Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.0.2)-1* 2 | G04 #@! TF.CreationDate,2019-08-16T13:34:43+08:00* 3 | G04 #@! TF.ProjectId,IRMQTT,49524d51-5454-42e6-9b69-6361645f7063,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.0.2)-1) date 2019-08-16 13:34:43* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,0.650000X0.600000*% 15 | %ADD11R,0.600000X0.650000*% 16 | %ADD12O,0.800000X1.500000*% 17 | %ADD13R,1.250000X0.700000*% 18 | %ADD14O,1.900000X0.700000*% 19 | %ADD15O,3.500000X2.000000*% 20 | %ADD16O,2.100000X0.700000*% 21 | %ADD17R,0.700000X1.250000*% 22 | %ADD18R,0.930000X0.980000*% 23 | G04 APERTURE END LIST* 24 | D10* 25 | G04 #@! TO.C,R7* 26 | X73576180Y-47783300D03* 27 | X73576180Y-46933300D03* 28 | G04 #@! TD* 29 | D11* 30 | G04 #@! TO.C,R5* 31 | X80547660Y-54960520D03* 32 | X81397660Y-54960520D03* 33 | G04 #@! TD* 34 | D10* 35 | G04 #@! TO.C,R2* 36 | X64147700Y-63190120D03* 37 | X64147700Y-62340120D03* 38 | G04 #@! TD* 39 | G04 #@! TO.C,R4* 40 | X80045560Y-47065380D03* 41 | X80045560Y-47915380D03* 42 | G04 #@! TD* 43 | D12* 44 | G04 #@! TO.C,U1* 45 | X63792280Y-50071020D03* 46 | X64892280Y-50071020D03* 47 | X69292280Y-50071020D03* 48 | X70392280Y-50071020D03* 49 | X63792280Y-60071020D03* 50 | X64892280Y-60071020D03* 51 | X67092280Y-60071020D03* 52 | X68192280Y-60071020D03* 53 | X70392280Y-60071020D03* 54 | X71492280Y-60071020D03* 55 | G04 #@! TD* 56 | D13* 57 | G04 #@! TO.C,Q1* 58 | X75983460Y-47762120D03* 59 | X78483460Y-48712120D03* 60 | X78483460Y-46812120D03* 61 | G04 #@! TD* 62 | D14* 63 | G04 #@! TO.C,U2* 64 | X72771000Y-65589280D03* 65 | D15* 66 | X70271000Y-64089280D03* 67 | D16* 68 | X72671000Y-64089280D03* 69 | D14* 70 | X72771000Y-62589280D03* 71 | G04 #@! TD* 72 | D17* 73 | G04 #@! TO.C,Q3* 74 | X80723740Y-62047120D03* 75 | X81673740Y-59547120D03* 76 | X79773740Y-59547120D03* 77 | G04 #@! TD* 78 | D18* 79 | G04 #@! TO.C,C1* 80 | X67221860Y-64990980D03* 81 | X65681860Y-64990980D03* 82 | G04 #@! TD* 83 | D10* 84 | G04 #@! TO.C,C2* 85 | X67116960Y-62286780D03* 86 | X67116960Y-63136780D03* 87 | G04 #@! TD* 88 | D18* 89 | G04 #@! TO.C,D1* 90 | X70431280Y-47228760D03* 91 | X71971280Y-47228760D03* 92 | G04 #@! TD* 93 | D10* 94 | G04 #@! TO.C,C3* 95 | X64162940Y-64572780D03* 96 | X64162940Y-65422780D03* 97 | G04 #@! TD* 98 | D11* 99 | G04 #@! TO.C,R6* 100 | X80760940Y-57886600D03* 101 | X79910940Y-57886600D03* 102 | G04 #@! TD* 103 | D10* 104 | G04 #@! TO.C,R1* 105 | X65587880Y-62332500D03* 106 | X65587880Y-63182500D03* 107 | G04 #@! TD* 108 | D17* 109 | G04 #@! TO.C,Q2* 110 | X81582340Y-53309520D03* 111 | X79682340Y-53309520D03* 112 | X80632340Y-50809520D03* 113 | G04 #@! TD* 114 | M02* 115 | -------------------------------------------------------------------------------- /gerber/IRMQTT-Edge.Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.0.2)-1* 2 | G04 #@! TF.CreationDate,2019-08-16T13:34:43+08:00* 3 | G04 #@! TF.ProjectId,IRMQTT,49524d51-5454-42e6-9b69-6361645f7063,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW (5.0.2)-1) date 2019-08-16 13:34:43* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %ADD10C,0.150000*% 14 | G04 APERTURE END LIST* 15 | D10* 16 | X82557620Y-63860680D02* 17 | X82560160Y-49314100D01* 18 | X62458600Y-49034700D02* 19 | X62458600Y-63581280D01* 20 | X79494380Y-45948600D02* 21 | X65821560Y-45948600D01* 22 | X79479140Y-45948600D02* 23 | G75* 24 | G02X82559815Y-49311102I-247282J-3319042D01* 25 | G01* 26 | X79222600Y-66949320D02* 27 | X65547240Y-66949320D01* 28 | X65539620Y-66949320D02* 29 | G75* 30 | G02X62458945Y-63586818I247282J3319042D01* 31 | G01* 32 | X62458600Y-49029620D02* 33 | G75* 34 | G02X65821102Y-45948945I3319042J-247282D01* 35 | G01* 36 | X82557162Y-63868645D02* 37 | G75* 38 | G02X79194660Y-66949320I-3319042J247282D01* 39 | G01* 40 | M02* 41 | -------------------------------------------------------------------------------- /gerber/IRMQTT-F.Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.0.2)-1* 2 | G04 #@! TF.CreationDate,2019-08-16T13:34:43+08:00* 3 | G04 #@! TF.ProjectId,IRMQTT,49524d51-5454-42e6-9b69-6361645f7063,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Top* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.0.2)-1) date 2019-08-16 13:34:43* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10R,1.500000X1.000000*% 15 | %ADD11O,0.800000X2.000000*% 16 | %ADD12R,0.600000X0.650000*% 17 | %ADD13R,1.500000X1.100000*% 18 | %ADD14R,1.600000X1.200000*% 19 | %ADD15R,1.200000X1.600000*% 20 | G04 APERTURE END LIST* 21 | D10* 22 | G04 #@! TO.C,WI* 23 | X64739520Y-50728880D03* 24 | X64739520Y-47528880D03* 25 | G04 #@! TD* 26 | D11* 27 | G04 #@! TO.C,J1* 28 | X80068420Y-47355760D03* 29 | X78798420Y-47355760D03* 30 | X77528420Y-47355760D03* 31 | X76258420Y-47355760D03* 32 | G04 #@! TD* 33 | D12* 34 | G04 #@! TO.C,R3* 35 | X70696640Y-60104020D03* 36 | X69846640Y-60104020D03* 37 | G04 #@! TD* 38 | D13* 39 | G04 #@! TO.C,IRFT1* 40 | X64470280Y-62816740D03* 41 | X70770280Y-62816740D03* 42 | X64470280Y-65356740D03* 43 | X70770280Y-65356740D03* 44 | G04 #@! TD* 45 | D14* 46 | G04 #@! TO.C,D6* 47 | X81003140Y-58230420D03* 48 | X81003140Y-55430420D03* 49 | G04 #@! TD* 50 | D15* 51 | G04 #@! TO.C,D4* 52 | X73685400Y-65699640D03* 53 | X76485400Y-65699640D03* 54 | G04 #@! TD* 55 | G04 #@! TO.C,D3* 56 | X73617740Y-47386240D03* 57 | X70817740Y-47386240D03* 58 | G04 #@! TD* 59 | D14* 60 | G04 #@! TO.C,D5* 61 | X64076580Y-55020560D03* 62 | X64076580Y-57820560D03* 63 | G04 #@! TD* 64 | G04 #@! TO.C,D2* 65 | X70832980Y-54583680D03* 66 | X70832980Y-57383680D03* 67 | G04 #@! TD* 68 | M02* 69 | -------------------------------------------------------------------------------- /gerber/IRMQTT-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad (5.0.2)-1} date 2019-08-16 13:34:46 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | T1C0.0866 7 | % 8 | G90 9 | G05 10 | T1 11 | X2.6556Y-1.8855 12 | X3.1641Y-2.5313 13 | T0 14 | M30 15 | -------------------------------------------------------------------------------- /gerber/IRMQTT-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad (5.0.2)-1} date 2019-08-16 13:34:46 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | T1C0.0157 7 | T2C0.0276 8 | T3C0.0354 9 | % 10 | G90 11 | G05 12 | T1 13 | X2.4906Y-2.51 14 | X2.5563Y-2.4251 15 | X2.5921Y-2.283 16 | X2.6048Y-2.5293 17 | X2.6807Y-2.485 18 | X2.717Y-2.1725 19 | X2.8259Y-2.0274 20 | X2.848Y-2.366 21 | X2.8591Y-1.9827 22 | X2.901Y-2.3027 23 | X2.9027Y-2.0998 24 | X3.0821Y-2.3076 25 | X3.1458Y-2.4463 26 | X3.1585Y-1.9375 27 | X3.1678Y-2.0458 28 | T2 29 | X2.5115Y-2.0107 30 | T2 31 | X3.0287Y-2.0757G85X3.0287Y-2.0954 32 | G05 33 | X3.0287Y-2.1742G85X3.0287Y-2.1938 34 | G05 35 | X3.0287Y-2.2529G85X3.0287Y-2.2726 36 | G05 37 | X3.0287Y-2.3513G85X3.0287Y-2.371 38 | G05 39 | T3 40 | X3.0591Y-1.9905G85X2.9685Y-1.9905 41 | G05 42 | X3.0605Y-2.4588G85X2.9699Y-2.4588 43 | G05 44 | T0 45 | M30 46 | -------------------------------------------------------------------------------- /pcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pcb.png -------------------------------------------------------------------------------- /pic/DSC_4234.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/DSC_4234.JPG -------------------------------------------------------------------------------- /pic/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/Thumbs.db -------------------------------------------------------------------------------- /pic/irmqtt-mqtt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt-mqtt.gif -------------------------------------------------------------------------------- /pic/irmqtt-ota.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt-ota.gif -------------------------------------------------------------------------------- /pic/irmqtt-stl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt-stl.png -------------------------------------------------------------------------------- /pic/irmqtt-web.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt-web.gif -------------------------------------------------------------------------------- /pic/irmqtt-wifi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt-wifi.gif -------------------------------------------------------------------------------- /pic/irmqtt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/irmqtt.jpg -------------------------------------------------------------------------------- /pic/pcb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/pic/pcb.jpg -------------------------------------------------------------------------------- /stl/IR-B v30.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/stl/IR-B v30.stl -------------------------------------------------------------------------------- /stl/PIR v69.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huexpub/IRMQTT/f108a61f1b5e5616ad12ce9500cb2a3fb4c0843c/stl/PIR v69.stl --------------------------------------------------------------------------------