blfwk::Simulator Class Reference

Represents the host bootloader. More...

`#include <Simulator.h>`

Inheritance diagram for blfwk::Simulator:
[legend]
Collaboration diagram for blfwk::Simulator:
[legend]

## Public Types

typedef std::vector< blfwk::MemoryStore * > | memory_vector_t
| A vector of memory stores.

## Public Member Functions

virtual | ~Simulator ()
| Destructor.
void | init ()
| Initialize.
bool | openStateFiles (const std::string &pathToDir, bool forceCreate)
| Configure and open state files. More...
Accessors.
SimPacketizer * | getHost () const
| Get the host packetizer.
SimPacketizer * | getDevice () const
| Get the device packetizer.
MemoryStore * | getMemoryStore (int index) const
| Get a device state memory store. More...
Public Member Functions inherited from blfwk::Bootloader
| Bootloader ()
| Default Constructor for Simulator.
| Bootloader (const Peripheral::PeripheralConfigData &config)
| Constructor.
virtual | ~Bootloader ()
| Destructor.
void | inject (Command &cmd)
| Inject a command into the bootloader. More...
void | flush ()
| Flush state.
void | execute (uint32_t entry_point, uint32_t param=0, uint32_t stack_pointer=0)
| Execute the execute command.
void | reset ()
| Execute the reset command.
standard_version_t | getVersion ()
| Execute the get-property(current-version) command.
uint32_t | getSecurityState ()
| Execute the get-property(flash-security-state) command.
void | ping (int retries, unsigned int delay, int comSpeed)
| Send a ping if applicable.
Packetizer * | getPacketizer () const
| Get the host packetizer.

## Static Public Member Functions

static Simulator & | getSimulator ()
| Get the singleton simulator object. More...

## Protected Member Functions

| Simulator ()
| Constructor.

## Protected Attributes

SimPacketizer * | m_devicePacketizer
| Packet interface to recieve commands on.
uchar_deque_t | m_commandStream
uchar_deque_t | m_responseStream
command_processor_data_t | m_commandProcessor
bool | m_areStateFilesOpen
| True if state files are in use.
memory_vector_t | m_memoryStore
| Vector of memory stores, one per map entry.
OptionsStore | m_optionsStore
| Persistent options store.
property_store_t | m_propertyStore
peripheral_descriptor_t | m_activePeripheral
| Descriptor for the active peripheral.
FileLogger * | m_logger
| Singleton logger instance.
Protected Attributes inherited from blfwk::Bootloader
Packetizer * | m_hostPacketizer
| Packet interface to send commands on.
FileLogger * | m_logger
| Singleton logger instance.

## Detailed Description

Represents the host bootloader.

This class provides a convenient way to access other bootloader framework objects.

## Member Function Documentation

MemoryStore* blfwk::Simulator::getMemoryStore | ( | int | index | ) | const

inline

Get a device state memory store.

index Index into memory map for the simulated device.

static Simulator& blfwk::Simulator::getSimulator | ( |  | ) |

inlinestatic

Get the singleton simulator object.

Singleton object.

bool Simulator::openStateFiles | ( | const std::string & | pathToDir,
|  | bool | forceCreate
| ) |  |

Configure and open state files.

Must be called to open or create state files.

Parameters

  pathToDir | Directory for state files.
  forceCreate | True to re-create state files even if they exist.

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

- Simulator.h
- Simulator.cpp