mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Start Work on Firmware Update
This patch implements the first step towards OSTC 3 firmware update. Its not much, just file selection, but I will build up on it from there. Implements a thread to initiate firmware updates. Currently, this is for the OSTC 3. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
8aa7fddb22
commit
cc6c385f33
7 changed files with 94 additions and 14 deletions
|
@ -467,3 +467,35 @@ void WriteSettingsThread::run()
|
|||
emit error(lastError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FirmwareUpdateThread::FirmwareUpdateThread(QObject *parent, device_data_t *data, QString fileName)
|
||||
: QThread(parent), m_data(data), m_fileName(fileName)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FirmwareUpdateThread::run()
|
||||
{
|
||||
bool supported = false;
|
||||
dc_status_t rc;
|
||||
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
||||
if (rc == DC_STATUS_SUCCESS) {
|
||||
switch (dc_device_get_type(m_data->device)) {
|
||||
case DC_FAMILY_HW_OSTC3:
|
||||
supported = true;
|
||||
//hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
|
||||
break;
|
||||
}
|
||||
dc_device_close(m_data->device);
|
||||
|
||||
if (!supported) {
|
||||
lastError = tr("This feature is not yet available for the selected dive computer.");
|
||||
emit error(lastError);
|
||||
}
|
||||
}
|
||||
else {
|
||||
lastError = tr("Could not a establish connection to the dive computer.");
|
||||
emit error(lastError);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue