Skip to content

Commit bfd0a2d

Browse files
committed
Add documentation for return types
1 parent 3be47d6 commit bfd0a2d

6 files changed

+18
-2
lines changed

src/I2CDevice.h

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class I2CDevice {
144144
/**
145145
* @brief Makes the value of a given register persistent.
146146
* @param registerInfo The register to make persistent.
147+
* @return Whether or not the register value was successfully persisted.
147148
*/
148149
bool persistRegister(RegisterInfo registerInfo);
149150

src/IndoorAirQualitySensor.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class IndoorAirQualitySensor : public I2CDevice {
118118
* @param sensorMode The mode to set. See the IndoorAirQualitySensorMode enum class for possible values.
119119
* @param persist If true, the change will be saved to flash memory.
120120
* When persist is true, the mode setting of OutdoorAirQualitySensor and TemperatureHumiditySensor will also be persisted.
121-
*
121+
* @return True if the mode was set successfully, false otherwise.
122122
*/
123123
bool setMode(IndoorAirQualitySensorMode sensorMode, bool persist);
124124

@@ -142,6 +142,7 @@ class IndoorAirQualitySensor : public I2CDevice {
142142
* @param isEnabled True to enable the sensor, false to disable it.
143143
* @param persist If true, the change will be saved to flash memory.
144144
* When persist is true, the mode setting of IndoorAirQualitySensor and TemperatureHumiditySensor will also be persisted.
145+
* @return True if the the sensor was enabled successfully.
145146
*/
146147
bool setEnabled(bool isEnabled, bool persist = false);
147148
};

src/NiclaSenseEnv.h

+5
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class NiclaSenseEnv : public I2CDevice {
166166
* @param baudRate The desired baud rate for the UART communication.
167167
The supported values are: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
168168
* @param persist Set to true to store the setting in flash, to false otherwise.
169+
* @return True if the baud rate was set successfully, false otherwise.
169170
*/
170171
bool setUARTBaudRate(int baudRate, bool persist);
171172

@@ -194,6 +195,7 @@ class NiclaSenseEnv : public I2CDevice {
194195
* @param enabled True to enable UART CSV output, false to disable.
195196
* @param persist True to store the setting in flash, false otherwise.
196197
* When set to True, it will also persist the value set via `setDebuggingEnabled`.
198+
* @return True if the CSV output mode was set successfully, false otherwise.
197199
*/
198200
bool setUARTCSVOutputEnabled(bool enabled, bool persist = false);
199201

@@ -208,6 +210,7 @@ class NiclaSenseEnv : public I2CDevice {
208210
* @brief Sets the CSV delimiter for parsing CSV data.
209211
* @param delimiter The character to be used as the CSV delimiter.
210212
* @param persist If true, the change will be saved to flash memory.
213+
* @return True if the delimiter was set successfully, false otherwise.
211214
*/
212215
bool setCSVDelimiter(char delimiter, bool persist = false);
213216

@@ -224,6 +227,7 @@ class NiclaSenseEnv : public I2CDevice {
224227
* @param enabled A boolean value indicating whether debugging is enabled or not.
225228
* @param persist If true, the change will be saved to flash memory.
226229
* When setting this to true the value set via `setUARTCSVOutputEnabled` will also be persisted.
230+
* @return True if the debugging mode was set successfully, false otherwise.
227231
*/
228232
bool setDebuggingEnabled(bool enabled, bool persist = false);
229233

@@ -232,6 +236,7 @@ class NiclaSenseEnv : public I2CDevice {
232236
*
233237
* @param address The new I2C address. Valid values are 0 to 127.
234238
* @param persist If true, the change will be saved to flash memory.
239+
* @return True if the address was set successfully, false otherwise.
235240
*/
236241
bool setDeviceAddress(int address, bool persist = false);
237242

src/OrangeLED.h

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class OrangeLED : public I2CDevice {
3535
* When persist is true, the `errorStatusEnabled` setting will also be persisted.
3636
* @param brightness : The brightness of the orange LED. Range is 0 to 255.
3737
* @param persist : If true, the brightness setting will be saved to flash memory.
38+
* @return True if the brightness was set successfully, false otherwise.
3839
*/
3940
bool setBrightness(uint8_t brightness, bool persist = false);
4041

@@ -50,6 +51,7 @@ class OrangeLED : public I2CDevice {
5051
* When persist is true, the brightness setting will also be saved to flash memory.
5152
* @param enabled : Whether to enable or disable the orange LED error status.
5253
* @param persist : If true, the change will be saved to flash memory.
54+
* @return True if the mode was set successfully, false otherwise.
5355
*/
5456
bool setErrorStatusEnabled(bool enabled, bool persist = false);
5557
};

src/OutdoorAirQualitySensor.h

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class OutdoorAirQualitySensor : public I2CDevice {
107107
* @param sensorMode The mode to set for the sensor.
108108
* @param persist If true, the change will be saved to flash memory.
109109
* When persist is true, the mode setting of IndoorAirQualitySensor and TemperatureHumiditySensor will also be persisted.
110+
* @return True if the mode was set successfully, false otherwise.
110111
*/
111112
bool setMode(OutdoorAirQualitySensorMode sensorMode, bool persist = false);
112113

@@ -131,6 +132,7 @@ class OutdoorAirQualitySensor : public I2CDevice {
131132
* @param isEnabled True to enable the sensor, false to disable it.
132133
* @param persist If true, the change will be saved to flash memory.
133134
* When persist is true, the mode setting of IndoorAirQualitySensor and TemperatureHumiditySensor will also be persisted.
135+
* @return True if the enabled state was set successfully, false otherwise.
134136
*/
135137
bool setEnabled(bool isEnabled, bool persist = false);
136138
};

src/RGBLED.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class RGBLED : public I2CDevice {
3939
* @param brightness The brightness level of the indicator (0-255).
4040
* @param persist If true, the change will be saved to flash memory.
4141
* When persist is True, the brightness will also be persisted.
42-
*
42+
* @return True if the mode was set successfully, false otherwise.
4343
*/
4444
bool enableIndoorAirQualityStatus(uint8_t brightness = 255, bool persist = false);
4545

@@ -53,6 +53,7 @@ class RGBLED : public I2CDevice {
5353
* @param b The blue value (0-255).
5454
* @param persist If true, the change will be saved to flash memory.
5555
* When persist is True, the brightness will also be persisted.
56+
* @return True if the color was set successfully, false otherwise.
5657
*/
5758
bool setColor(uint8_t r, uint8_t g, uint8_t b, bool persist = false);
5859

@@ -64,6 +65,7 @@ class RGBLED : public I2CDevice {
6465
* @param brightness The brightness value (0-255).
6566
* @param persist If true, the change will be saved to flash memory.
6667
* When persist is True, the brightness will also be persisted.
68+
* @return True if the color was set successfully, false otherwise.
6769
*/
6870
bool setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t brightness, bool persist = false); ;
6971

@@ -74,6 +76,7 @@ class RGBLED : public I2CDevice {
7476
* @param color The RGB color to set.
7577
* @param persist If true, the change will be saved to flash memory.
7678
* When persist is True, the brightness will also be persisted.
79+
* @return True if the color was set successfully, false otherwise.
7780
*/
7881
bool setColor(Color color, bool persist = false);
7982

@@ -83,6 +86,7 @@ class RGBLED : public I2CDevice {
8386
* @param brightness The desired brightness level (0-255).
8487
* @param persist If true, the change will be saved to flash memory.
8588
* When persist is True, the brightness will also be persisted.
89+
* @return True if the color was set successfully, false otherwise.
8690
*/
8791
bool setColor(Color color, uint8_t brightness, bool persist = false);
8892

@@ -105,6 +109,7 @@ class RGBLED : public I2CDevice {
105109
* This function allows you to adjust the brightness of the RGB LED.
106110
* @param brightness The brightness level to set (0-255).
107111
* @param persist If true, the change will be saved to flash memory.
112+
* @return True if the brightness was set successfully, false otherwise.
108113
*/
109114
bool setBrightness(uint8_t brightness, bool persist = false);
110115
};

0 commit comments

Comments
 (0)