summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-09-26 22:44:54 +0200
committerGravatar Martin Szulecki2013-09-26 22:44:54 +0200
commitfc74c3e181fd5a279b960b6ecea73f04e075a2fc (patch)
tree6e746b2495f039dbfbbef3a24dfb82961745cddf
parent5877a05844fc3bd224dec206c54fe6633c671455 (diff)
downloadlibirecovery-fc74c3e181fd5a279b960b6ecea73f04e075a2fc.tar.gz
libirecovery-fc74c3e181fd5a279b960b6ecea73f04e075a2fc.tar.bz2
Add irecv_reboot() command helper which reboots the device
-rw-r--r--include/libirecovery.h1
-rw-r--r--src/libirecovery.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index efa6ff2..091c29b 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -223,6 +223,7 @@ irecv_error_t irecv_getret(irecv_client_t client, unsigned int* value);
irecv_error_t irecv_getenv(irecv_client_t client, const char* variable, char** value);
irecv_error_t irecv_setenv(irecv_client_t client, const char* variable, const char* value);
irecv_error_t irecv_set_interface(irecv_client_t client, int interface, int alt_interface);
+irecv_error_t irecv_reboot(irecv_client_t client);
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 f51ca3d..63bfecf 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -1322,6 +1322,14 @@ irecv_error_t irecv_setenv(irecv_client_t client, const char* variable, const ch
return IRECV_E_SUCCESS;
}
+irecv_error_t irecv_reboot(irecv_client_t client) {
+ irecv_error_t error = irecv_send_command_raw(client, "reboot");
+ if(error != IRECV_E_SUCCESS) {
+ return error;
+ }
+ return IRECV_E_SUCCESS;
+}
+
const char* irecv_strerror(irecv_error_t error) {
switch (error) {
case IRECV_E_SUCCESS: