summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-01-20 22:40:53 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-21 17:03:28 +1200
commitcbdaec4d9d22b85bbe22fd677fc7e01665d5c753 (patch)
tree535ac05c6b830a2942945602a9f434cac6e3e127 /configuredivecomputerthreads.cpp
parent724170f4b6840aaf65b07bbdb0975f350bdf171a (diff)
downloadsubsurface-cbdaec4d9d22b85bbe22fd677fc7e01665d5c753.tar.gz
Emit progress events from firmware updates
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r--configuredivecomputerthreads.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 2e69e539d..7dd9d1551 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -1545,8 +1545,15 @@ void FirmwareUpdateThread::run()
{
bool supported = false;
dc_status_t rc;
+
rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
+ rc = dc_device_set_events(m_data->device, DC_EVENT_PROGRESS, DeviceThread::event_cb, this);
+ if (rc != DC_STATUS_SUCCESS) {
+ emit error("Error registering the event handler.");
+ dc_device_close(m_data->device);
+ return;
+ }
switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0, 5, 0)
case DC_FAMILY_HW_OSTC3: