diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-05-11 04:18:08 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-05-11 04:18:12 +0300 |
commit | 0aba139aeff8ff80757c5d36502413299a0b449e (patch) | |
tree | 2b8e760ff14d4691783eb7c7d341f093199aab82 /platformio/relayctl/src/mqtt.h | |
parent | 586d84b0c0a8b4dc1b5057733892b754397234ec (diff) |
mqtt, esp: add new esp8266-based device
Diffstat (limited to 'platformio/relayctl/src/mqtt.h')
-rw-r--r-- | platformio/relayctl/src/mqtt.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/platformio/relayctl/src/mqtt.h b/platformio/relayctl/src/mqtt.h index f5ffdab..2afb2e0 100644 --- a/platformio/relayctl/src/mqtt.h +++ b/platformio/relayctl/src/mqtt.h @@ -52,11 +52,11 @@ private: uint16_t publish(const String& topic, uint8_t* payload, size_t length); uint16_t subscribe(const String& topic, uint8_t qos = 0); - void sendInitialStat(); + void sendInitialDiagnostics(); uint16_t sendOtaResponse(OTAResult status, uint8_t error_code = 0); public: - StopWatch statStopWatch; + StopWatch diagnosticsStopWatch; OTAStatus ota; MQTT(); @@ -64,28 +64,28 @@ public: void disconnect(); void reconnect(); void loop(); - void sendStat(); + void sendDiagnostics(); }; -struct StatFlags { +struct DiagnosticsFlags { uint8_t state: 1; uint8_t config_changed_value_present: 1; uint8_t config_changed: 1; uint8_t reserved: 5; } __attribute__((packed)); -struct InitialStatPayload { +struct InitialDiagnosticsPayload { uint32_t ip; uint8_t fw_version; int8_t rssi; uint32_t free_heap; - StatFlags flags; + DiagnosticsFlags flags; } __attribute__((packed)); -struct StatPayload { +struct DiagnosticsPayload { int8_t rssi; uint32_t free_heap; - StatFlags flags; + DiagnosticsFlags flags; } __attribute__((packed)); struct PowerPayload { |