29 #ifndef POSIX_APP_CHILICTL_EXTERNAL_FLASH_EXTERNALFLASHER_HPP_
30 #define POSIX_APP_CHILICTL_EXTERNAL_FLASH_EXTERNALFLASHER_HPP_
96 uint32_t mMetadataStartAddr;
97 uint32_t mCurrentAppStartAddr;
98 uint32_t mBinarySizeMetadataPartitionAddr;
100 uint32_t mBinaryHashMetadataPartitionAddr;
101 bool mBinaryHashSent;
103 DeviceInfo mDeviceInfo;
107 void set_state(
State aNextState);
123 void configure_max_binsize();
124 size_t get_page_count(
size_t len) {
return (len + (mPageSize - 1)) / mPageSize; }
126 static const char *state_string(
State aState);
C++ wrapper for the C ca_device_info struct, which owns its own memory.
Definition: DeviceInfo.hpp:40
Definition: ExternalFlasher.hpp:40
State GetState()
Get the current state of the flasher.
Definition: ExternalFlasher.hpp:80
State
Definition: ExternalFlasher.hpp:43
@ ERASE
Erasing flash.
Definition: ExternalFlasher.hpp:45
@ INIT
Initial state.
Definition: ExternalFlasher.hpp:44
@ VERIFY
Definition: ExternalFlasher.hpp:47
@ COMPLETE
Flashing completed successfully.
Definition: ExternalFlasher.hpp:48
@ INVALID
Class not correctly instantiated.
Definition: ExternalFlasher.hpp:50
@ PROGRAM
Definition: ExternalFlasher.hpp:46
@ FAIL
Flashing failed.
Definition: ExternalFlasher.hpp:49
ca_error Process()
Process the internal state, returning an error if no more processing can be done.
Definition: ExternalFlasher.cpp:79
ExternalFlasher(const char *aAppFilePath, const DeviceInfo &aDeviceInfo)
Construct an ExternalFlasher instance.
Definition: ExternalFlasher.cpp:40
~ExternalFlasher()
Definition: ExternalFlasher.cpp:74
bool IsComplete()
Is the instance complete and successful?
Definition: ExternalFlasher.cpp:325
ca_error
Cascoda error type.
Definition: ca821x_error.h:51
EVBME Message command in Cascoda TLV format.
Definition: evbme_messages.h:258
CA-821x Device reference struct.
Definition: ca821x_api.h:123