From e048557fa7f8f0fdea02de8c2b3f5bf2fa5a5d25 Mon Sep 17 00:00:00 2001 From: toxuin Date: Sun, 14 Oct 2018 17:24:19 -0600 Subject: [PATCH] PubSub: pass pdTRUE instead of true --- cpp_utils/PubSubClient.cpp | 7 +++---- cpp_utils/PubSubClient.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cpp_utils/PubSubClient.cpp b/cpp_utils/PubSubClient.cpp index 8aaca5eb..3d1c365d 100644 --- a/cpp_utils/PubSubClient.cpp +++ b/cpp_utils/PubSubClient.cpp @@ -190,10 +190,10 @@ void PubSubClient::setup(void) { keepAliveTimer = new FreeRTOSTimer((char*) "keepAliveTimer", - (MQTT_KEEPALIVE * 1000) / portTICK_PERIOD_MS, true, this, + (MQTT_KEEPALIVE * 1000) / portTICK_PERIOD_MS, pdTRUE, this, keepAliveTimerMapper); timeoutTimer = new FreeRTOSTimer((char*) "timeoutTimer", - (MQTT_KEEPALIVE * 1000) / portTICK_PERIOD_MS, true, this, + (MQTT_KEEPALIVE * 1000) / portTICK_PERIOD_MS, pdTRUE, this, timeoutTimerMapper); m_task = new PubSubClientTask("PubSubClientTask"); } // setup @@ -404,8 +404,7 @@ bool PubSubClient::connect(){ * @param N/A. * @return Number of received bytes. */ -uint16_t PubSubClient::readPacket() { - +size_t PubSubClient::readPacket() { size_t res = _client->receive(buffer, MQTT_MAX_PACKET_SIZE); if (res > MQTT_MAX_PACKET_SIZE) { diff --git a/cpp_utils/PubSubClient.h b/cpp_utils/PubSubClient.h index 8e56ca59..fe82af03 100644 --- a/cpp_utils/PubSubClient.h +++ b/cpp_utils/PubSubClient.h @@ -160,7 +160,7 @@ class PubSubClient { MQTT_CALLBACK_SIGNATURE; void setup (void); - uint16_t readPacket(); + size_t readPacket(); bool write (uint8_t header, uint8_t* buf, uint16_t length); uint16_t writeString(const char* string, uint8_t* buf, uint16_t pos); void parseData (mqtt_message* msg, uint16_t len);