mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 17:22:59 +00:00
Set time-only admin command (#4479)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "MeshService.h"
|
||||
#include "NodeDB.h"
|
||||
#include "PowerFSM.h"
|
||||
#include "RTC.h"
|
||||
#include <FSCommon.h>
|
||||
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||
#include "BleOta.h"
|
||||
@@ -279,6 +280,15 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
}
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_set_time_only_tag: {
|
||||
LOG_INFO("Client is receiving a set_time_only command.\n");
|
||||
struct timeval tv;
|
||||
tv.tv_sec = r->set_time_only;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
perhapsSetRTC(RTCQualityFromNet, &tv, false);
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_enter_dfu_mode_request_tag: {
|
||||
LOG_INFO("Client is requesting to enter DFU mode.\n");
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_RP2040)
|
||||
|
||||
Reference in New Issue
Block a user