From c5635f59b27d73aa85ccbe1ce01a3acbb8390b23 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 20 May 2020 12:40:37 +0200 Subject: [PATCH] mqtt code sanitizations --- include/mqttclient.h | 2 +- src/main.cpp | 1 + src/mqttclient.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/mqttclient.h b/include/mqttclient.h index 4e366aba..1a6767b7 100644 --- a/include/mqttclient.h +++ b/include/mqttclient.h @@ -19,7 +19,7 @@ void mqtt_queuereset(void); void mqtt_client_task(void *param); int mqtt_connect(IPAddress mqtt_host, uint16_t mqtt_port); void mqtt_callback(char *topic, byte *payload, unsigned int length); -void WiFiEvent(WiFiEvent_t event); +void NetworkEvent(WiFiEvent_t event); esp_err_t mqtt_init(void); #endif // _MQTTCLIENT_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index ffb9f68c..17a8fa04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,6 +29,7 @@ Task Core Prio Purpose ------------------------------------------------------------------------------- ledloop 0 3 blinks LEDs spiloop 0 2 reads/writes data on spi interface +mqttloop 0 2 reads/writes data on ETH interface IDLE 0 0 ESP32 arduino scheduler -> runs wifi sniffer lmictask 1 2 MCCI LMiC LORAWAN stack diff --git a/src/mqttclient.cpp b/src/mqttclient.cpp index a113b7f5..e6302255 100644 --- a/src/mqttclient.cpp +++ b/src/mqttclient.cpp @@ -12,7 +12,7 @@ TaskHandle_t mqttTask; WiFiClient ipClient; PubSubClient mqttClient(ipClient); -void WiFiEvent(WiFiEvent_t event) { +void NetworkEvent(WiFiEvent_t event) { switch (event) { case SYSTEM_EVENT_ETH_START: ESP_LOGI(TAG, "Ethernet link layer started"); @@ -115,7 +115,7 @@ esp_err_t mqtt_init(void) { ESP_LOGI(TAG, "Starting MQTTloop..."); xTaskCreate(mqtt_client_task, "mqttloop", 4096, (void *)NULL, 2, &mqttTask); - WiFi.onEvent(WiFiEvent); + WiFi.onEvent(NetworkEvent); ETH.begin(); return ESP_OK;