From b61d7e70244642bca2c1021a7b438d0ec385796d Mon Sep 17 00:00:00 2001 From: Todd Treece Date: Mon, 15 Aug 2016 13:05:51 -0400 Subject: [PATCH] remove flashstring helper constructors & methods --- Adafruit_MQTT.cpp | 27 --------------------------- Adafruit_MQTT.h | 11 ----------- 2 files changed, 38 deletions(-) diff --git a/Adafruit_MQTT.cpp b/Adafruit_MQTT.cpp index 45cb0e2..f08ec05 100644 --- a/Adafruit_MQTT.cpp +++ b/Adafruit_MQTT.cpp @@ -204,13 +204,6 @@ int8_t Adafruit_MQTT::connect(const char *user, const char *pass) return connect(); } -int8_t Adafruit_MQTT::connect(const __FlashStringHelper *user, const __FlashStringHelper *pass) -{ - username = (const char*)user; - password = (const char*)pass; - return connect(); -} - uint16_t Adafruit_MQTT::processPacketsUntil(uint8_t *buffer, uint8_t waitforpackettype, uint16_t timeout) { uint16_t len; while (len = readFullPacket(buffer, MAXBUFFERSIZE, timeout)) { @@ -782,14 +775,6 @@ Adafruit_MQTT_Publish::Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver, topic = feed; qos = q; } - -Adafruit_MQTT_Publish::Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver, - const __FlashStringHelper *feed, uint8_t q) { - mqtt = mqttserver; - topic = (const char *)feed; - qos = q; -} - bool Adafruit_MQTT_Publish::publish(int32_t i) { char payload[12]; ltoa(i, payload, 10); @@ -834,18 +819,6 @@ Adafruit_MQTT_Subscribe::Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver, io_feed = 0; } -Adafruit_MQTT_Subscribe::Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver, - const __FlashStringHelper *feed, uint8_t q) { - mqtt = mqttserver; - topic = (const char *)feed; - qos = q; - datalen = 0; - callback_uint32t = 0; - callback_buffer = 0; - callback_io = 0; - io_feed = 0; -} - void Adafruit_MQTT_Subscribe::setCallback(SubscribeCallbackUInt32Type cb) { callback_uint32t = cb; } diff --git a/Adafruit_MQTT.h b/Adafruit_MQTT.h index 101b065..d2b2790 100644 --- a/Adafruit_MQTT.h +++ b/Adafruit_MQTT.h @@ -154,7 +154,6 @@ class Adafruit_MQTT { // error. int8_t connect(); int8_t connect(const char *user, const char *pass); - int8_t connect(const __FlashStringHelper *user, const __FlashStringHelper *pass); // Return a printable string version of the error code returned by // connect(). This returns a __FlashStringHelper*, which points to a @@ -172,19 +171,11 @@ class Adafruit_MQTT { // to be called before connect() because it is sent as part of the // connect control packet. bool will(const char *topic, const char *payload, uint8_t qos = 0, uint8_t retain = 0); - bool will(const __FlashStringHelper *topic, const char *payload, uint8_t qos = 0, uint8_t retain = 0) { - return will((const char *)topic, payload, qos, retain); - } // Publish a message to a topic using the specified QoS level. Returns true // if the message was published, false otherwise. - // The topic must be stored in PROGMEM. It can either be a - // char*, or a __FlashStringHelper* (the result of the F() macro). bool publish(const char *topic, const char *payload, uint8_t qos = 0); bool publish(const char *topic, uint8_t *payload, uint16_t bLen, uint8_t qos = 0); - bool publish(const __FlashStringHelper *topic, const char *payload, uint8_t qos = 0) { - return publish((const char *)topic, payload, qos); - } // Add a subscription to receive messages for a topic. Returns true if the // subscription could be added or was already present, false otherwise. @@ -260,7 +251,6 @@ class Adafruit_MQTT { class Adafruit_MQTT_Publish { public: Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver, const char *feed, uint8_t qos = 0); - Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver, const __FlashStringHelper *feed, uint8_t qos = 0); bool publish(const char *s); bool publish(double f, uint8_t precision=2); // Precision controls the minimum number of digits after decimal. @@ -279,7 +269,6 @@ private: class Adafruit_MQTT_Subscribe { public: Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver, const char *feedname, uint8_t q=0); - Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver, const __FlashStringHelper *feedname, uint8_t q=0); void setCallback(SubscribeCallbackUInt32Type callb); void setCallback(SubscribeCallbackDoubleType callb);