added handlers for mqtt test buttons
This commit is contained in:
parent
a12d15cdbc
commit
c16f963dd6
|
|
@ -77,6 +77,20 @@ static void funct_mqtt_2_stat(char *argres, int rw)
|
||||||
{
|
{
|
||||||
snprintf(argres, MAX_DYNVAR_LENGTH, (GetMQTT2Connected()) ? "\"CONNECTED\"" : "\"DISCONNECTED\"");
|
snprintf(argres, MAX_DYNVAR_LENGTH, (GetMQTT2Connected()) ? "\"CONNECTED\"" : "\"DISCONNECTED\"");
|
||||||
}
|
}
|
||||||
|
static void funct_mqtt_1_test(char *argres, int rw)
|
||||||
|
{
|
||||||
|
if (GetSysConf()->mqttStation[0].Flags1.bIsGlobalEnabled)
|
||||||
|
PublicTestMQTT(0);
|
||||||
|
snprintf(argres, VAR_MAX_VALUE_LENGTH, (GetSysConf()->mqttStation[0].Flags1.bIsGlobalEnabled) ? "\"OK\"" : "\"NOT_AVAIL\"");
|
||||||
|
|
||||||
|
}
|
||||||
|
static void funct_mqtt_2_test(char *argres, int rw)
|
||||||
|
{
|
||||||
|
if (GetSysConf()->mqttStation[1].Flags1.bIsGlobalEnabled)
|
||||||
|
PublicTestMQTT(1);
|
||||||
|
snprintf(argres, VAR_MAX_VALUE_LENGTH, (GetSysConf()->mqttStation[0].Flags1.bIsGlobalEnabled) ? "\"OK\"" : "\"NOT_AVAIL\"");
|
||||||
|
}
|
||||||
|
|
||||||
static void funct_def_interface(char *argres, int rw)
|
static void funct_def_interface(char *argres, int rw)
|
||||||
{
|
{
|
||||||
GetDefaultNetIFName(argres);
|
GetDefaultNetIFName(argres);
|
||||||
|
|
@ -269,6 +283,7 @@ const rest_var_t SystemVariables[] =
|
||||||
{ 0, "mqtt_1_uname", &SysConfig.mqttStation[0].UserName, VAR_STRING, RW, 3, 31 },
|
{ 0, "mqtt_1_uname", &SysConfig.mqttStation[0].UserName, VAR_STRING, RW, 3, 31 },
|
||||||
{ 0, "mqtt_1_pass", &SysConfig.mqttStation[0].UserPass, VAR_PASS, RW, 3, 31 },
|
{ 0, "mqtt_1_pass", &SysConfig.mqttStation[0].UserPass, VAR_PASS, RW, 3, 31 },
|
||||||
{ 0, "mqtt_1_stat", &funct_mqtt_1_stat, VAR_FUNCT, R, 0, 0 },
|
{ 0, "mqtt_1_stat", &funct_mqtt_1_stat, VAR_FUNCT, R, 0, 0 },
|
||||||
|
{ 0, "mqtt_1_test", &funct_mqtt_1_test, VAR_FUNCT, RW, 0, 0 },
|
||||||
|
|
||||||
#if CONFIG_WEBGUIAPP_MQTT_CLIENTS_NUM == 2
|
#if CONFIG_WEBGUIAPP_MQTT_CLIENTS_NUM == 2
|
||||||
{ 0, "mqtt_2_enab", &SysConfig.mqttStation[1].Flags1.bIsGlobalEnabled, VAR_BOOL, RW, 0, 1 },
|
{ 0, "mqtt_2_enab", &SysConfig.mqttStation[1].Flags1.bIsGlobalEnabled, VAR_BOOL, RW, 0, 1 },
|
||||||
|
|
@ -280,6 +295,7 @@ const rest_var_t SystemVariables[] =
|
||||||
{ 0, "mqtt_2_uname", &SysConfig.mqttStation[1].UserName, VAR_STRING, RW, 3, 31 },
|
{ 0, "mqtt_2_uname", &SysConfig.mqttStation[1].UserName, VAR_STRING, RW, 3, 31 },
|
||||||
{ 0, "mqtt_2_pass", &SysConfig.mqttStation[1].UserPass, VAR_PASS, RW, 3, 31 },
|
{ 0, "mqtt_2_pass", &SysConfig.mqttStation[1].UserPass, VAR_PASS, RW, 3, 31 },
|
||||||
{ 0, "mqtt_2_stat", &funct_mqtt_2_stat, VAR_FUNCT, R, 0, 0 },
|
{ 0, "mqtt_2_stat", &funct_mqtt_2_stat, VAR_FUNCT, R, 0, 0 },
|
||||||
|
{ 0, "mqtt_2_test", &funct_mqtt_2_test, VAR_FUNCT, RW, 0, 0 },
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user