mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
Merge branch 'ver4dev' into v4dev
This commit is contained in:
@@ -95,6 +95,10 @@ void mqttReconnect() {
|
||||
mqttConnect();
|
||||
}
|
||||
|
||||
bool mqttIsConnect(){
|
||||
return mqtt.connected();
|
||||
}
|
||||
|
||||
void getMqttData() {
|
||||
mqttServer = jsonReadStr(settingsFlashJson, F("mqttServer"));
|
||||
mqttPort = jsonReadInt(settingsFlashJson, F("mqttPort"));
|
||||
@@ -116,6 +120,16 @@ void mqttSubscribe() {
|
||||
}
|
||||
}
|
||||
|
||||
void mqttSubscribeExternal(String topic, bool usePrefix) {
|
||||
SerialPrint("i", F("MQTT"), ("subscribed external" + topic).c_str());
|
||||
// SerialPrint("i", F("MQTT"), mqttRootDevice);
|
||||
if (usePrefix)
|
||||
{
|
||||
mqtt.subscribe((mqttPrefix + topic).c_str());
|
||||
}
|
||||
mqtt.subscribe(topic.c_str());
|
||||
}
|
||||
|
||||
void mqttCallback(char* topic, uint8_t* payload, size_t length) {
|
||||
String topicStr = String(topic);
|
||||
// SerialPrint("i", "=>MQTT", topicStr);
|
||||
|
||||
Reference in New Issue
Block a user