feat(SystemHandler,ConfigManager): add system.set_identity sysadmin command (F-060)
Device identity (serial/hw_family/hw_revision) has been read-only from production firmware since NVS provisioning — serial derives the MQTT password and hw_family/hw_revision select the OTA channel, so an uncontrolled write path could desync MQTT auth or brick OTA to the wrong hardware. This adds one narrow, deliberate exception: an MQTT-only system.set_identity command for correcting a mis-provisioned unit or reassigning a serial after a board swap, without a USB/serial reflash. Rejected over WebSocket/HTTP/UART by design (same pattern as identify's WebSocket-only check); requires all three fields together to avoid partial-identity states; forces a reboot after a successful write since MQTT credentials/hostname/AP SSID are derived from serial only once at boot. Firmware does not update the backend device record itself — that's the caller's (console's) responsibility in the same operation. Also includes docs/README.md's rule 6 (console API reference sync requirement) from an earlier uncommitted session, which this change follows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,7 @@ private:
|
||||
CommandResult handleGetTelemetry(const CommandEnvelope& e);
|
||||
CommandResult handleFactoryReset(const CommandEnvelope& e);
|
||||
CommandResult handleRestart(const CommandEnvelope& e);
|
||||
CommandResult handleSetIdentity(const CommandEnvelope& e);
|
||||
};
|
||||
|
||||
#endif // HAS_RTC
|
||||
|
||||
Reference in New Issue
Block a user