virtual-device: Refactor command handling and add CONT command

This command is useful to immediately continue rather than waiting for
input. It is only useful for non-scanning device actions and can be
important when steps need to be explicitly skipped (e.g. to inject an
error in the second command without a way to wait in between).
This commit is contained in:
Benjamin Berg
2021-04-29 17:48:55 +02:00
committed by Benjamin Berg
parent ae6be6837b
commit 992a207ede
3 changed files with 100 additions and 110 deletions
+7 -5
View File
@@ -99,11 +99,13 @@ struct _FpDeviceVirtualDeviceStorage
G_DECLARE_FINAL_TYPE (FpDeviceVirtualDeviceStorage, fpi_device_virtual_device_storage, FP, DEVICE_VIRTUAL_DEVICE_STORAGE, FpDeviceVirtualDevice)
char * process_cmds (FpDeviceVirtualDevice * self, gboolean scan, GError **error);
char * start_scan_command (FpDeviceVirtualDevice *self,
GError **error);
gboolean should_wait_for_command (FpDeviceVirtualDevice *self,
GError *error);
gboolean process_cmds (FpDeviceVirtualDevice * self,
gboolean scan,
char **scan_id,
GError **error);
gboolean start_scan_command (FpDeviceVirtualDevice *self,
char **scan_id,
GError **error);
gboolean should_wait_to_sleep (FpDeviceVirtualDevice *self,
const char *scan_id,
GError *error);