Manage interactions with an aseba-compatible bootloader. More...
#include <BootloaderInterface.h>
Classes | |
struct | Error |
An error in link with the bootloader. More... | |
Public Member Functions | |
BootloaderInterface (Dashel::Stream *stream, int dest) | |
Create an interface to bootloader with id dest using a socket. | |
int | getPageSize () const |
Return the size of a page. | |
void | readHex (const std::string &fileName) |
Read an hex file and write it to fileName. | |
bool | readPage (unsigned pageNumber, uint8 *data) |
Read a page. | |
bool | readPageSimple (unsigned pageNumber, uint8 *data) |
Read a page, simplified protocol. | |
void | writeHex (const std::string &fileName, bool reset, bool simple) |
Write an hex file. | |
bool | writePage (unsigned pageNumber, const uint8 *data, bool simple) |
Write a page, if simple is true, use simplified protocol, otherwise use complete protocol. | |
Protected Member Functions | |
virtual void | errorWritePageNonFatal (unsigned pageNumber) |
Warn about an error but do not quit. | |
virtual void | writeHexEnteringBootloader () |
virtual void | writeHexExitingBootloader () |
virtual void | writeHexGotDescription (unsigned pagesCount) |
virtual void | writeHexStart (const std::string &fileName, bool reset, bool simple) |
virtual void | writeHexWritten () |
virtual void | writePageFailure () |
virtual void | writePageStart (unsigned pageNumber, const uint8 *data, bool simple) |
virtual void | writePageSuccess () |
virtual void | writePageWaitAck () |
Protected Attributes | |
int | dest |
unsigned | pagesCount |
unsigned | pageSize |
unsigned | pagesStart |
Dashel::Stream * | stream |
Manage interactions with an aseba-compatible bootloader.
There are two versions of the bootloader: the complete and the simple. The complete version works on any Aseba network including over switches as it transmits all data using the Aseba message protocol. The simple version requires direct access to the device to be flashed, because it breaks the Aseba message protocol for page transmission.
Definition at line 46 of file BootloaderInterface.h.
Aseba::BootloaderInterface::BootloaderInterface | ( | Dashel::Stream * | stream, |
int | dest | ||
) |
Create an interface to bootloader with id dest using a socket.
Definition at line 36 of file BootloaderInterface.cpp.
virtual void Aseba::BootloaderInterface::errorWritePageNonFatal | ( | unsigned | pageNumber | ) | [inline, protected, virtual] |
Warn about an error but do not quit.
Reimplemented in Aseba::CmdBootloaderInterface, and Aseba::QtBootloaderInterface.
Definition at line 97 of file BootloaderInterface.h.
int Aseba::BootloaderInterface::getPageSize | ( | ) | const [inline] |
Return the size of a page.
Definition at line 62 of file BootloaderInterface.h.
void Aseba::BootloaderInterface::readHex | ( | const std::string & | fileName | ) |
Read an hex file and write it to fileName.
Definition at line 340 of file BootloaderInterface.cpp.
bool Aseba::BootloaderInterface::readPage | ( | unsigned | pageNumber, |
uint8 * | data | ||
) |
Read a page.
Definition at line 46 of file BootloaderInterface.cpp.
bool Aseba::BootloaderInterface::readPageSimple | ( | unsigned | pageNumber, |
uint8 * | data | ||
) |
Read a page, simplified protocol.
Definition at line 97 of file BootloaderInterface.cpp.
void Aseba::BootloaderInterface::writeHex | ( | const std::string & | fileName, |
bool | reset, | ||
bool | simple | ||
) |
Write an hex file.
Definition at line 207 of file BootloaderInterface.cpp.
virtual void Aseba::BootloaderInterface::writeHexEnteringBootloader | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 89 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writeHexExitingBootloader | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 92 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writeHexGotDescription | ( | unsigned | pagesCount | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface, and Aseba::QtBootloaderInterface.
Definition at line 90 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writeHexStart | ( | const std::string & | fileName, |
bool | reset, | ||
bool | simple | ||
) | [inline, protected, virtual] |
Definition at line 88 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writeHexWritten | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 91 of file BootloaderInterface.h.
bool Aseba::BootloaderInterface::writePage | ( | unsigned | pageNumber, |
const uint8 * | data, | ||
bool | simple | ||
) |
Write a page, if simple is true, use simplified protocol, otherwise use complete protocol.
Definition at line 109 of file BootloaderInterface.cpp.
virtual void Aseba::BootloaderInterface::writePageFailure | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 86 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writePageStart | ( | unsigned | pageNumber, |
const uint8 * | data, | ||
bool | simple | ||
) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface, and Aseba::QtBootloaderInterface.
Definition at line 83 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writePageSuccess | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 85 of file BootloaderInterface.h.
virtual void Aseba::BootloaderInterface::writePageWaitAck | ( | ) | [inline, protected, virtual] |
Reimplemented in Aseba::CmdBootloaderInterface.
Definition at line 84 of file BootloaderInterface.h.
int Aseba::BootloaderInterface::dest [protected] |
Definition at line 102 of file BootloaderInterface.h.
unsigned Aseba::BootloaderInterface::pagesCount [protected] |
Reimplemented in Aseba::QtBootloaderInterface.
Definition at line 105 of file BootloaderInterface.h.
unsigned Aseba::BootloaderInterface::pageSize [protected] |
Definition at line 103 of file BootloaderInterface.h.
unsigned Aseba::BootloaderInterface::pagesStart [protected] |
Definition at line 104 of file BootloaderInterface.h.
Dashel::Stream* Aseba::BootloaderInterface::stream [protected] |
Definition at line 101 of file BootloaderInterface.h.