![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Represents a bootloader command. More...
#include <Command.h>
Inheritance diagram for blfwk::Command:
Collaboration diagram for blfwk::Command:Public Member Functions | |
| virtual | ~Command () |
| Destructor. | |
| virtual bool | init () |
| Initialize. More... | |
| virtual void | sendTo (Packetizer &packetizer) |
| Send command to packetizer and on to peripheral. | |
| virtual const uint32_vector_t * | getResponseValues () const |
| Get response values vector. | |
| virtual std::string | getResponse () const |
| Get response as JSON string. | |
| void | logResponses () const |
| Log the response description. | |
| void | registerProgress (Progress *progress) |
| initial the process callback. | |
String arguments accessors. | |
| virtual std::string | getArg (int arg) const |
| Get the specified argument. | |
| virtual std::string | getName () const |
| Get the command name (i.e. argv[0]). | |
| virtual size_t | getArgCount () const |
| Get the number of arguments, including the command name. | |
Static Public Member Functions | |
| static Command * | create (const string_vector_t *argv) |
| Create an appropriate command subclass. More... | |
| static std::string | getStatusMessage (status_t code) |
| Get a status code description. | |
Public Attributes | |
| Progress * | m_progress |
| Variable for progress control. | |
Protected Member Functions | |
| Command (const string_vector_t *argv) | |
| Constructor that takes a command name and list of arguments. More... | |
| Command (const char *const name) | |
| Constructor that takes a command name. More... | |
| virtual bool | processResponse (const generic_response_packet_t *packet, uint8_t commandTag) |
| Check generic response packet. More... | |
Protected Attributes | |
| string_vector_t | m_argv |
| Vector of argument strings. | |
| uint32_vector_t | m_responseValues |
| Vector of response values. | |
| string | m_responseDetails |
| Descriptive response. | |
Represents a bootloader command.
Do not instantiate this class. Instead, use the create() method to create the appropriate subclass based on command name in argv[0].
|
inlineprotected |
Constructor that takes a command name and list of arguments.
| argv | Argument vector |
|
inlineprotected |
Constructor that takes a command name.
| name | Name of the command |
|
static |
Create an appropriate command subclass.
Pass the command name in argv[0] and optional arguments in the rest of the string vector. Caller is responsible for deleting the returned object.
This factory method is just a shorthand for creating a subclass directly, for example:
| argv | Argument vector |
| Command | object |
|
inlinevirtual |
Initialize.
Subclasses should implement init() to check for valid arguments.
Reimplemented in blfwk::ConfigureCan, blfwk::ConfigureSpi, blfwk::ConfigureI2c, blfwk::FlashImage, blfwk::ReliableUpdate, blfwk::ConfigureQuadSpi, blfwk::FlashReadResource, blfwk::FlashReadOnce, blfwk::FlashProgramOnce, blfwk::FlashSecurityDisable, blfwk::Call, blfwk::Execute, blfwk::ReceiveSbFile, blfwk::FillMemory, blfwk::WriteMemory, blfwk::ReadMemory, blfwk::FlashEraseAllUnsecure, blfwk::FlashEraseAll, blfwk::FlashEraseRegion, blfwk::SetProperty, blfwk::GetProperty, and blfwk::Reset.
|
protectedvirtual |
Check generic response packet.
| packet | Packet received from device |
| commandTag | Expected command tag in packet |