Skip to content

Commit 0919d3a

Browse files
author
brentru
committed
doxy eth/time/data..
1 parent 180b157 commit 0919d3a

11 files changed

Lines changed: 116 additions & 42 deletions

src/AdafruitIO.h

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,51 @@ class AdafruitIO {
6767
const __FlashStringHelper *statusText();
6868

6969
aio_status_t status();
70-
virtual aio_status_t networkStatus() = 0; /*!< Network module status */
70+
/********************************************************************/
71+
/*!
72+
@brief Returns network module status.
73+
@return 0
74+
*/
75+
/*******************************************************************/
76+
virtual aio_status_t networkStatus() = 0;
77+
78+
/********************************************************************/
79+
/*!
80+
@brief Returns MQTT connection status.
81+
*/
82+
/*******************************************************************/
7183
aio_status_t mqttStatus(bool fail_fast = false);
7284

7385
char *boardID();
7486
const char *boardType();
7587
char *version();
7688
char *userAgent();
77-
virtual const char *connectionType() = 0; /*!< Network module type */
89+
90+
/********************************************************************/
91+
/*!
92+
@brief Returns the Adafruit IO network module connection type.
93+
@return 0
94+
*/
95+
/*******************************************************************/
96+
virtual const char *connectionType() = 0;
7897

7998
protected:
80-
virtual void _connect() = 0; /*!< Connect to Adafruit IO MQTT Broker */
81-
virtual void _disconnect() = 0; /*!< Disconnect from Adafruit IO MQTT Broker */
99+
/********************************************************************/
100+
/*!
101+
@brief Establishes a connection with the Adafruit IO MQTT broker.
102+
@return 0
103+
*/
104+
/*******************************************************************/
105+
virtual void _connect() = 0;
106+
107+
/******************************************************/
108+
/*!
109+
@brief Disconnects from the Adafruit IO MQTT broker.
110+
@return 0
111+
*/
112+
/*****************************************************/
113+
virtual void _disconnect() = 0;
114+
82115
aio_status_t _status = AIO_IDLE; /*!< Adafruit IO Connection Status */
83116
uint32_t _last_ping = 0; /*!< Previous time when client pinged Adafruit IO, in milliseconds */
84117
uint32_t _last_mqtt_connect = 0; /*!< Previous time when client connected to Adafruit IO, in milliseconds */

src/AdafruitIO_Data.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,16 @@ static int count_fields(const char *line) {
811811
return cnt;
812812
}
813813

814-
/*
815-
* Given a string containing no linebreaks, or containing line breaks
816-
* which are escaped by "double quotes", extract a NULL-terminated
817-
* array of strings, one for every cell in the row.
818-
*/
814+
/**************************************************************************/
815+
/*!
816+
@brief Extracts a NULL-terminated array of strings, one for every
817+
cell in the row.
818+
@param line
819+
String containing linebreaks or no linebreaks, escaped by
820+
"double quotes".
821+
@return CSV buffer, buf, NULL otherwise.
822+
*/
823+
/**************************************************************************/
819824
char **parse_csv(const char *line) {
820825
char **buf, **bptr, *tmp, *tptr;
821826
const char *ptr;

src/AdafruitIO_Ethernet.h

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
class AdafruitIO_Ethernet : public AdafruitIO {
3636

3737
public:
38-
/**************************************************************************/
39-
/*!
40-
@brief Instanciates an Adafruit Ethernet FeatherWing.
41-
@param *user
42-
Reference to a valid Adafruit IO Username.
43-
@param *key
44-
Reference to a valid Adafruit IO Key.
45-
*/
46-
/**************************************************************************/
38+
/**************************************************************************/
39+
/*!
40+
@brief Instanciates an Adafruit Ethernet FeatherWing.
41+
@param *user
42+
Reference to a valid Adafruit IO Username.
43+
@param *key
44+
Reference to a valid Adafruit IO Key.
45+
*/
46+
/**************************************************************************/
4747
AdafruitIO_Ethernet(const char *user, const char *key)
4848
: AdafruitIO(user, key) {
4949
_client = new EthernetClient();
@@ -52,14 +52,14 @@ class AdafruitIO_Ethernet : public AdafruitIO {
5252
_http = new HttpClient(*_client, _host, _http_port);
5353
}
5454

55-
/**************************************************************************/
56-
/*!
57-
@brief Checks the connection status between the Ethernet
58-
FeatherWing and Adafruit IO
59-
@return AIO_NET_CONNECTED if connected to Adafruit IO,
60-
otherwise AIO_NET_DISCONNECTED.
61-
*/
62-
/**************************************************************************/
55+
/**************************************************************************/
56+
/*!
57+
@brief Checks the connection status between the Ethernet
58+
FeatherWing and Adafruit IO
59+
@return AIO_NET_CONNECTED if connected to Adafruit IO,
60+
otherwise AIO_NET_DISCONNECTED.
61+
*/
62+
/**************************************************************************/
6363
aio_status_t networkStatus() {
6464
if (_status == AIO_NET_CONNECTED)
6565
return _status;
@@ -68,19 +68,24 @@ class AdafruitIO_Ethernet : public AdafruitIO {
6868
return _status;
6969
}
7070

71-
/**************************************************************************/
72-
/*!
73-
@brief Defines network module type.
74-
@return String "ethernet_wing"
75-
*/
76-
/**************************************************************************/
71+
/**************************************************************************/
72+
/*!
73+
@brief Defines network module type.
74+
@return String "ethernet_wing"
75+
*/
76+
/**************************************************************************/
7777
const char *connectionType() { return "ethernet_wing"; }
7878

7979
protected:
8080
byte _mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; /*!< Ethernet FeatherWing MAC Address */
8181

8282
EthernetClient *_client; /*!< Reference to EthernetClient, _client */
8383

84+
/**************************************************************************/
85+
/*!
86+
@brief Attempts to connect Ethernet FeatherWing to Adafruit IO
87+
*/
88+
/**************************************************************************/
8489
void _connect() {
8590
if (Ethernet.begin(_mac) == 0) {
8691
_status = AIO_NET_DISCONNECTED;

src/AdafruitIO_Time.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
#include "AdafruitIO_Time.h"
1717
#include "AdafruitIO.h"
1818

19+
/**************************************************************************/
20+
/*!
21+
@brief Sets up a Adafruit IO Time Service helper.
22+
@param io
23+
Reference to AdafruitIO.
24+
@param f
25+
Adafruit IO time format, either AIO_TIME_SECONDS,
26+
AIO_TIME_MILLIS, or AIO_TIME_ISO.
27+
*/
28+
/**************************************************************************/
1929
AdafruitIO_Time::AdafruitIO_Time(AdafruitIO *io, aio_time_format_t f)
2030
: AdafruitIO_MQTT() {
2131
_io = io;
@@ -26,6 +36,11 @@ AdafruitIO_Time::AdafruitIO_Time(AdafruitIO *io, aio_time_format_t f)
2636
_init();
2737
}
2838

39+
/**************************************************************************/
40+
/*!
41+
@brief Deconstructor for Adafruit IO time service.
42+
*/
43+
/**************************************************************************/
2944
AdafruitIO_Time::~AdafruitIO_Time() {
3045
if (_sub)
3146
delete _sub;
@@ -37,10 +52,27 @@ AdafruitIO_Time::~AdafruitIO_Time() {
3752
free(_topic);
3853
}
3954

55+
/**************************************************************************/
56+
/*!
57+
@brief Sets up a MQTT message callback.
58+
@param cb
59+
MQTT callback type.
60+
*/
61+
/**************************************************************************/
4062
void AdafruitIO_Time::onMessage(AdafruitIOTimeCallbackType cb) {
4163
_dataCallback = cb;
4264
}
4365

66+
/**************************************************************************/
67+
/*!
68+
@brief Sets up a MQTT subscription callback. Calls data callback
69+
with data.
70+
@param val
71+
Data from MQTT topic.
72+
@param len
73+
Length of MQTT topic data.
74+
*/
75+
/**************************************************************************/
4476
void AdafruitIO_Time::subCallback(char *val, uint16_t len) {
4577
data = val;
4678

@@ -49,6 +81,11 @@ void AdafruitIO_Time::subCallback(char *val, uint16_t len) {
4981
_dataCallback(data, len);
5082
}
5183

84+
/**************************************************************************/
85+
/*!
86+
@brief Initializes AdafruitIO Time MQTT topic and REST URLs.
87+
*/
88+
/**************************************************************************/
5289
void AdafruitIO_Time::_init() {
5390

5491
// dynamically allocate memory for mqtt topic and REST URLs

src/AdafruitIO_Time.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@
2323
// forward declaration
2424
class AdafruitIO;
2525

26-
typedef void (*AdafruitIOTimeCallbackType)(char *value, uint16_t len);
26+
typedef void (*AdafruitIOTimeCallbackType)(char *value, uint16_t len); /*!< an instance of Adafruit IO's time callback. */
2727

2828
/**************************************************************************/
2929
/*!
3030
@brief Class that contains functions for interacting with
3131
the Adafruit IO Time Service.
3232
*/
3333
/**************************************************************************/
34-
class Adafruit_TSL2561_Unified : public Adafruit_Sensor {
3534
class AdafruitIO_Time : public AdafruitIO_MQTT {
3635

3736
public:
3837
AdafruitIO_Time(AdafruitIO *io, aio_time_format_t f);
3938
~AdafruitIO_Time();
4039
void onMessage(AdafruitIOTimeCallbackType cb);
4140
void subCallback(char *val, uint16_t len);
42-
char *data;
43-
aio_time_format_t format;
41+
char *data; /*!< Data sent by Adafruit IO's time service. */
42+
aio_time_format_t format; /*!< Adafruit IO time format, TIME_SECONDS/TIME_MILLIS/TIME_ISO. */
4443

4544
private:
4645
AdafruitIOTimeCallbackType _dataCallback;

src/wifi/AdafruitIO_AIRLIFT.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ class AdafruitIO_AIRLIFT : public AdafruitIO {
177177
/**************************************************************************/
178178
/*!
179179
@brief Disconnect the wifi network.
180-
@return none
181180
*/
182181
/**************************************************************************/
183182
void _disconnect() {

src/wifi/AdafruitIO_ESP32.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ void AdafruitIO_ESP32::_connect() {
4747
/**************************************************************************/
4848
/*!
4949
@brief Disconnect the wifi network.
50-
@return none
5150
*/
5251
/**************************************************************************/
5352
void AdafruitIO_ESP32::_disconnect() {

src/wifi/AdafruitIO_ESP8266.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ void AdafruitIO_ESP8266::_connect() {
4949
/**************************************************************************/
5050
/*!
5151
@brief Disconnect the wifi network.
52-
@return none
5352
*/
5453
/**************************************************************************/
5554
void AdafruitIO_ESP8266::_disconnect() {

src/wifi/AdafruitIO_MKR1000.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ void AdafruitIO_MKR1000::_connect() {
5151
/**************************************************************************/
5252
/*!
5353
@brief Disconnect the wifi network.
54-
@return none
5554
*/
5655
/**************************************************************************/
5756
void AdafruitIO_MKR1000::_disconnect() {

src/wifi/AdafruitIO_WICED.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ void AdafruitIO_WICED::_connect() {
4646
/**************************************************************************/
4747
/*!
4848
@brief Disconnect the wifi network.
49-
@return none
5049
*/
5150
/**************************************************************************/
5251
void AdafruitIO_WICED::_disconnect() {

0 commit comments

Comments
 (0)