diff options
-rw-r--r-- | include/libirecovery.h | 1 | ||||
-rw-r--r-- | src/libirecovery.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index 595c7cb..09898bb 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h @@ -123,6 +123,7 @@ irecv_error_t irecv_reboot(irecv_client_t client); irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value); /* device information */ +irecv_error_t irecv_get_mode(irecv_client_t client, int* mode); irecv_error_t irecv_get_cpid(irecv_client_t client, unsigned int* cpid); irecv_error_t irecv_get_bdid(irecv_client_t client, unsigned int* bdid); irecv_error_t irecv_get_ecid(irecv_client_t client, unsigned long long* ecid); 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; |