From 0e732dbafa8927b310fa06b17075ed438dfda27f Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 21 Sep 2020 18:00:04 +0200 Subject: [PATCH] ssm: Add API to get device This can be useful in some cases and it was simply missing. --- libfprint/fpi-ssm.c | 14 ++++++++++++++ libfprint/fpi-ssm.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/libfprint/fpi-ssm.c b/libfprint/fpi-ssm.c index 6264d40..84239e1 100644 --- a/libfprint/fpi-ssm.c +++ b/libfprint/fpi-ssm.c @@ -617,6 +617,20 @@ fpi_ssm_jump_to_state_delayed (FpiSsm *machine, g_source_set_name (machine->timeout, source_name); } +/** + * fpi_ssm_get_device: + * @machine: an #FpiSsm state machine + * + * Returns the device that the SSM has been associated with. + * + * Returns: (transfer none): the #FpDevice. + */ +FpDevice* +fpi_ssm_get_device (FpiSsm *machine) +{ + return machine->dev; +} + /** * fpi_ssm_get_cur_state: * @machine: an #FpiSsm state machine diff --git a/libfprint/fpi-ssm.h b/libfprint/fpi-ssm.h index 0e18ab6..f8626c9 100644 --- a/libfprint/fpi-ssm.h +++ b/libfprint/fpi-ssm.h @@ -92,6 +92,8 @@ void fpi_ssm_mark_failed (FpiSsm *machine, void fpi_ssm_set_data (FpiSsm *machine, gpointer ssm_data, GDestroyNotify ssm_data_destroy); + +FpDevice * fpi_ssm_get_device (FpiSsm *machine); gpointer fpi_ssm_get_data (FpiSsm *machine); GError * fpi_ssm_get_error (FpiSsm *machine); GError * fpi_ssm_dup_error (FpiSsm *machine);