mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-07 16:25:58 +00:00
extend Ch command so that it can also force an index to send...
This commit is contained in:
@ -505,14 +505,14 @@ static int http_tasmota_json_status_FWR(void* request, jsonCb_t printer) {
|
||||
printer(request, "}");
|
||||
return 0;
|
||||
}
|
||||
static int http_obk_json_channels(void* request, jsonCb_t printer) {
|
||||
static int http_obk_json_channels(void* request, jsonCb_t printer, int includeIndex) {
|
||||
int i;
|
||||
int iCnt = 0;
|
||||
char tmp[8];
|
||||
|
||||
printer(request, "{");
|
||||
for (i = 0; i < CHANNEL_MAX; i++) {
|
||||
if (CHANNEL_IsInUse(i)) {
|
||||
if (CHANNEL_IsInUse(i) || i == includeIndex) {
|
||||
if (iCnt) {
|
||||
printer(request, ",");
|
||||
}
|
||||
@ -1057,7 +1057,11 @@ int JSON_ProcessCommandReply(const char* cmd, const char* arg, void* request, js
|
||||
printer(request, "}");
|
||||
}
|
||||
else if (!wal_strnicmp(cmd, "Ch", 2)) {
|
||||
http_obk_json_channels(request, printer);
|
||||
int includeIndex = -1;
|
||||
if (cmd[2]) {
|
||||
includeIndex = atoi(cmd + 2);
|
||||
}
|
||||
http_obk_json_channels(request, printer, includeIndex);
|
||||
}
|
||||
#ifndef OBK_DISABLE_ALL_DRIVERS
|
||||
#if ENABLE_DRIVER_TUYAMCU
|
||||
|
||||
Reference in New Issue
Block a user