diff --git a/core/MyGatewayTransport.h b/core/MyGatewayTransport.h
index 6952d80..9ddee8c 100644
--- a/core/MyGatewayTransport.h
+++ b/core/MyGatewayTransport.h
@@ -24,36 +24,45 @@
* @ingroup internals
* @{
*
-*
* Gateway transport-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE
-* -[!] Exclamation mark is prepended in case of error
-* -SYSTEM:
-* -GWT: messages emitted by MyGatewayTransport
-* -SUB SYSTEMS:
-* -GWT:TIN from @ref gatewayTransportInit()
-* -GWT:TPS from @ref gatewayTransportSend()
-* -GWT:RFC from _readFromClient()
-* -GWT:TSA from @ref gatewayTransportAvailable()
-* -GWT:TRC from @ref gatewayTransportReceive()
+* - [!] Exclamation mark is prepended in case of error
+* - SYSTEM:
+* - GWT: messages emitted by MyGatewayTransport
+* - SUB SYSTEMS:
+* - GWT:TIN from @ref gatewayTransportInit()
+* - GWT:TPS from @ref gatewayTransportSend()
+* - GWT:IMQ from incomingMQTT()
+* - GWT:RMQ from reconnectMQTT()
+* - GWT:TPC from gatewayTransportConnect()
+* - GWT:RFC from _readFromClient()
+* - GWT:TSA from @ref gatewayTransportAvailable()
+* - GWT:TRC from @ref gatewayTransportReceive()
*
* Gateway transport debug log messages :
*
* |E| SYS | SUB | Message | Comment
* |-|-----|-------|---------------------------|---------------------------------------------------------------------
* | | GWT | TIN | CONNECTING... | Connecting to router
-* | | GWT | TIN | IP=%s | IP address obtained
+* | | GWT | TIN | IP=%%s | IP address [%%s] obtained
* |!| GWT | TIN | DHCP FAIL | DHCP request failed
* | | GWT | TIN | ETH OK | Connected to network
* |!| GWT | TIN | ETH FAIL | Connection failed
+* | | GWT | TPS | TOPIC=%%s,MSG SENT | MQTT message sent on topic [%%s]
* | | GWT | TPS | ETH OK | Connected to network
* |!| GWT | TPS | ETH FAIL | Connection failed
-* | | GWT | RFC | C%d,MSG=%s | Received message [%s] from client [%d]
-* |!| GWT | RFC | C%d,MSG TOO LONG | Received message from client [%d] too long
-* | | GWT | TSA | UDP MSG=%s | Received UDP message [%s]
+* | | GWT | IMQ | TOPIC=%%s,MSG RECEIVE | MQTT message received on topic [%%s]
+* | | GWT | RMQ | MQTT RECONNECT | Reconnecting to MQTT broker
+* | | GWT | RMQ | MQTT CONNECTED | Connected to MQTT broker
+* | | GWT | TPC | CONNECTING... | Connecting to MQTT broker
+* | | GWT | TPC | IP=%%s | IP address [%%s] obtained
+* |!| GWT | TPC | DHCP FAIL | DHCP request failed
+* | | GWT | RFC | C=%%d,MSG=%%s | Received message [%%s] from client [%%d]
+* |!| GWT | RFC | C=%%d,MSG TOO LONG | Received message from client [%%d] too long
+* | | GWT | TSA | UDP MSG=%%s | Received UDP message [%%s]
* | | GWT | TSA | ETH OK | Connected to network
* |!| GWT | TSA | ETH FAIL | Connection failed
-* | | GWT | TSA | C%d,DISCONNECTED | Client [%d] disconnected
-* | | GWT | TSA | C%d,CONNECTED | Client [%d] connected
+* | | GWT | TSA | C=%d,DISCONNECTED | Client [%%d] disconnected
+* | | GWT | TSA | C=%d,CONNECTED | Client [%%d] connected
* |!| GWT | TSA | NO FREE SLOT | No free slot for client
* |!| GWT | TRC | IP RENEW FAIL | IP renewal failed
*
diff --git a/core/MyGatewayTransportEthernet.cpp b/core/MyGatewayTransportEthernet.cpp
index be83828..3f04e34 100644
--- a/core/MyGatewayTransportEthernet.cpp
+++ b/core/MyGatewayTransportEthernet.cpp
@@ -263,7 +263,7 @@ bool _readFromClient(uint8_t i)
if (inChar == '\n' || inChar == '\r') {
// Add string terminator and prepare for the next message
inputString[i].string[inputString[i].idx] = 0;
- GATEWAY_DEBUG(PSTR("GWT:RFC:C%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
+ GATEWAY_DEBUG(PSTR("GWT:RFC:C=%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
inputString[i].idx = 0;
if (protocolParse(_ethernetMsg, inputString[i].string)) {
return true;
@@ -275,7 +275,7 @@ bool _readFromClient(uint8_t i)
}
} else {
// Incoming message too long. Throw away
- GATEWAY_DEBUG(PSTR("!GWT:RFC:C%" PRIu8 ",MSG TOO LONG\n"), i);
+ GATEWAY_DEBUG(PSTR("!GWT:RFC:C=%" PRIu8 ",MSG TOO LONG\n"), i);
inputString[i].idx = 0;
// Finished with this client's message. Next loop() we'll see if there's more to read.
break;
@@ -373,14 +373,14 @@ bool gatewayTransportAvailable(void)
for (uint8_t i = 0; i < ARRAY_SIZE(clients); i++) {
if (!clients[i].connected()) {
if (clientsConnected[i]) {
- GATEWAY_DEBUG(PSTR("GWT:TSA:C%" PRIu8 ",DISCONNECTED\n"), i);
+ GATEWAY_DEBUG(PSTR("GWT:TSA:C=%" PRIu8 ",DISCONNECTED\n"), i);
clients[i].stop();
}
//check if there are any new clients
if (_ethernetServer.hasClient()) {
clients[i] = _ethernetServer.available();
inputString[i].idx = 0;
- GATEWAY_DEBUG(PSTR("GWT:TSA:C%" PRIu8 ",CONNECTED\n"), i);
+ GATEWAY_DEBUG(PSTR("GWT:TSA:C=%" PRIu8 ",CONNECTED\n"), i);
gatewayTransportSend(buildGw(_msgTmp, I_GATEWAY_READY).set(MSG_GW_STARTUP_COMPLETE));
// Send presentation of locally attached sensors (and node if applicable)
presentNode();
diff --git a/core/MyGatewayTransportMQTTClient.cpp b/core/MyGatewayTransportMQTTClient.cpp
index 24602c2..4a92ae9 100644
--- a/core/MyGatewayTransportMQTTClient.cpp
+++ b/core/MyGatewayTransportMQTTClient.cpp
@@ -63,7 +63,7 @@ bool gatewayTransportSend(MyMessage &message)
}
setIndication(INDICATION_GW_TX);
char *topic = protocolFormatMQTTTopic(MY_MQTT_PUBLISH_TOPIC_PREFIX, message);
- GATEWAY_DEBUG(PSTR("GWT:TPS:Sending message on topic: %s\n"), topic);
+ GATEWAY_DEBUG(PSTR("GWT:TPS:TOPIC=%s,MSG SENT\n"), topic);
#if defined(MY_MQTT_CLIENT_PUBLISH_RETAIN)
bool retain = mGetCommand(message) == C_SET ||
(mGetCommand(message) == C_INTERNAL && message.type == I_BATTERY_LEVEL);
@@ -75,20 +75,20 @@ bool gatewayTransportSend(MyMessage &message)
void incomingMQTT(char* topic, uint8_t* payload, unsigned int length)
{
- GATEWAY_DEBUG(PSTR("GWT:TPS:Message arrived on topic: %s\n"), topic);
+ GATEWAY_DEBUG(PSTR("GWT:IMQ:TOPIC=%s, MSG RECEIVED\n"), topic);
_MQTT_available = protocolMQTTParse(_MQTT_msg, topic, payload, length);
}
bool reconnectMQTT(void)
{
- GATEWAY_DEBUG(PSTR("GWT:TPS:Attempting MQTT connection...\n"));
+ GATEWAY_DEBUG(PSTR("GWT:RMQ:MQTT RECONNECT\n"));
// Attempt to connect
if (_MQTT_client.connect(MY_MQTT_CLIENT_ID
#if defined(MY_MQTT_USER) && defined(MY_MQTT_PASSWORD)
, MY_MQTT_USER, MY_MQTT_PASSWORD
#endif
)) {
- GATEWAY_DEBUG(PSTR("GWT:TPS:MQTT connected\n"));
+ GATEWAY_DEBUG(PSTR("GWT:RMQ:MQTT CONNECTED\n"));
// Send presentation of locally attached sensors (and node if applicable)
presentNode();