make sure we get all 32 bits printed out

This commit is contained in:
ladyada 2016-07-13 13:52:23 -04:00
parent 5df5ea2f1c
commit 9b23f6747e

View File

@ -808,8 +808,14 @@ Adafruit_MQTT_Publish::Adafruit_MQTT_Publish(Adafruit_MQTT *mqttserver,
} }
bool Adafruit_MQTT_Publish::publish(int32_t i) { bool Adafruit_MQTT_Publish::publish(int32_t i) {
char payload[18]; char payload[12];
itoa(i, payload, 10); ltoa(i, payload, 10);
return mqtt->publish(topic, payload, qos);
}
bool Adafruit_MQTT_Publish::publish(uint32_t i) {
char payload[11];
ultoa(i, payload, 10);
return mqtt->publish(topic, payload, qos); return mqtt->publish(topic, payload, qos);
} }
@ -819,12 +825,6 @@ bool Adafruit_MQTT_Publish::publish(double f, uint8_t precision) {
return mqtt->publish(topic, payload, qos); return mqtt->publish(topic, payload, qos);
} }
bool Adafruit_MQTT_Publish::publish(uint32_t i) {
char payload[18];
itoa(i, payload, 10);
return mqtt->publish(topic, payload, qos);
}
bool Adafruit_MQTT_Publish::publish(const char *payload) { bool Adafruit_MQTT_Publish::publish(const char *payload) {
return mqtt->publish(topic, payload, qos); return mqtt->publish(topic, payload, qos);
} }