JXCT Soil Sensor 7-in-1 v3.4.9 (June 2025)
Professional IoT soil monitoring system with ESP32, Modbus RTU, MQTT, and advanced compensation algorithms
Загрузка...
Поиск...
Не найдено
Файл mqtt_client.h
#include <Arduino.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>

См. исходные тексты.

Функции

const char * getMqttLastError ()
 
void setupMQTT ()
 
bool connectMQTT ()
 
void handleMQTT ()
 
void publishSensorData ()
 
void publishHomeAssistantConfig ()
 
void publishAvailability (bool online)
 
void removeHomeAssistantConfig ()
 
void invalidateHAConfigCache ()
 
void handleMqttCommand (const String &cmd)
 
void mqttCallback (char *topic, byte *payload, unsigned int length)
 

Переменные

WiFiClient espClient
 
PubSubClient mqttClient
 
bool mqttConnected
 

Функции

◆ connectMQTT()

bool connectMQTT ( )

◆ getMqttLastError()

const char * getMqttLastError ( )

См. определение в файле mqtt_client.cpp строка 28

Перекрестные ссылки mqttLastErrorBuffer.

Используется в sendHealthJson() и sendServiceStatusJson().

◆ handleMQTT()

void handleMQTT ( )

См. определение в файле mqtt_client.cpp строка 311

◆ handleMqttCommand()

void handleMqttCommand ( const String & cmd)

См. определение в файле mqtt_client.cpp строка 674

Перекрестные ссылки config, DEBUG_PRINT, DEBUG_PRINTLN, handleOTA(), publishAvailability(), publishHomeAssistantConfig(), publishSensorData(), removeHomeAssistantConfig(), resetConfig(), saveConfig() и triggerOtaCheck().

Используется в mqttCallback().

◆ invalidateHAConfigCache()

void invalidateHAConfigCache ( )

См. определение в файле mqtt_client.cpp строка 734

Перекрестные ссылки haConfigCache, INFO_PRINTLN и mqttLastErrorBuffer.

Используется в saveConfig().

◆ mqttCallback()

void mqttCallback ( char * topic,
byte * payload,
unsigned int length )

См. определение в файле mqtt_client.cpp строка 722

Перекрестные ссылки DEBUG_PRINTF, getCommandTopic(), getOtaCommandTopic() и handleMqttCommand().

Используется в setupMQTT().

◆ publishAvailability()

void publishAvailability ( bool online)

См. определение в файле mqtt_client.cpp строка 141

Перекрестные ссылки DEBUG_PRINTF, getStatusTopic() и mqttClient.

Используется в connectMQTT() и handleMqttCommand().

◆ publishHomeAssistantConfig()

void publishHomeAssistantConfig ( )

См. определение в файле mqtt_client.cpp строка 521

Перекрестные ссылки config, DEBUG_PRINTLN, DEVICE_MANUFACTURER, DEVICE_MODEL, DEVICE_SW_VERSION, getDeviceId(), haConfigCache, INFO_PRINTLN, mqttClient, mqttLastErrorBuffer, pubTopicCache и pubTopicCacheValid.

Используется в connectMQTT() и handleMqttCommand().

◆ publishSensorData()

void publishSensorData ( )

См. определение в файле mqtt_client.cpp строка 440

Перекрестные ссылки cachedSensorJson, config, DEBUG_PRINTLN, lastCachedSensorTime, mqttClient, mqttLastErrorBuffer, sensorData, sensorJsonCacheValid, shouldPublishMqtt() и timeClient.

Используется в handleMqttCommand() и loop().

◆ removeHomeAssistantConfig()

void removeHomeAssistantConfig ( )

См. определение в файле mqtt_client.cpp строка 658

Перекрестные ссылки getDeviceId(), INFO_PRINTLN, mqttClient и mqttLastErrorBuffer.

Используется в handleMqttCommand().

◆ setupMQTT()

void setupMQTT ( )

См. определение в файле mqtt_client.cpp строка 149

Перекрестные ссылки config, DEBUG_PRINTF, DEBUG_PRINTLN, ERROR_PRINTF, ERROR_PRINTLN, getCachedIP(), INFO_PRINTLN, mqttCallback(), mqttClient и mqttLastErrorBuffer.

Используется в setup().

Переменные

◆ espClient

WiFiClient espClient
extern

См. определение в файле mqtt_client.cpp строка 22

◆ mqttClient

◆ mqttConnected

bool mqttConnected
extern

См. определение в файле mqtt_client.cpp строка 24