Skip to content

Commit b90494a

Browse files
committed
add dependency compile time version check
1 parent 01960a8 commit b90494a

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

AdafruitIO.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#include "AdafruitIO.h"
22

3-
AdafruitIO::AdafruitIO(){}
3+
AdafruitIO::AdafruitIO()
4+
{
5+
_mqtt = 0;
6+
_username = 0;
7+
_key = 0;
8+
_err_topic = 0;
9+
_throttle_topic = 0;
10+
_err_sub = 0;
11+
_throttle_sub = 0;
12+
}
413

514
void AdafruitIO::connect(const char *user, const char *key)
615
{

AdafruitIO.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77
#include "AdafruitIO_Feed.h"
88
#include "AdafruitIO_Data.h"
99

10+
#ifndef ADAFRUIT_MQTT_VERSION_MAJOR
11+
#error "This sketch requires Adafruit MQTT Library v0.15.0 or higher. Please install or upgrade using the Library Manager."
12+
#endif
13+
14+
#if ADAFRUIT_MQTT_VERSION_MAJOR == 0 && ADAFRUIT_MQTT_VERSION_MINOR < 15
15+
#error "This sketch requires Adafruit MQTT Library v0.15.0 or higher. Please install or upgrade using the Library Manager."
16+
#endif
17+
1018
class AdafruitIO {
1119

1220
friend class AdafruitIO_Feed;
1321

1422
public:
1523
AdafruitIO();
24+
~AdafruitIO();
1625

1726
void connect(const char *user, const char *key);
1827
void connect(const __FlashStringHelper *user, const __FlashStringHelper *key);

AdafruitIO_Definitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ADAFRUITIO_DEFINITIONS_H_
22
#define ADAFRUITIO_DEFINITIONS_H_
33

4-
#define ADAFRUITIO_VERSION_MAJOR 1
4+
#define ADAFRUITIO_VERSION_MAJOR 2
55
#define ADAFRUITIO_VERSION_MINOR 0
66
#define ADAFRUITIO_VERSION_PATCH 0
77

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit IO Arduino
2-
version=1.0.1
2+
version=2.0.0
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino library to access the Adafruit IO REST API.

0 commit comments

Comments
 (0)