|
|
@ -604,18 +604,20 @@ class settings { |
|
|
|
|
|
|
|
void jsonMqtt(JsonObject obj, bool set = false) { |
|
|
|
if(set) { |
|
|
|
obj[F("broker")] = mCfg.mqtt.broker; |
|
|
|
obj[F("port")] = mCfg.mqtt.port; |
|
|
|
obj[F("user")] = mCfg.mqtt.user; |
|
|
|
obj[F("pwd")] = mCfg.mqtt.pwd; |
|
|
|
obj[F("topic")] = mCfg.mqtt.topic; |
|
|
|
obj[F("intvl")] = mCfg.mqtt.interval; |
|
|
|
obj[F("broker")] = mCfg.mqtt.broker; |
|
|
|
obj[F("port")] = mCfg.mqtt.port; |
|
|
|
obj[F("clientId")] = mCfg.mqtt.clientId; |
|
|
|
obj[F("user")] = mCfg.mqtt.user; |
|
|
|
obj[F("pwd")] = mCfg.mqtt.pwd; |
|
|
|
obj[F("topic")] = mCfg.mqtt.topic; |
|
|
|
obj[F("intvl")] = mCfg.mqtt.interval; |
|
|
|
|
|
|
|
} else { |
|
|
|
getVal<uint16_t>(obj, F("port"), &mCfg.mqtt.port); |
|
|
|
getVal<uint16_t>(obj, F("intvl"), &mCfg.mqtt.interval); |
|
|
|
getChar(obj, F("broker"), mCfg.mqtt.broker, MQTT_ADDR_LEN); |
|
|
|
getChar(obj, F("user"), mCfg.mqtt.user, MQTT_USER_LEN); |
|
|
|
getChar(obj, F("clientId"), mCfg.mqtt.clientId, MQTT_CLIENTID_LEN); |
|
|
|
getChar(obj, F("pwd"), mCfg.mqtt.pwd, MQTT_PWD_LEN); |
|
|
|
getChar(obj, F("topic"), mCfg.mqtt.topic, MQTT_TOPIC_LEN); |
|
|
|
} |
|
|
|