CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
FactoryReset.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include "esp_err.h"
6
7namespace cdc::core {
8
13inline constexpr const char* kBootProfileNs = "boot_profile";
14inline constexpr const char* kBootProfileKey = "profile";
15
17 uint16_t eccDeleted = 0;
18 uint16_t rmemDeleted = 0;
19 bool sessionReady = false;
20};
21
36 uint16_t progressEvery = 0,
37 void (*onRmemProgress)(uint16_t current, uint16_t total) = nullptr);
38
43esp_err_t wipeNvs();
44
53[[noreturn]] void selfDestruct();
54
55} // namespace cdc::core
esp_err_t wipeNvs()
Erases the NVS partition and re-initializes it blank.
TropicWipeResult wipeTropic(hal::ISecureElement *se, uint16_t progressEvery=0, void(*onRmemProgress)(uint16_t current, uint16_t total)=nullptr)
Iterates every TROPIC01 ECC slot (0..ECC_SLOT_COUNT-1) and R-Memory slot (0..RMEM_SLOT_COUNT-1),...
void selfDestruct()
Triggers a full factory wipe on the next boot and restarts.
constexpr const char * kBootProfileNs
constexpr const char * kBootProfileKey