NodeMaintenance, build_version.py: back to the original formatting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46d33bd2b0
commit
73c1a7beb2
3 files changed
+86
-107
No files matched your search
@@ -32,49 +32,48 @@
|
||||
|
||||
class NodeMaintenance {
|
||||
public:
|
||||
NodeMaintenance(mesh::MainBoard &board, RadioLibWrapper &radio)
|
||||
: _board(board), _radio(radio), _fw(board) {}
|
||||
NodeMaintenance(mesh::MainBoard& board, RadioLibWrapper& radio) : _board(board), _radio(radio), _fw(board) { }
|
||||
|
||||
// Prints (and latches for `get boot`) the reset reason and the hardfault record.
|
||||
// The record is cleared once read, so call it once, as early as Serial is up.
|
||||
void printBootDiag();
|
||||
|
||||
void begin(FILESYSTEM *fs, NodePrefs *prefs, CommonCLICallbacks *callbacks);
|
||||
void begin(FILESYSTEM* fs, NodePrefs* prefs, CommonCLICallbacks* callbacks);
|
||||
void loop();
|
||||
|
||||
// sender_timestamp == 0 means the local console (the same test CommonCLI uses
|
||||
// for `erase`); `dfu` refuses anything else.
|
||||
bool handleCommand(uint32_t sender_timestamp, const char *command, char *reply);
|
||||
bool handleCommand(uint32_t sender_timestamp, const char* command, char* reply);
|
||||
|
||||
// Binary request from a logged-in client (REQ_TYPE_FW_OTA, firmware chunks).
|
||||
// Returns the reply length, 0 = no reply. Admins only.
|
||||
int handleRequest(bool admin, const uint8_t *req, int len, uint8_t *reply, int reply_max) {
|
||||
int handleRequest(bool admin, const uint8_t* req, int len, uint8_t* reply, int reply_max) {
|
||||
if (!admin || len < 1 || req[0] != REQ_TYPE_FW_OTA) return 0;
|
||||
return _fw.handleBinary(req, len, reply, reply_max);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t radioActivity() const { return _radio.getPacketsRecv() + _radio.getPacketsRecvErrors(); }
|
||||
void silenceLoad(uint8_t *backoff);
|
||||
void silenceLoad(uint8_t* backoff);
|
||||
void silenceSave(uint8_t backoff);
|
||||
bool dfuCommand(uint32_t sender_timestamp, const char *command, char *reply);
|
||||
bool silenceCommand(const char *command, char *reply);
|
||||
bool dfuCommand(uint32_t sender_timestamp, const char* command, char* reply);
|
||||
bool silenceCommand(const char* command, char* reply);
|
||||
void dfuTick();
|
||||
|
||||
mesh::MainBoard &_board;
|
||||
RadioLibWrapper &_radio;
|
||||
FILESYSTEM *_fs = NULL;
|
||||
NodePrefs *_prefs = NULL;
|
||||
CommonCLICallbacks *_callbacks = NULL;
|
||||
mesh::MainBoard& _board;
|
||||
RadioLibWrapper& _radio;
|
||||
FILESYSTEM* _fs = NULL;
|
||||
NodePrefs* _prefs = NULL;
|
||||
CommonCLICallbacks* _callbacks = NULL;
|
||||
|
||||
FwUpdate _fw;
|
||||
RadioSilenceWatchdog _silence;
|
||||
uint32_t _silence_reboots = 0;
|
||||
|
||||
unsigned long _dfu_at = 0; // 0 = nothing armed
|
||||
uint8_t _dfu_mode = 0; // 0=uf2 1=serial 2=ota
|
||||
unsigned long _dfu_at = 0; // 0 = nothing armed
|
||||
uint8_t _dfu_mode = 0; // 0=uf2 1=serial 2=ota
|
||||
|
||||
uint32_t _reset_reason = 0;
|
||||
uint32_t _hardfault[3] = { 0, 0, 0 }; // pc, lr, psr; pc 0 = none
|
||||
uint32_t _hardfault[3] = {0, 0, 0}; // pc, lr, psr; pc 0 = none
|
||||
bool _hardfault_seen = false;
|
||||
};
|
||||
Reference in new issue
Block a user