mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-12 21:07:19 +00:00
Backup / restore preferences method
This commit is contained in:
@@ -373,6 +373,25 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_backup_preferences_tag: {
|
||||
LOG_INFO("Client requesting to backup preferences");
|
||||
if (nodeDB->backupPreferences(r->backup_preferences)) {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||
} else {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_restore_preferences_tag: {
|
||||
LOG_INFO("Client requesting to restore preferences");
|
||||
if (nodeDB->restorePreferences(r->backup_preferences)) {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||
disableBluetooth();
|
||||
} else {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef ARCH_PORTDUINO
|
||||
case meshtastic_AdminMessage_exit_simulator_tag:
|
||||
LOG_INFO("Exiting simulator");
|
||||
|
||||
Reference in New Issue
Block a user