Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include <posix/app/chilictl/flash/Flasher.hpp>
Public Types | |
enum | FlashType { APROM_CLEAR = 0 , APROM_PROGRAM = 1 , APROM_CLEAR_AND_PROGRAM = 2 , DFU = 3 , MANUFACTURER = 4 } |
Enumeration of different areas of flash to rewrite. More... | |
enum | State { INIT , OTA_ERASE , REBOOT , ERASE , FLASH , VERIFY , VALIDATE , COMPLETE , FAIL , INVALID } |
State enumeration for flasher state machine. More... | |
Public Member Functions | |
Flasher (const char *aAppFilePath, const char *aOtaBootFilePath, const char *aManufacturerDataFilePath, const DeviceInfo &aDeviceInfo, FlashType aFlashType) | |
Construct a flasher instance. More... | |
~Flasher () | |
ca_error | Process () |
Process the internal state, returning an error if no more processing can be done. More... | |
bool | IsComplete () |
Is the instance complete and successful? More... | |
State | GetState () |
Get the current state of the flasher. More... | |
void | SetIgnoreVersion (bool aIgnoreVersion) |
Enable/Disable the version check for the connected device. More... | |
void | SetEnumerateUartDevices (bool aEnumerateUartDevices) |
Enumeration of different areas of flash to rewrite.
enum ca::Flasher::State |
State enumeration for flasher state machine.
ca::Flasher::Flasher | ( | const char * | aAppFilePath, |
const char * | aOtaBootFilePath, | ||
const char * | aManufacturerDataFilePath, | ||
const DeviceInfo & | aDeviceInfo, | ||
FlashType | aFlashType | ||
) |
Construct a flasher instance.
aAppFilePath | Path to the binary file of the application to be flashed |
aOtaBootFilePath | Path to the binary file of the ota bootloader to be flashed |
aManufacturerDataFilePath | Path to the binary file of the manufacturer data file to be flashed |
aDeviceInfo | Reference to a deviceInfo struct of the device to be reflashed |
aFlashType | Type of reflashing to execute (Update application or bootloader?) |
ca::Flasher::~Flasher | ( | ) |
|
inline |
Get the current state of the flasher.
bool ca::Flasher::IsComplete | ( | ) |
Is the instance complete and successful?
ca_error ca::Flasher::Process | ( | ) |
Process the internal state, returning an error if no more processing can be done.
CA_ERROR_SUCCESS | Processing successful, not yet complete |
CA_ERROR_ALREADY | Processing complete and successful |
CA_ERROR_INVALID_STATE | Processing complete but failed |
|
inline |
|
inline |
Enable/Disable the version check for the connected device.
This is useful if the connected device's version number is broken for some reason, but the actual firmware is up to date. Defaults to false (Version check is enabled)
aIgnoreVersion | Set to true to ignore the version check, Set to false to enable the version check |