@@ -34,6 +34,7 @@ SOFTWARE.
34
34
// / Arduino detection
35
35
#ifdef ARDUINO
36
36
#include " Arduino.h"
37
+ #include " Wire.h"
37
38
#endif
38
39
39
40
#include < math.h>
@@ -42,6 +43,12 @@ SOFTWARE.
42
43
#include < avr/wdt.h>
43
44
#endif
44
45
46
+ #ifdef ESP32
47
+
48
+ #include " time.h"
49
+
50
+ #endif
51
+
45
52
#include " Commander-API.hpp"
46
53
47
54
// -------- System functions --------//
@@ -161,6 +168,37 @@ void commander_wifiScan_func( char *args, Stream *response );
161
168
162
169
#endif
163
170
171
+ #ifdef ESP32
172
+
173
+ #define API_ELEMENT_CONFIGTIME apiElement ( " configTime" , " Configure NTP time settings.\r\n\t Example: configTime [ GMT Offset Sec ] [ DL Offset Sec ] [ Server ]\r\n\t [ GMT Offset Sec ] - UTC offset for your timezone in seconds.\r\n\t [ GMT Offset Sec ] - Daylight offset in sec.\r\n\t [ Server ] - NTP Server Address( optional, default: pool.ntp.org )" , commander_configTime_func )
174
+ // / Premade function for wifiScan command.
175
+ // / @param args Pointer to the argument string.
176
+ // / @param response Response channel for messages.
177
+ void commander_configTime_func( char *args, Stream *response );
178
+
179
+ #define API_ELEMENT_DATETIME apiElement ( " dateTime" , " Returns the NTP synchronised date and time." , commander_dateTime_func )
180
+ // / Premade function for wifiScan command.
181
+ // / @param args Pointer to the argument string.
182
+ // / @param response Response channel for messages.
183
+ void commander_dateTime_func( char *args, Stream *response );
184
+
185
+ #endif
186
+
187
+ #ifdef ARDUINO
188
+
189
+ #ifdef __AVR__
190
+
191
+ #define API_ELEMENT_I2C_BEGIN apiElement ( " i2cBegin" , " Initialize I2C peripheral as bus master." , commander_i2cBegin_func )
192
+ #ifdef __AVR__
193
+ #define API_ELEMENT_P_I2C_BEGIN ( element ) apiElement_P( element, " i2cBegin" , " Initialize I2C peripheral as bus master." , commander_i2cBegin_func )
194
+ #endif
195
+ // / Premade function for sin command.
196
+ // / @param args Pointer to the argument string.
197
+ // / @param response Response channel for messages.
198
+ void commander_i2cBegin_func ( char *args, Stream *response );
199
+
200
+ #endif
201
+
164
202
// -------- Math functions --------//
165
203
166
204
#define API_ELEMENT_SIN apiElement ( " sin" , " Sine function. The input is in radians." , commander_sin_func )
0 commit comments