mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Add support for GlobalCache codes using the same format as irsend<x>
raw. Use irsend<x> gc,xxx,xxx
This commit is contained in:
parent
b263309fc4
commit
100805ff26
@ -470,6 +470,29 @@ uint32_t IrRemoteCmndIrSendRaw(void)
|
|||||||
return IE_INVALID_RAWDATA;
|
return IE_INVALID_RAWDATA;
|
||||||
} // Parameters must be at least 3
|
} // 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];
|
uint16_t parm[count];
|
||||||
for (uint32_t i = 0; i < count; i++) {
|
for (uint32_t i = 0; i < count; i++) {
|
||||||
parm[i] = strtol(strtok_r(nullptr, ", ", &p), nullptr, 0);
|
parm[i] = strtol(strtok_r(nullptr, ", ", &p), nullptr, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user