crankyoldgit / IRremoteESP8266

Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
GNU Lesser General Public License v2.1
2.84k stars 810 forks source link

Add support of Toshiba Remote Control B #2094

Open jackysze opened 1 month ago

jackysze commented 1 month ago

Re-creation of the accidentally permanently closed PR, incorporated comments from @NiKiZe

The third byte in the raw state array originally represents payload length only. It was found that the first 4 bits is being used to identify whether current remote control is A or B. https://github.com/crankyoldgit/IRremoteESP8266/issues/2089

  1. Modify the struct to accommodate both payload length and remote control type.
  2. Add constants and functions to set/get current remote control type.
  3. Fix the getInternalStateLength function to extract the last 4-bits instead using 8-bits.