Merge pull request #8771 from Dilbert66/gc

Add support for sending GlobalCache codes via irsend
This commit is contained in:
Theo Arends 2020-06-24 14:49:26 +02:00 committed by GitHub
commit 81d2527ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,6 +470,21 @@ uint32_t IrRemoteCmndIrSendRaw(void)
return IE_INVALID_RAWDATA;
} // Parameters must be at least 3
if (strcasecmp(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;
}
}
irsend_active = true;
for (uint32_t r = 0; r <= repeat; r++) {
irsend->sendGC(GC, count+1);
}
return IE_NO_ERROR;
}
uint16_t parm[count];
for (uint32_t i = 0; i < count; i++) {
parm[i] = strtol(strtok_r(nullptr, ", ", &p), nullptr, 0);