From c84fb716cd998118c95fb59a8ba4d3e26a673749 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 27 Sep 2013 02:20:09 +0200 Subject: libirecovery: Provide helper to get current device mode --- src/libirecovery.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libirecovery.c') diff --git a/src/libirecovery.c b/src/libirecovery.c index 3bd57df..e81ed2e 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -1205,6 +1205,15 @@ irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value) { return IRECV_E_SUCCESS; } +irecv_error_t irecv_get_mode(irecv_client_t client, int* mode) { + if (check_context(client) != IRECV_E_SUCCESS) + return IRECV_E_NO_DEVICE; + + *mode = client->mode; + + return IRECV_E_SUCCESS; +} + irecv_error_t irecv_get_cpid(irecv_client_t client, unsigned int* cpid) { if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; -- cgit v1.1-32-gdbae