Skip to content

Commit 7e54711

Browse files
author
brentru
committed
bump internal version to v3.0.0, add doxygen-style comments to _Definitions.h
1 parent 84871c0 commit 7e54711

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

src/AdafruitIO_Definitions.h

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#ifndef ADAFRUITIO_DEFINITIONS_H_
1313
#define ADAFRUITIO_DEFINITIONS_H_
1414

15-
#define ADAFRUITIO_VERSION_MAJOR 2
16-
#define ADAFRUITIO_VERSION_MINOR 6
15+
#define ADAFRUITIO_VERSION_MAJOR 3
16+
#define ADAFRUITIO_VERSION_MINOR 0
1717
#define ADAFRUITIO_VERSION_PATCH 0
1818

1919
// forward declaration
@@ -43,12 +43,12 @@ class AdafruitIOGroupCallback {
4343

4444
// Uncomment/comment to turn on/off debug output messages.
4545
#define AIO_DEBUG
46-
// uncomment/comment to turn on/off error output
46+
// Uncomment/comment to turn on/off error output
4747
#define AIO_ERROR
4848

49-
// where debug messages will be printed
49+
// Where debug messages will be printed
50+
// note: if you're using something like Zero or Due, change the below to SerialUSB
5051
#define AIO_PRINTER Serial
51-
// If using something like Zero or Due, change the above to SerialUSB
5252

5353
// Define actual debug output functions when necessary.
5454
#ifdef AIO_DEBUG
@@ -59,6 +59,7 @@ class AdafruitIOGroupCallback {
5959
#define AIO_DEBUG_PRINTLN(...) {}
6060
#endif
6161

62+
// Define actual error output functions when necessary.
6263
#ifdef AIO_ERROR
6364
#define AIO_ERROR_PRINT(...) { AIO_PRINTER.print(__VA_ARGS__); }
6465
#define AIO_ERROR_PRINTLN(...) { AIO_PRINTER.println(__VA_ARGS__); }
@@ -67,7 +68,9 @@ class AdafruitIOGroupCallback {
6768
#define AIO_ERROR_PRINTLN(...) {}
6869
#endif
6970

71+
// Adafruit IO Ping Interval, in milliseconds
7072
#define AIO_PING_INTERVAL 60000
73+
// Time to wait between re-connecting to Adafruit IO after throttled
7174
#define AIO_THROTTLE_RECONNECT_INTERVAL 60000
7275

7376
#define AIO_ERROR_TOPIC "/errors"
@@ -77,38 +80,43 @@ class AdafruitIOGroupCallback {
7780
// echo | openssl s_client -connect io.adafruit.com:443 | openssl x509 -fingerprint -noout
7881
#define AIO_SSL_FINGERPRINT "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18"
7982

83+
// Maximum length of an Adafruit IO Feed name
8084
#define AIO_FEED_NAME_LENGTH 20
85+
// Maximum length of data sent/recieved from Adafruit IO
8186
#define AIO_DATA_LENGTH 45
87+
// Maximum comma-separated-value length from Adafruit IO
8288
#define AIO_CSV_LENGTH 150
8389

90+
/** aio_status_t offers 13 status states */
8491
typedef enum {
8592

8693
// CONNECTING
8794
AIO_IDLE = 0,
88-
AIO_NET_DISCONNECTED = 1,
89-
AIO_DISCONNECTED = 2,
90-
AIO_FINGERPRINT_UNKOWN = 3,
95+
AIO_NET_DISCONNECTED = 1, // Network disconnected
96+
AIO_DISCONNECTED = 2, // Disconnected from Adafruit IO
97+
AIO_FINGERPRINT_UNKOWN = 3, // Unknown AIO_SSL_FINGERPRINT
9198

9299
// FAILURE
93-
AIO_NET_CONNECT_FAILED = 10,
94-
AIO_CONNECT_FAILED = 11,
95-
AIO_FINGERPRINT_INVALID = 12,
96-
AIO_AUTH_FAILED = 13,
100+
AIO_NET_CONNECT_FAILED = 10, // Failed to connect to network
101+
AIO_CONNECT_FAILED = 11, // Failed to connect to Adafruit IO
102+
AIO_FINGERPRINT_INVALID = 12, // Unknown AIO_SSL_FINGERPRINT
103+
AIO_AUTH_FAILED = 13, // Invalid Adafruit IO login credentials provided.
97104

98105
// SUCCESS
99-
AIO_NET_CONNECTED = 20,
100-
AIO_CONNECTED = 21,
101-
AIO_CONNECTED_INSECURE = 22,
102-
AIO_FINGERPRINT_UNSUPPORTED = 23,
103-
AIO_FINGERPRINT_VALID = 24
106+
AIO_NET_CONNECTED = 20, // Connected to Adafruit IO
107+
AIO_CONNECTED = 21, // Connected to network
108+
AIO_CONNECTED_INSECURE = 22, // Insecurely (non-SSL) connected to network
109+
AIO_FINGERPRINT_UNSUPPORTED = 23, // Unsupported AIO_SSL_FINGERPRINT
110+
AIO_FINGERPRINT_VALID = 24 // Valid AIO_SSL_FINGERPRINT
104111

105112
} aio_status_t;
106113

114+
/** Three different types of MQTT time feeds from IO */
107115
typedef enum {
108116

109-
AIO_TIME_SECONDS = 0,
110-
AIO_TIME_MILLIS = 1,
111-
AIO_TIME_ISO = 2
117+
AIO_TIME_SECONDS = 0, // Seconds MQTT feed
118+
AIO_TIME_MILLIS = 1, // Milisecond MQTT feed
119+
AIO_TIME_ISO = 2 // ISO8601 MQTT Feed
112120

113121
} aio_time_format_t;
114122

0 commit comments

Comments
 (0)