mqtt code sanitizations

This commit is contained in:
Klaus K Wilting 2020-05-20 12:40:37 +02:00
parent 897343a96a
commit c5635f59b2
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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;