REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
flasher.h
Go to the documentation of this file.
1#ifndef FLASHERX_H
2#define FLASHERX_H
3
4#include "utils/hashflash.h"
5#include "utils/singleton.h"
6
7namespace loader {
8
10 void reboot();
11
44
56 class FirmwareFlasher : public utils::HeapSingleton<FirmwareFlasher> {
57 FirmwareBuffer *upgrade;
58 void delete_upgrade() { delete upgrade; upgrade = nullptr; }
59 public:
62 int init(JsonObjectConst msg_in, JsonObject &msg_out);
63 int stream(JsonObjectConst msg_in, JsonObject &msg_out);
64 int abort(JsonObjectConst msg_in, JsonObject &msg_out);
65 int complete(JsonObjectConst msg_in, JsonObject &msg_out);
66 void status(JsonObject& msg_out);
68 };
69
70} // ns loader
71
72
73
74#endif /* FLASHERX_H */
Actual "frontend" for flashing.
Definition flasher.h:56
Define singletons which are not static-space allocated (and thus consume valuable ICTM space).
Definition singleton.h:46
utils::status status
Definition daq.h:28
uint32_t
Definition flasher.cpp:195
int init(JsonObjectConst msg_in, JsonObject &msg_out)
Definition flasher.cpp:307
int complete(JsonObjectConst msg_in, JsonObject &msg_out)
Definition flasher.cpp:418
int stream(JsonObjectConst msg_in, JsonObject &msg_out)
Definition flasher.cpp:333
int abort(JsonObjectConst msg_in, JsonObject &msg_out)
Definition flasher.cpp:410
void reboot()
Just a little generic Teensy reboot routine.
Definition flasher.cpp:48
std::array< uint8_t, 32 > sha256_t
Definition dcp.h:11
The Flasher-X over-the-air firmware upgrade process is a small code snippet originally dating from ht...
Definition flasher.h:30
bool transfer_completed()
Definition flasher.h:36
uint32_t buffer_addr
buffer on flash for new image
Definition flasher.h:38
uint32_t buffer_size
identical to imagelen but increaed to next sector boundary
Definition flasher.h:39
std::string name
only used for name association
Definition flasher.h:31
size_t imagelen
Size of image as defined by user, for checking after transmission.
Definition flasher.h:32
utils::sha256_t upstream_hash
Hash as defined by user, for checking after transmission.
Definition flasher.h:33