Add first draft
This commit is contained in:
32
DownloadDCFirmware/dc_download.h
Normal file
32
DownloadDCFirmware/dc_download.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef DC_DOWNLOAD_H_INCLUDED
|
||||
#define DC_DOWNLOAD_H_INCLUDED
|
||||
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
|
||||
class hwinf;
|
||||
class DcDownload {
|
||||
|
||||
public:
|
||||
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
|
||||
|
||||
DcDownload(hwinf *hw);
|
||||
~DcDownload();
|
||||
|
||||
void doDownload();
|
||||
|
||||
private:
|
||||
DownloadResult sendStatus(int ret) const;
|
||||
DownloadResult sendNextAddress(int bNum) const;
|
||||
DownloadResult sendNextDataBlock(QByteArray const &binary, int bNum) const;
|
||||
bool startBootloader() const;
|
||||
bool stopBootloader() const;
|
||||
QByteArray loadBinaryDCFile(QString dcFileName) const;
|
||||
bool resetDeviceController() const;
|
||||
DownloadResult dcDownloadBinary(QByteArray const &b) const;
|
||||
|
||||
hwinf *m_hw;
|
||||
QString m_fileToDownload;
|
||||
};
|
||||
|
||||
#endif // DOWNLOAD_THREAD_H_INCLUDED
|
Reference in New Issue
Block a user