virtual-device: Wait for delayed commands to be processed

This allows to mimick the image device better, so that we can start an
operation and send the commands within some delay.
This commit is contained in:
Marco Trevisan (Treviño)
2021-01-24 01:15:19 +01:00
parent 89890dbd1f
commit ce9527d2cb
3 changed files with 79 additions and 11 deletions
@@ -76,6 +76,8 @@ struct _FpDeviceVirtualDevice
GPtrArray *pending_commands;
GHashTable *prints_storage;
guint wait_command_id;
};
/* Not really final here, but we can do this to share the FpDeviceVirtualDevice
@@ -91,3 +93,5 @@ G_DECLARE_FINAL_TYPE (FpDeviceVirtualDeviceStorage, fpi_device_virtual_device_st
char * process_cmds (FpDeviceVirtualDevice * self, gboolean scan, GError **error);
gboolean should_wait_for_command (FpDeviceVirtualDevice *self,
GError *error);