Added functionality for actually downloading a real dc.
This commit is contained in:
		@@ -3,12 +3,15 @@
 | 
			
		||||
 | 
			
		||||
#include <QThread>
 | 
			
		||||
#include <QString>
 | 
			
		||||
#include <QByteArray>
 | 
			
		||||
 | 
			
		||||
class hwinf;
 | 
			
		||||
class DownloadThread : public QThread {
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
 | 
			
		||||
 | 
			
		||||
    DownloadThread(hwinf *hw);
 | 
			
		||||
    ~DownloadThread();
 | 
			
		||||
 | 
			
		||||
@@ -18,6 +21,15 @@ protected:
 | 
			
		||||
    void run() override;
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user