OSTC Companion
3.0
Companion sofftware for H&W dive computers
|
Read .hex file in "Intel HEX" format. More...
#include <HexFile.h>
Public Member Functions | |
HexFile () | |
Create an empty object. More... | |
~HexFile () | |
bool | allocate (size_t memSize, unsigned char fill=0xFF) |
Allocate initialized space. More... | |
bool | sqwiz (size_t newMemSize) |
void | load (const QString &fileName) |
Load the .hex file into the internal buffer. More... | |
const unsigned char * | data () const |
Return a pointer to the loaded data. More... | |
unsigned int | checksum () const |
Returns the 4 bytes checksum of the loaded data. More... | |
void | saveEncrypted (const QString &fileName, unsigned char secretKey[16]) |
Save to encrypted HEX file. More... | |
void | loadEncrypted (const QString &fileName, unsigned char secretKey[16]) |
Reload encrypted HEX file. More... | |
Read .hex file in "Intel HEX" format.
HexFile::HexFile | ( | ) |
Create an empty object.
HexFile::~HexFile | ( | ) |
bool HexFile::allocate | ( | size_t | memSize, |
unsigned char | fill = 0xFF |
||
) |
Allocate initialized space.
unsigned int HexFile::checksum | ( | ) | const |
Returns the 4 bytes checksum of the loaded data.
This is a simple Adler32 checksum: The lower 16bits are the sum of all the bytes (modulo 65536). And the second 16bits are the sum of the running sum itself (also modulo 65536).
const unsigned char * HexFile::data | ( | ) | const |
Return a pointer to the loaded data.
void HexFile::load | ( | const QString & | fileName | ) |
Load the .hex file into the internal buffer.
void HexFile::loadEncrypted | ( | const QString & | fileName, |
unsigned char | secretKey[16] | ||
) |
Reload encrypted HEX file.
void HexFile::saveEncrypted | ( | const QString & | fileName, |
unsigned char | secretKey[16] | ||
) |
Save to encrypted HEX file.
bool HexFile::sqwiz | ( | size_t | newMemSize | ) |