File tree Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -199,11 +199,16 @@ aio_status_t AdafruitIO::status()
199
199
return _status;
200
200
}
201
201
202
- char * AdafruitIO::id ()
202
+ char * AdafruitIO::boardID ()
203
203
{
204
204
return AdafruitIO_Board::id ();
205
205
}
206
206
207
+ const char * AdafruitIO::boardType ()
208
+ {
209
+ return AdafruitIO_Board::type ();
210
+ }
211
+
207
212
aio_status_t AdafruitIO::mqttStatus ()
208
213
{
209
214
// if the connection failed,
Original file line number Diff line number Diff line change @@ -53,9 +53,11 @@ class AdafruitIO {
53
53
54
54
aio_status_t status ();
55
55
virtual aio_status_t networkStatus () = 0;
56
- char * id ();
57
56
aio_status_t mqttStatus ();
58
57
58
+ char * boardID ();
59
+ const char * boardType ();
60
+
59
61
protected:
60
62
virtual void _connect () = 0;
61
63
aio_status_t _status = AIO_IDLE;
Original file line number Diff line number Diff line change 13
13
14
14
char AdafruitIO_Board::_id[64 ] = " " ;
15
15
16
+ #if defined(ARDUINO_SAMD_MKR1000)
17
+ const char AdafruitIO_Board::_type[] = " mkr1000" ;
18
+ #elif defined(ARDUINO_SAMD_FEATHER_M0)
19
+ const char AdafruitIO_Board::_type[] = " feather_m0" ;
20
+ #elif defined(ARDUINO_AVR_FEATHER32U4)
21
+ const char AdafruitIO_Board::_type[] = " feather_32u4" ;
22
+ #elif defined(ARDUINO_STM32_FEATHER)
23
+ const char AdafruitIO_Board::_type[] = " feather_wiced" ;
24
+ #elif defined(ESP8266)
25
+ const char AdafruitIO_Board::_type[] = " esp8266" ;
26
+ #else
27
+ const char AdafruitIO_Board::_type[] = " unknown" ;
28
+ #endif
29
+
30
+ const char * AdafruitIO_Board::type ()
31
+ {
32
+ return AdafruitIO_Board::_type;
33
+ }
34
+
16
35
#if defined(ARDUINO_ARCH_SAMD)
17
36
18
37
char * AdafruitIO_Board::id ()
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ class AdafruitIO_Board {
25
25
static char _id[64 ];
26
26
static char * id ();
27
27
28
+ static const char _type[];
29
+ static const char * type ();
30
+
31
+
28
32
};
29
33
30
34
#endif // ADAFRUITIO_BOARD_H
You can’t perform that action at this time.
0 commit comments