|
|
|
@ -144,7 +144,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
|
uint32_t curr = getRTCClock()->getCurrentTime(); |
|
|
|
if (sender_timestamp > curr) { |
|
|
|
getRTCClock()->setCurrentTime(sender_timestamp + 1); |
|
|
|
strcpy(reply, "OK - clock set"); |
|
|
|
uint32_t now = getRTCClock()->getCurrentTime(); |
|
|
|
DateTime dt = DateTime(now); |
|
|
|
sprintf(reply, "OK - clock set: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year()); |
|
|
|
} else { |
|
|
|
strcpy(reply, "ERR: clock cannot go backwards"); |
|
|
|
} |
|
|
|
@ -161,7 +163,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
|
uint32_t curr = getRTCClock()->getCurrentTime(); |
|
|
|
if (secs > curr) { |
|
|
|
getRTCClock()->setCurrentTime(secs); |
|
|
|
strcpy(reply, "(OK - clock set!)"); |
|
|
|
uint32_t now = getRTCClock()->getCurrentTime(); |
|
|
|
DateTime dt = DateTime(now); |
|
|
|
sprintf(reply, "OK - clock set: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year()); |
|
|
|
} else { |
|
|
|
strcpy(reply, "(ERR: clock cannot go backwards)"); |
|
|
|
} |
|
|
|
|