mqtt code sanitizations
This commit is contained in:
parent
897343a96a
commit
c5635f59b2
@ -19,7 +19,7 @@ void mqtt_queuereset(void);
|
|||||||
void mqtt_client_task(void *param);
|
void mqtt_client_task(void *param);
|
||||||
int mqtt_connect(IPAddress mqtt_host, uint16_t mqtt_port);
|
int mqtt_connect(IPAddress mqtt_host, uint16_t mqtt_port);
|
||||||
void mqtt_callback(char *topic, byte *payload, unsigned int length);
|
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);
|
esp_err_t mqtt_init(void);
|
||||||
|
|
||||||
#endif // _MQTTCLIENT_H
|
#endif // _MQTTCLIENT_H
|
@ -29,6 +29,7 @@ Task Core Prio Purpose
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
ledloop 0 3 blinks LEDs
|
ledloop 0 3 blinks LEDs
|
||||||
spiloop 0 2 reads/writes data on spi interface
|
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
|
IDLE 0 0 ESP32 arduino scheduler -> runs wifi sniffer
|
||||||
|
|
||||||
lmictask 1 2 MCCI LMiC LORAWAN stack
|
lmictask 1 2 MCCI LMiC LORAWAN stack
|
||||||
|
@ -12,7 +12,7 @@ TaskHandle_t mqttTask;
|
|||||||
WiFiClient ipClient;
|
WiFiClient ipClient;
|
||||||
PubSubClient mqttClient(ipClient);
|
PubSubClient mqttClient(ipClient);
|
||||||
|
|
||||||
void WiFiEvent(WiFiEvent_t event) {
|
void NetworkEvent(WiFiEvent_t event) {
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case SYSTEM_EVENT_ETH_START:
|
case SYSTEM_EVENT_ETH_START:
|
||||||
ESP_LOGI(TAG, "Ethernet link layer started");
|
ESP_LOGI(TAG, "Ethernet link layer started");
|
||||||
@ -115,7 +115,7 @@ esp_err_t mqtt_init(void) {
|
|||||||
ESP_LOGI(TAG, "Starting MQTTloop...");
|
ESP_LOGI(TAG, "Starting MQTTloop...");
|
||||||
xTaskCreate(mqtt_client_task, "mqttloop", 4096, (void *)NULL, 2, &mqttTask);
|
xTaskCreate(mqtt_client_task, "mqttloop", 4096, (void *)NULL, 2, &mqttTask);
|
||||||
|
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(NetworkEvent);
|
||||||
ETH.begin();
|
ETH.begin();
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user