From 4a700758a6c422f3066728af035258ceaa472808 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Wed, 3 Mar 2021 14:46:18 +0100 Subject: [PATCH] ssm: Add getter for the device In some cases it can be useful to be able to retrieve the device. Add the corresponding getter to do so. --- doc/libfprint-2-sections.txt | 1 + libfprint/fpi-ssm.c | 16 ++++++++++++++++ libfprint/fpi-ssm.h | 1 + 3 files changed, 18 insertions(+) diff --git a/doc/libfprint-2-sections.txt b/doc/libfprint-2-sections.txt index adb4818..f245799 100644 --- a/doc/libfprint-2-sections.txt +++ b/doc/libfprint-2-sections.txt @@ -227,6 +227,7 @@ fpi_ssm_mark_completed fpi_ssm_mark_failed fpi_ssm_set_data fpi_ssm_get_data +fpi_ssm_get_device fpi_ssm_get_error fpi_ssm_dup_error fpi_ssm_get_cur_state diff --git a/libfprint/fpi-ssm.c b/libfprint/fpi-ssm.c index 6264d40..71c4e94 100644 --- a/libfprint/fpi-ssm.c +++ b/libfprint/fpi-ssm.c @@ -181,6 +181,22 @@ fpi_ssm_get_data (FpiSsm *machine) return machine->ssm_data; } +/** + * fpi_ssm_get_device: + * @machine: an #FpiSsm state machine + * + * Retrieve the device that the SSM is for. + * + * Returns: #FpDevice + */ +FpDevice * +fpi_ssm_get_device (FpiSsm *machine) +{ + g_return_val_if_fail (machine, NULL); + + return machine->dev; +} + static void fpi_ssm_clear_delayed_action (FpiSsm *machine) { diff --git a/libfprint/fpi-ssm.h b/libfprint/fpi-ssm.h index 0e18ab6..2c808ee 100644 --- a/libfprint/fpi-ssm.h +++ b/libfprint/fpi-ssm.h @@ -93,6 +93,7 @@ void fpi_ssm_set_data (FpiSsm *machine, gpointer ssm_data, GDestroyNotify ssm_data_destroy); gpointer fpi_ssm_get_data (FpiSsm *machine); +FpDevice * fpi_ssm_get_device (FpiSsm *machine); GError * fpi_ssm_get_error (FpiSsm *machine); GError * fpi_ssm_dup_error (FpiSsm *machine); int fpi_ssm_get_cur_state (FpiSsm *machine);