From 100805ff26df647302ea8e2c3dc2da6882216776 Mon Sep 17 00:00:00 2001 From: Alain Turbide Date: Tue, 23 Jun 2020 18:09:44 -0400 Subject: [PATCH] Add support for GlobalCache codes using the same format as irsend raw. Use irsend gc,xxx,xxx --- tasmota/xdrv_05_irremote_full.ino | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tasmota/xdrv_05_irremote_full.ino b/tasmota/xdrv_05_irremote_full.ino index 60e16b30d..3f43c364a 100644 --- a/tasmota/xdrv_05_irremote_full.ino +++ b/tasmota/xdrv_05_irremote_full.ino @@ -470,6 +470,29 @@ uint32_t IrRemoteCmndIrSendRaw(void) return IE_INVALID_RAWDATA; } // Parameters must be at least 3 + +#ifdef IR_GC +//ir_gc + + if (strcmp(str, "gc") == 0) { //if first parameter is gc then we process global cache data else it is raw + + uint16_t GC[count+1]; + for (uint32_t i = 0; i <= count; i++) { + GC[i] = strtol(strtok_r(nullptr, ", ", &p), nullptr, 0); + if (!GC[i]) { + return IE_INVALID_RAWDATA; + } + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: GC value %d"), GC[i]); + } + irsend->sendGC(GC, count+1); + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: GC sent count %d"), count); + return IE_NO_ERROR; + } +//end ir_gc +#endif + + + uint16_t parm[count]; for (uint32_t i = 0; i < count; i++) { parm[i] = strtol(strtok_r(nullptr, ", ", &p), nullptr, 0);