libdfu: Correctly implement auto-boot in dfu_device_download()

This commit is contained in:
Richard Hughes 2015-11-16 11:46:36 +00:00
parent dc3ddc18d3
commit b5936f9eef
2 changed files with 8 additions and 0 deletions

View File

@ -822,6 +822,13 @@ dfu_device_download (DfuDevice *device,
g_debug ("booting to runtime to set auto-boot");
if (!dfu_device_wait_for_replug (device, 2000, cancellable, error))
return FALSE;
target_default = dfu_device_get_target_default (device, error);
if (target_default == NULL)
return FALSE;
if (!dfu_target_open (target_default,
DFU_TARGET_OPEN_FLAG_NONE,
NULL, error))
return FALSE;
}
/* auto-close */

View File

@ -1088,6 +1088,7 @@ dfu_tool_download (DfuToolPrivate *priv, gchar **values, GError **error)
/* optional reset */
if (priv->reset) {
flags |= DFU_TARGET_TRANSFER_FLAG_DETACH;
flags |= DFU_TARGET_TRANSFER_FLAG_HOST_RESET;
flags |= DFU_TARGET_TRANSFER_FLAG_BOOT_RUNTIME;
}