Skip to content

Commit b86d9c2

Browse files
committed
Doxygen Pass 1/2
1 parent 080d1da commit b86d9c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+370
-31
lines changed

src/Wippersnapper_V2.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
// Cpp STD
5656
#include <functional>
5757
#include <map>
58-
#include <vector>
5958
#include <string>
59+
#include <vector>
6060

6161
// Nanopb dependencies
6262
#include <nanopb/pb_common.h>
@@ -231,8 +231,8 @@ class Wippersnapper_V2 {
231231
AnalogIOController *analogio_controller =
232232
nullptr; ///< Instance of AnalogIO controller
233233
DS18X20Controller *_ds18x20_controller =
234-
nullptr; ///< Instance of DS18X20 controller
235-
I2cController *_i2c_controller = nullptr;
234+
nullptr; ///< Instance of DS18X20 controller
235+
I2cController *_i2c_controller = nullptr; ///< Instance of I2C controller
236236

237237
// TODO: does this really need to be global?
238238
uint8_t _macAddrV2[6]; /*!< Unique network iface identifier */
@@ -261,8 +261,8 @@ class Wippersnapper_V2 {
261261
///< otherwise.
262262
std::vector<std::vector<uint8_t>>
263263
_sharedConfigBuffers; ///< Shared JSON config buffers for offline mode
264-
JsonDocument _config_doc;
265-
uint8_t pin_sd_cs; ///< SD card chip select pin
264+
JsonDocument _config_doc; ///< Storage for the config.json file
265+
uint8_t pin_sd_cs; ///< SD card chip select pin
266266
private:
267267
void _initV2();
268268

src/adapters/wifi/ws_wifi_esp32.h

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,35 @@ class ws_wifi_esp32 : public Wippersnapper_V2 {
5050
/**************************************************************************/
5151
/*!
5252
@brief Overload for ESP32 devices without filesystem-backed provisioning.
53+
@param aioUsername
54+
Adafruit IO username.
55+
@param aioKey
56+
Adafruit IO key.
57+
@param netSSID
58+
WiFi network's SSID.
59+
@param netPass
60+
WiFi network's password.
61+
@param brokerURL
62+
Adafruit IO broker URL.
63+
@param brokerPort
64+
Adafruit IO broker port.
5365
*/
5466
/**************************************************************************/
5567
ws_wifi_esp32(const char *aioUsername, const char *aioKey,
56-
const char *netSSID, const char *netPass,
57-
const char *brokerURL, uint16_t brokerPort)
68+
const char *netSSID, const char *netPass, const char *brokerURL,
69+
uint16_t brokerPort)
5870
: Wippersnapper_V2() {
5971
_ssid = netSSID;
6072
_pass = netPass;
6173

6274
// Move credentials to the config struct
63-
strncpy(WsV2._configV2.network.ssid, _ssid, sizeof(WsV2._configV2.network.ssid));
64-
strncpy(WsV2._configV2.network.pass, _pass, sizeof(WsV2._configV2.network.pass));
75+
strncpy(WsV2._configV2.network.ssid, _ssid,
76+
sizeof(WsV2._configV2.network.ssid));
77+
strncpy(WsV2._configV2.network.pass, _pass,
78+
sizeof(WsV2._configV2.network.pass));
6579
strncpy(WsV2._configV2.aio_key, aioKey, sizeof(WsV2._configV2.aio_key));
66-
strncpy(WsV2._configV2.aio_user, aioUsername, sizeof(WsV2._configV2.aio_user));
80+
strncpy(WsV2._configV2.aio_user, aioUsername,
81+
sizeof(WsV2._configV2.aio_user));
6782
strncpy(WsV2._configV2.aio_url, brokerURL, sizeof(WsV2._configV2.aio_url));
6883
WsV2._configV2.io_port = brokerPort;
6984
}
@@ -143,7 +158,8 @@ class ws_wifi_esp32 : public Wippersnapper_V2 {
143158
if (WsV2._isWiFiMultiV2) {
144159
// multi network mode
145160
for (int j = 0; j < WS_MAX_ALT_WIFI_NETWORKS; j++) {
146-
if (strcmp(WsV2._multiNetworksV2[j].ssid, WiFi.SSID(i).c_str()) == 0) {
161+
if (strcmp(WsV2._multiNetworksV2[j].ssid, WiFi.SSID(i).c_str()) ==
162+
0) {
147163
WS_DEBUG_PRINT("SSID (");
148164
WS_DEBUG_PRINT(WsV2._multiNetworksV2[j].ssid);
149165
WS_DEBUG_PRINT(") found! RSSI: ");
@@ -203,8 +219,8 @@ class ws_wifi_esp32 : public Wippersnapper_V2 {
203219
? _aio_root_ca_prod
204220
: _aio_root_ca_staging);
205221
WsV2._mqttV2 = new Adafruit_MQTT_Client(
206-
_mqtt_client_secure, WsV2._configV2.aio_url, WsV2._configV2.io_port, clientID,
207-
WsV2._configV2.aio_user, WsV2._configV2.aio_key);
222+
_mqtt_client_secure, WsV2._configV2.aio_url, WsV2._configV2.io_port,
223+
clientID, WsV2._configV2.aio_user, WsV2._configV2.aio_key);
208224
} else {
209225
// Insecure connections require a NetworkClient object rather than a
210226
// NetworkClientSecure object

src/components/ds18x20/model.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ bool DS18X20Model::EncodeDs18x20Event() {
154154
/*************************************************************************/
155155
/*!
156156
@brief Initializes the Ds18x20Event message.
157+
@param ow_pin_name
158+
The OneWire bus pin name.
157159
*/
158160
/*************************************************************************/
159161
void DS18X20Model::InitDS18x20EventMsg(const char *ow_pin_name) {

src/components/i2c/controller.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,22 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
331331
return new drvVl6180x(i2c, addr, mux_channel, driver_name);
332332
}}};
333333

334+
/***********************************************************************/
335+
/*!
336+
@brief Creates an I2C driver by name
337+
@param driver_name
338+
The name of the I2C driver.
339+
@param i2c
340+
The I2C bus.
341+
@param addr
342+
The I2C device address.
343+
@param i2c_mux_channel
344+
The I2C MUX channel.
345+
@param status
346+
The I2cDeviceStatus message.
347+
@returns A pointer to the I2C driver.
348+
*/
349+
/***********************************************************************/
334350
drvBase *createI2CDriverByName(const char *driver_name, TwoWire *i2c,
335351
uint16_t addr, uint32_t i2c_mux_channel,
336352
wippersnapper_i2c_I2cDeviceStatus &status) {
@@ -499,7 +515,8 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
499515

500516
// Mux case #1 - We are creating a mux via I2cDeviceAddorReplace message
501517
// TODO: Refactor
502-
if ((strcmp(device_name, "pca9546") == 0)) {
518+
if ((strcmp(device_name, "pca9546") == 0) ||
519+
(strcmp(device_name, "pca9548") == 0)) {
503520
WS_DEBUG_PRINTLN("[i2c] Creating a new MUX driver obj");
504521
if (use_alt_bus) {
505522
if (!_i2c_bus_alt->HasMux()) {
@@ -715,10 +732,10 @@ void I2cController::update() {
715732
if (!WsV2._sdCardV2->LogI2cDeviceEvent(_i2c_model->GetI2cDeviceEvent())) {
716733
WS_DEBUG_PRINTLN(
717734
"[i2c] ERROR: Unable to log the I2cDeviceEvent to SD!");
718-
// TODO: Add Status Pixel signaling around this
735+
statusLEDSolid(WS_LED_STATUS_FS_WRITE);
719736
}
720737
} else {
721-
// TODO: Implement!
738+
// TODO: This needs to be implemented for online mode
722739
WS_DEBUG_PRINTLN(
723740
"[i2c] MQTT Publish I2cDeviceEvent not yet implemented!");
724741
}

src/components/i2c/controller.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ class I2cController {
8282
I2cController();
8383
~I2cController();
8484
void update();
85-
// Routing
86-
bool Handle_I2cBusScan(pb_istream_t *stream);
85+
// Routing //
8786
bool Handle_I2cDeviceAddOrReplace(pb_istream_t *stream);
87+
// TODO: These are for Online mode
8888
bool Handle_I2cDeviceRemove(pb_istream_t *stream);
89-
// Publishing
89+
// bool Handle_I2cBusScan(pb_istream_t *stream);
90+
// Publishing //
9091
bool PublishI2cDeviceAddedorReplaced(
9192
const wippersnapper_i2c_I2cDeviceDescriptor &device_descriptor,
9293
const wippersnapper_i2c_I2cDeviceStatus &device_status);
93-
// Helpers
94+
// Helpers //
9495
bool IsBusStatusOK(bool is_alt_bus);
9596
void ConfigureMuxChannel(uint32_t mux_channel, bool is_alt_bus);
96-
9797
private:
9898
I2cModel *_i2c_model; ///< Pointer to an I2C model object
9999
I2cHardware *_i2c_bus_default; ///< Pointer to the default I2C bus

src/components/i2c/drivers/drvAdt7410.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class drvAdt7410 : public drvBase {
3232
The I2C interface.
3333
@param sensorAddress
3434
7-bit device address.
35+
@param mux_channel
36+
The I2C multiplexer channel.
37+
@param driver_name
38+
The name of the driver.
3539
*/
3640
/*******************************************************************************/
3741
drvAdt7410(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel, const char* driver_name)

src/components/i2c/drivers/drvAhtx0.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class drvAhtx0 : public drvBase {
3535
The I2C interface.
3636
@param sensorAddress
3737
7-bit device address.
38+
@param mux_channel
39+
The I2C multiplexer channel.
40+
@param driver_name
41+
The name of the driver.
3842
*/
3943
/*******************************************************************************/
4044
drvAhtx0(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel, const char* driver_name)

src/components/i2c/drivers/drvBh1750.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class drvBh1750 : public drvBase {
4040
The I2C interface.
4141
@param sensorAddress
4242
7-bit device address.
43+
@param mux_channel
44+
The I2C multiplexer channel.
45+
@param driver_name
46+
The name of the driver.
4347
*/
4448
/*******************************************************************************/
4549
drvBh1750(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel, const char* driver_name)

src/components/i2c/drivers/drvBme280.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class drvBme280 : public drvBase {
3939
7-bit device address.
4040
@param mux_channel
4141
The I2C MUX channel, if applicable.
42+
@param mux_channel
43+
The I2C multiplexer channel.
44+
@param driver_name
45+
The name of the driver.
4246
*/
4347
/*******************************************************************************/
4448
drvBme280(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel, const char* driver_name)

src/components/i2c/drivers/drvBme680.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class drvBme680 : public drvBase {
3737
The I2C interface.
3838
@param sensorAddress
3939
7-bit device address.
40+
@param mux_channel
41+
The I2C multiplexer channel.
42+
@param driver_name
43+
The name of the driver.
4044
*/
4145
/*******************************************************************************/
4246
drvBme680(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel,

0 commit comments

Comments
 (0)