Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
ca::ExternalFlasher Class Reference

#include <posix/app/chilictl/flash/ExternalFlasher.hpp>

Public Types

enum  State {
  INIT , ERASE , PROGRAM , VERIFY ,
  COMPLETE , FAIL , INVALID
}
 

Public Member Functions

 ExternalFlasher (const char *aAppFilePath, const DeviceInfo &aDeviceInfo)
 Construct an ExternalFlasher instance. More...
 
 ~ExternalFlasher ()
 
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...
 

Member Enumeration Documentation

◆ State

Enumerator
INIT 

Initial state.

ERASE 

Erasing flash.

PROGRAM 
VERIFY 
COMPLETE 

Flashing completed successfully.

FAIL 

Flashing failed.

INVALID 

Class not correctly instantiated.

Constructor & Destructor Documentation

◆ ExternalFlasher()

ca::ExternalFlasher::ExternalFlasher ( const char *  aAppFilePath,
const DeviceInfo aDeviceInfo 
)

Construct an ExternalFlasher instance.

Parameters
aAppFilePathPath to the binary file to be written to the external flash
aDeviceInfoReference to a deviceInfo struct of the device whose external flash will be erased/programmed/read.

◆ ~ExternalFlasher()

ca::ExternalFlasher::~ExternalFlasher ( )

Member Function Documentation

◆ GetState()

State ca::ExternalFlasher::GetState ( )
inline

Get the current state of the flasher.

Returns
The current state of the flasher instance

◆ IsComplete()

bool ca::ExternalFlasher::IsComplete ( )

Is the instance complete and successful?

Returns
True if complete and successful

◆ Process()

ca_error ca::ExternalFlasher::Process ( )

Process the internal state, returning an error if no more processing can be done.

Return values
CA_ERROR_SUCCESSProcessing successful, not yet complete
CA_ERROR_ALREADYProcessing complete and successful
CA_ERROR_INVALID_STATEProcessing complete but failed

The documentation for this class was generated from the following files: