Automatic OSTC firmware update: download file and try to install

This successfully downloads the hex file.
The actuall update of the OSTC fails before it gets started with a crash
when the ConfigureDiveComputer object is created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-12-28 10:22:46 -08:00
parent 0be0cdb046
commit 003f5d18b6
3 changed files with 73 additions and 23 deletions

View file

@ -7,7 +7,7 @@
#include "../libdivecomputer.h"
#include "configuredivecomputer.h"
#include <QStyledItemDelegate>
#include <QWebPage>
#include <QNetworkAccessManager>
class GasSpinBoxItemDelegate : public QStyledItemDelegate
{
@ -107,13 +107,19 @@ class OstcFirmwareCheck : QObject
Q_OBJECT
public:
explicit OstcFirmwareCheck(QString product);
void checkLatest(QWidget *parent, uint32_t firmwareOnDevice);
void checkLatest(QWidget *parent, device_data_t *data);
public
slots:
void parseOstcFwVersion();
void parseOstcFwVersion(QNetworkReply *reply);
void saveOstcFirmware(QNetworkReply * reply);
private:
QWebPage hwVersionPage;
void upgradeFirmware();
device_data_t devData;
QString latestFirmwareAvailable;
QString latestFirmwareHexFile;
QString storeFirmware;
QWidget *parent;
QNetworkAccessManager manager;
};
#endif // CONFIGUREDIVECOMPUTERDIALOG_H