diff --git a/plugins/wacomhid/fu-wac-device.c b/plugins/wacomhid/fu-wac-device.c index 3a4a53fc0..d25ca5876 100644 --- a/plugins/wacomhid/fu-wac-device.c +++ b/plugins/wacomhid/fu-wac-device.c @@ -547,6 +547,7 @@ fu_wac_device_write_firmware (FuDevice *device, GBytes *blob, GError **error) return FALSE; /* clear all checksums of pages */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_ERASE); for (guint16 i = 0; i < self->flash_descriptors->len; i++) { FuWacFlashDescriptor *fd = g_ptr_array_index (self->flash_descriptors, i); if (fu_wav_device_flash_descriptor_is_wp (fd)) @@ -579,6 +580,7 @@ fu_wac_device_write_firmware (FuDevice *device, GBytes *blob, GError **error) blocks_total = g_hash_table_size (fd_blobs) + 2; /* write the data into the flash page */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_WRITE); csum_local = g_new0 (guint32, self->flash_descriptors->len); for (guint16 i = 0; i < self->flash_descriptors->len; i++) { FuWacFlashDescriptor *fd = g_ptr_array_index (self->flash_descriptors, i); @@ -617,9 +619,7 @@ fu_wac_device_write_firmware (FuDevice *device, GBytes *blob, GError **error) return FALSE; /* update device progress */ - fu_device_set_progress_full (FU_DEVICE (self), - blocks_done++, - blocks_total); + fu_device_set_progress_full (device, blocks_done++, blocks_total); } /* calculate CRC inside device */ @@ -629,7 +629,7 @@ fu_wac_device_write_firmware (FuDevice *device, GBytes *blob, GError **error) } /* update device progress */ - fu_device_set_progress_full (FU_DEVICE (self), blocks_done++, blocks_total); + fu_device_set_progress_full (device, blocks_done++, blocks_total); /* read all CRC of all pages and verify with local CRC */ if (!fu_wac_device_ensure_checksums (self, error)) @@ -661,16 +661,17 @@ fu_wac_device_write_firmware (FuDevice *device, GBytes *blob, GError **error) } /* update device progress */ - fu_device_set_progress_full (FU_DEVICE (self), blocks_done++, blocks_total); + fu_device_set_progress_full (device, blocks_done++, blocks_total); /* store host CRC into flash */ if (!fu_wac_device_write_checksum_table (self, error)) return FALSE; /* update progress */ - fu_device_set_progress_full (FU_DEVICE (self), blocks_total, blocks_total); + fu_device_set_progress_full (device, blocks_total, blocks_total); /* reboot, which switches the boot index of the firmware */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_RESTART); return fu_wac_device_update_reset (self, error); } diff --git a/plugins/wacomhid/fu-wac-module-bluetooth.c b/plugins/wacomhid/fu-wac-module-bluetooth.c index 6decbf916..651c8b2e2 100644 --- a/plugins/wacomhid/fu-wac-module-bluetooth.c +++ b/plugins/wacomhid/fu-wac-module-bluetooth.c @@ -125,6 +125,7 @@ fu_wac_module_bluetooth_write_firmware (FuDevice *device, GBytes *blob, GError * blocks_total = blocks->len + 2; /* start, which will erase the module */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_ERASE); if (!fu_wac_module_set_feature (self, FU_WAC_MODULE_COMMAND_START, blob_start, error)) return FALSE; @@ -132,6 +133,7 @@ fu_wac_module_bluetooth_write_firmware (FuDevice *device, GBytes *blob, GError * fu_device_set_progress_full (device, 1, blocks_total); /* data */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_WRITE); for (guint i = 0; i < blocks->len; i++) { FuWacModuleBluetoothBlockData *bd = g_ptr_array_index (blocks, i); guint8 buf[256+11]; @@ -160,7 +162,7 @@ fu_wac_module_bluetooth_write_firmware (FuDevice *device, GBytes *blob, GError * fu_device_set_progress_full (device, blocks_total, blocks_total); /* reboot */ - fu_device_set_status (FU_DEVICE (self), FWUPD_STATUS_DEVICE_RESTART); + fu_device_set_status (device, FWUPD_STATUS_DEVICE_RESTART); return fu_wac_device_update_reset (parent, error); } diff --git a/plugins/wacomhid/fu-wac-module-touch.c b/plugins/wacomhid/fu-wac-module-touch.c index 416505c53..16a725229 100644 --- a/plugins/wacomhid/fu-wac-module-touch.c +++ b/plugins/wacomhid/fu-wac-module-touch.c @@ -47,6 +47,7 @@ fu_wac_module_touch_write_firmware (FuDevice *device, GBytes *blob, GError **err blocks_total = chunks->len + 2; /* start, which will erase the module */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_ERASE); if (!fu_wac_module_set_feature (self, FU_WAC_MODULE_COMMAND_START, NULL, error)) return FALSE; @@ -54,6 +55,7 @@ fu_wac_module_touch_write_firmware (FuDevice *device, GBytes *blob, GError **err fu_device_set_progress_full (device, 1, blocks_total); /* data */ + fu_device_set_status (device, FWUPD_STATUS_DEVICE_WRITE); for (guint i = 0; i < chunks->len; i++) { DfuChunkedPacket *pkt = g_ptr_array_index (chunks, i); guint8 buf[128+7]; @@ -82,7 +84,7 @@ fu_wac_module_touch_write_firmware (FuDevice *device, GBytes *blob, GError **err fu_device_set_progress_full (device, blocks_total, blocks_total); /* reboot */ - fu_device_set_status (FU_DEVICE (self), FWUPD_STATUS_DEVICE_RESTART); + fu_device_set_status (device, FWUPD_STATUS_DEVICE_RESTART); return fu_wac_device_update_reset (parent, error); }