remove flashstring helper constructors & methods

This commit is contained in:
Todd Treece 2016-08-15 13:05:51 -04:00
parent c56e1b935f
commit b61d7e7024
2 changed files with 0 additions and 38 deletions

View File

@ -204,13 +204,6 @@ int8_t Adafruit_MQTT::connect(const char *user, const char *pass)
return connect(); 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 Adafruit_MQTT::processPacketsUntil(uint8_t *buffer, uint8_t waitforpackettype, uint16_t timeout) {
uint16_t len; uint16_t len;
while (len = readFullPacket(buffer, MAXBUFFERSIZE, timeout)) { while (len = readFullPacket(buffer, MAXBUFFERSIZE, timeout)) {
@ -782,14 +775,6 @@ Adafruit_MQTT_Publish::Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver,
topic = feed; topic = feed;
qos = q; 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) { bool Adafruit_MQTT_Publish::publish(int32_t i) {
char payload[12]; char payload[12];
ltoa(i, payload, 10); ltoa(i, payload, 10);
@ -834,18 +819,6 @@ Adafruit_MQTT_Subscribe::Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver,
io_feed = 0; 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) { void Adafruit_MQTT_Subscribe::setCallback(SubscribeCallbackUInt32Type cb) {
callback_uint32t = cb; callback_uint32t = cb;
} }

View File

@ -154,7 +154,6 @@ class Adafruit_MQTT {
// error. // error.
int8_t connect(); int8_t connect();
int8_t connect(const char *user, const char *pass); 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 // Return a printable string version of the error code returned by
// connect(). This returns a __FlashStringHelper*, which points to a // 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 // to be called before connect() because it is sent as part of the
// connect control packet. // connect control packet.
bool will(const char *topic, const char *payload, uint8_t qos = 0, uint8_t retain = 0); 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 // Publish a message to a topic using the specified QoS level. Returns true
// if the message was published, false otherwise. // 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, 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 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 // Add a subscription to receive messages for a topic. Returns true if the
// subscription could be added or was already present, false otherwise. // subscription could be added or was already present, false otherwise.
@ -260,7 +251,6 @@ class Adafruit_MQTT {
class Adafruit_MQTT_Publish { class Adafruit_MQTT_Publish {
public: public:
Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver, const char *feed, uint8_t qos = 0); 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(const char *s);
bool publish(double f, uint8_t precision=2); // Precision controls the minimum number of digits after decimal. 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 { class Adafruit_MQTT_Subscribe {
public: public:
Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver, const char *feedname, uint8_t q=0); 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(SubscribeCallbackUInt32Type callb);
void setCallback(SubscribeCallbackDoubleType callb); void setCallback(SubscribeCallbackDoubleType callb);