Skip to content

Commit

Permalink
mqtt code sanitizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus K Wilting committed May 20, 2020
1 parent 897343a commit c5635f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/mqttclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/mqttclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c5635f5

Please sign in to comment.