Skip to content

Commit e1fa521

Browse files
committed
Code fixes (driven by CI report)
1 parent 8f68f33 commit e1fa521

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

examples/delegatedWifiUsage/delegatedWifiUsage.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include "MqttMailingService.h"
2-
#include <Arduino.h>
1+
#include "Sensirion_UPT_MQTT_Client.h"
32
#include <MeasurementFormatting.cpp>
43

54
/*

examples/selfManagedWifiUsage/selfManagedWifiUsage.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include "MqttMailingService.h"
2-
#include <Arduino.h>
1+
#include "Sensirion_UPT_MQTT_Client.h"
32
#include <WiFi.h>
43
#include <MeasurementFormatting.cpp>
54

src/MqttMailingService.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
const char* TAG = "MQTT Mail";
55
esp_mqtt_client_handle_t MqttMailingService::mEspMqttClient = nullptr;
6+
esp_event_loop_handle_t MqttMailingService::mEspMqttEventLoopHandle = nullptr;
7+
68

79
const uint8_t ssl_cert[] =
810
"------BEGIN CERTIFICATE-----\n" MQTT_BROKER_CERTIFICATE_OVERRIDE
@@ -227,11 +229,10 @@ void MqttMailingService::initEspMqttClient() {
227229
uxTaskPriorityGet(nullptr),
228230
.task_stack_size = 2 * 1024,
229231
.task_core_id = tskNO_AFFINITY};
230-
esp_event_loop_handle_t mqtt_loop_handle;
231-
esp_event_loop_create(&mqtt_loop_args, &mqtt_loop_handle);
232+
esp_event_loop_create(&mqtt_loop_args, &mEspMqttEventLoopHandle);
232233

233234
// Config
234-
esp_mqtt_client_config_t mqtt_cfg = {.event_loop_handle = mqtt_loop_handle,
235+
esp_mqtt_client_config_t mqtt_cfg = {.event_loop_handle = mEspMqttEventLoopHandle,
235236
.uri = mBrokerFullURI,
236237
.lwt_topic = mLwtTopic,
237238
.lwt_msg = mLwtMessage,
@@ -247,7 +248,7 @@ void MqttMailingService::initEspMqttClient() {
247248

248249
esp_mqtt_client_register_event(
249250
mEspMqttClient, static_cast<esp_mqtt_event_id_t>(ESP_EVENT_ANY_ID),
250-
espMqttEventHandler, this);
251+
MqttMailingService::espMqttEventHandler, this);
251252

252253
mState = MqttMailingServiceState::INITIALIZED;
253254
ESP_LOGI(TAG, "ESP MQTT client initialized.");

src/MqttMailingService.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,6 @@ class __attribute__((unused)) MqttMailingService {
132132
*/
133133
__attribute__((unused)) void setRetainFlag(int flag);
134134

135-
/**
136-
* @brief returns the QueueHandle_t to the mailbox
137-
*
138-
* @note: The mailbox is only available once initialized
139-
*/
140-
__attribute__((unused)) QueueHandle_t getMailbox() const;
141-
142135
/**
143136
* @brief returns the state of the service
144137
*/
@@ -215,6 +208,7 @@ class __attribute__((unused)) MqttMailingService {
215208

216209
// ESP MQTT client
217210
static esp_mqtt_client_handle_t mEspMqttClient;
211+
static esp_event_loop_handle_t mEspMqttEventLoopHandle;
218212
void initEspMqttClient();
219213
void startEspMqttClient();
220214
void destroyEspMqttClient();

0 commit comments

Comments
 (0)