* added CommonCLI::saveIdentity()

This commit is contained in:
Scott Powell 2025-09-01 15:22:11 +10:00
parent c28001d1e2
commit ee194a7b19
6 changed files with 47 additions and 1 deletions

View file

@ -305,7 +305,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
uint8_t prv_key[PRV_KEY_SIZE];
bool success = mesh::Utils::fromHex(prv_key, PRV_KEY_SIZE, &config[8]);
if (success) {
_callbacks->getSelfId().readFrom(prv_key, PRV_KEY_SIZE);
mesh::LocalIdentity new_id;
new_id.readFrom(prv_key, PRV_KEY_SIZE);
_callbacks->saveIdentity(new_id);
strcpy(reply, "OK");
} else {
strcpy(reply, "Error, invalid key");

View file

@ -47,6 +47,7 @@ public:
// no op by default
};
virtual mesh::LocalIdentity& getSelfId() = 0;
virtual void saveIdentity(const mesh::LocalIdentity& new_id) = 0;
virtual void clearStats() = 0;
virtual void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) = 0;
};