Compare commits

..

No commits in common. "0.20.2" and "master_upstream" have entirely different histories.

18 changed files with 15 additions and 38 deletions

View File

@ -3,11 +3,9 @@ sudo: false
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
install:
- arduino --install-library "Adafruit SleepyDog Library","Adafruit FONA Library"
- arduino --install-library "Adafruit SleepyDog Library,Adafruit FONA Library,Adafruit CC3000 Library,Adafruit_WINC1500"
script:
- build_platform esp8266
- arduino --install-library "WiFi101"
- build_platform zero
- build_main_platforms
notifications:
email:
on_success: change

View File

@ -189,6 +189,7 @@ int8_t Adafruit_MQTT::connect() {
success = true;
break;
}
//Serial.println("\t**failed, retrying!");
}
if (! success) return -2; // failed to sub for some reason
}
@ -205,20 +206,15 @@ int8_t Adafruit_MQTT::connect(const char *user, const char *pass)
uint16_t Adafruit_MQTT::processPacketsUntil(uint8_t *buffer, uint8_t waitforpackettype, uint16_t timeout) {
uint16_t len;
while (len = readFullPacket(buffer, MAXBUFFERSIZE, timeout)) {
while(true) {
len = readFullPacket(buffer, MAXBUFFERSIZE, timeout);
//DEBUG_PRINT("Packet read size: "); DEBUG_PRINTLN(len);
// TODO: add subscription reading & call back processing here
if(len == 0){
break;
}
if ((buffer[0] >> 4) == waitforpackettype)
{
if ((buffer[0] >> 4) == waitforpackettype) {
//DEBUG_PRINTLN(F("Found right packet"));
return len;
}
else
{
} else {
ERROR_PRINTLN(F("Dropped a packet"));
}
}
@ -411,6 +407,7 @@ bool Adafruit_MQTT::unsubscribe(Adafruit_MQTT_Subscribe *sub) {
}
void Adafruit_MQTT::processPackets(int16_t timeout) {
uint16_t len;
uint32_t elapsed = 0, endtime, starttime = millis();
@ -485,7 +482,7 @@ Adafruit_MQTT_Subscribe *Adafruit_MQTT::readSubscription(int16_t timeout) {
if (i==MAXSUBSCRIPTIONS) return NULL; // matching sub not found ???
uint8_t packet_id_len = 0;
uint16_t packetid = 0;
uint16_t packetid;
// Check if it is QoS 1, TODO: we dont support QoS 2
if ((buffer[0] & 0x6) == 0x2) {
packet_id_len = 2;

View File

@ -53,7 +53,6 @@ uint16_t Adafruit_MQTT_Client::readPacket(uint8_t *buffer, uint16_t maxlen,
uint16_t len = 0;
int16_t t = timeout;
while (client->connected() && (timeout >= 0)) {
//DEBUG_PRINT('.');
while (client->available()) {
@ -63,11 +62,6 @@ uint16_t Adafruit_MQTT_Client::readPacket(uint8_t *buffer, uint16_t maxlen,
buffer[len] = c;
//DEBUG_PRINTLN((uint8_t)c, HEX);
len++;
if (maxlen == 0) { // handle zero-length packets
return 0;
}
if (len == maxlen) { // we read all we want, bail
DEBUG_PRINT(F("Read data:\t"));
DEBUG_PRINTBUFFER(buffer, len);

View File

@ -40,8 +40,9 @@ WiFiClientSecure client;
// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);
// io.adafruit.com SHA1 fingerprint
const char* fingerprint = "AD 4B 64 B3 67 40 B5 FC 0E 51 9B BD 25 E9 7F 88 B6 2A A3 5B";
// io.adafruit.com SHA1 fingerprint. Current fingerprint can be verified via:
// echo | openssl s_client -connect io.adafruit.com:443 |& openssl x509 -fingerprint -noout
#define AIO_SSL_FINGERPRINT "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18"
/****************************** Feeds ***************************************/

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1,5 +1,5 @@
name=Adafruit MQTT Library
version=0.20.2
version=0.20.1
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=MQTT library that supports the FONA, ESP8266, Yun, and generic Arduino Client hardware.