Skip to content

Commit 566e404

Browse files
committed
add version method
1 parent 0b52dc8 commit 566e404

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/AdafruitIO.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ const char* AdafruitIO::boardType()
209209
return AdafruitIO_Board::type();
210210
}
211211

212+
char* AdafruitIO::version()
213+
{
214+
sprintf(_version, "%d.%d.%d", ADAFRUITIO_VERSION_MAJOR, ADAFRUITIO_VERSION_MINOR, ADAFRUITIO_VERSION_PATCH);
215+
return _version;
216+
}
217+
212218
aio_status_t AdafruitIO::mqttStatus()
213219
{
214220
// if the connection failed,

src/AdafruitIO.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class AdafruitIO {
5757

5858
char* boardID();
5959
const char* boardType();
60+
char* version();
6061
virtual const char* connectionType() = 0;
6162

6263
protected:
@@ -67,6 +68,8 @@ class AdafruitIO {
6768
Adafruit_MQTT *_mqtt;
6869
HttpClient *_http;
6970

71+
char _version[10];
72+
7073
const char *_host = "io.adafruit.com";
7174
uint16_t _mqtt_port = 8883;
7275
uint16_t _http_port = 443;

0 commit comments

Comments
 (0)