@@ -144,7 +144,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
144144 uint32_t curr = getRTCClock ()->getCurrentTime ();
145145 if (sender_timestamp > curr) {
146146 getRTCClock ()->setCurrentTime (sender_timestamp + 1 );
147- strcpy (reply, " OK - clock set" );
147+ uint32_t now = getRTCClock ()->getCurrentTime ();
148+ DateTime dt = DateTime (now);
149+ sprintf (reply, " OK - clock set: %02d:%02d - %d/%d/%d UTC" , dt.hour (), dt.minute (), dt.day (), dt.month (), dt.year ());
148150 } else {
149151 strcpy (reply, " ERR: clock cannot go backwards" );
150152 }
@@ -161,7 +163,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
161163 uint32_t curr = getRTCClock ()->getCurrentTime ();
162164 if (secs > curr) {
163165 getRTCClock ()->setCurrentTime (secs);
164- strcpy (reply, " (OK - clock set!)" );
166+ uint32_t now = getRTCClock ()->getCurrentTime ();
167+ DateTime dt = DateTime (now);
168+ sprintf (reply, " OK - clock set: %02d:%02d - %d/%d/%d UTC" , dt.hour (), dt.minute (), dt.day (), dt.month (), dt.year ());
165169 } else {
166170 strcpy (reply, " (ERR: clock cannot go backwards)" );
167171 }
@@ -245,10 +249,8 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
245249 strcpy (reply, " OK" );
246250 } else if (memcmp (config, " flood.advert.interval " , 22 ) == 0 ) {
247251 int hours = _atoi (&config[22 ]);
248- if (hours > 0 && hours < 3 ) {
249- sprintf (reply, " Error: min is 3 hours" );
250- } else if (hours > 48 ) {
251- strcpy (reply, " Error: max is 48 hours" );
252+ if ((hours > 0 && hours < 3 ) || (hours > 48 )) {
253+ strcpy (reply, " Error: interval range is 3-48 hours" );
252254 } else {
253255 _prefs->flood_advert_interval = (uint8_t )(hours);
254256 _callbacks->updateFloodAdvertTimer ();
@@ -257,10 +259,8 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
257259 }
258260 } else if (memcmp (config, " advert.interval " , 16 ) == 0 ) {
259261 int mins = _atoi (&config[16 ]);
260- if (mins > 0 && mins < MIN_LOCAL_ADVERT_INTERVAL) {
261- sprintf (reply, " Error: min is %d mins" , MIN_LOCAL_ADVERT_INTERVAL);
262- } else if (mins > 240 ) {
263- strcpy (reply, " Error: max is 240 mins" );
262+ if ((mins > 0 && mins < MIN_LOCAL_ADVERT_INTERVAL) || (mins > 240 )) {
263+ sprintf (reply, " Error: interval range is %d-240 minutes" , MIN_LOCAL_ADVERT_INTERVAL);
264264 } else {
265265 _prefs->advert_interval = (uint8_t )(mins / 2 );
266266 _callbacks->updateAdvertTimer ();
0 commit comments