diff --git a/src/main.cpp b/src/main.cpp index 1c2fd43..1d8eefe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,6 +40,12 @@ IPAddress mqttServerIP(192, 168, 89, 95); const char *mqttUser = "default"; const char *mqttPassword = "12345678"; +const char *lwtTopic = "doorBellGW/LWT"; +const char *lwtMessage = "Offline"; +const char *onlineMessage = "Online"; +const bool lwtRetain = true; +const int lwtQos = 2; + const char *doorBellTopic = "doorBellGW/doorbell"; const char *postboxFlapTopic = "doorBellGW/mailboxFlap"; const char *postboxDoorTopic = "doorBellGW/mailboxDoor"; @@ -91,6 +97,11 @@ struct { }; #define NUM_OUTPUTS (sizeof(myOutputs) / sizeof(myOutputs[0])) + +// Forward function declarations: +void reconnect(); +void sendMqttMessage(const char *topic, const char *message); + uint8_t getOutputIndexByPin(uint8_t pin) { for (unsigned int i=0; i