headercleanup & todos

This commit is contained in:
ladyada 2015-06-05 12:09:58 -04:00
parent ae0b4778a1
commit 7ef04a85a2
2 changed files with 22 additions and 12 deletions

View File

@ -20,29 +20,30 @@
#define MQTT_QOS_1 0x1
#define MQTT_QOS_0 0x0
#define SERVERNAME_SIZE 25
#define PASSWORD_SIZE 25
#define USERNAME_SIZE 41
#define CLIENTID_SIZE 23
#define FEEDNAME_SIZE 40
#define CONNECT_TIMEOUT_MS 3000
#define PUBLISH_TIMEOUT_MS 500
#define PING_TIMEOUT_MS 500
// Adjust as necessary, in seconds
#define MQTT_CONN_KEEPALIVE 15
// Largest full packet we're able to send
#define MAXBUFFERSIZE (85)
#define MQTT_CONN_USERNAMEFLAG 0x80
#define MQTT_CONN_PASSWORDFLAG 0x40
#define MQTT_CONN_WILLRETAIN 0x20
#define MQTT_CONN_WILLQOS 0x08
#define MQTT_CONN_WILLFLAG 0x04
#define MQTT_CONN_CLEANSESSION 0x02
#define MQTT_CONN_KEEPALIVE 15 // in seconds
#define MAXBUFFERSIZE (85)
// how many subscriptions we want to be able to
// track
#define MAXSUBSCRIPTIONS 5
// how much data we save in a subscription object
// eg max-subscription-payload-size
#define SUBSCRIPTIONDATALEN 20
@ -81,7 +82,8 @@ class Adafruit_MQTT {
const char *password;
Adafruit_MQTT_Subscribe *subscriptions[MAXSUBSCRIPTIONS];
uint8_t buffer[MAXBUFFERSIZE];
uint8_t buffer[MAXBUFFERSIZE]; // one buffer, used for all incoming/outgoing
};
class Adafruit_MQTT_Publish {

View File

@ -1,2 +1,10 @@
# Adafruit_MQTT_Library
Arduino library for MQTT support
ToDo:
* QoS > 0 for publication
* Subscription callbacks
* example with way more timeout/reconnection protection
* moving most of MQTT_CC3000 -> MQTT with virtual writebuffer() function
* Wills
* remove watchdog