diff options
author | Rick Mark | 2021-12-24 01:10:18 -0800 |
---|---|---|
committer | Nikias Bassen | 2022-06-28 12:25:06 +0200 |
commit | ab5b4d8d4c0e90c05d80f80c7e99a6516de9b5c6 (patch) | |
tree | 792dd6b6fb4a9efdda541fe54b3d1c838bc9498b /src | |
parent | 17c02beca2f99b27dab5c1f83cfe4e33036e462b (diff) | |
download | libirecovery-ab5b4d8d4c0e90c05d80f80c7e99a6516de9b5c6.tar.gz libirecovery-ab5b4d8d4c0e90c05d80f80c7e99a6516de9b5c6.tar.bz2 |
Introduce non-persistent setenvnp command
Diffstat (limited to 'src')
-rw-r--r-- | src/libirecovery.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index a2ef567..8fbfce4 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -3114,6 +3114,30 @@ IRECV_API irecv_error_t irecv_setenv(irecv_client_t client, const char* variable #endif } +IRECV_API irecv_error_t irecv_setenv_np(irecv_client_t client, const char* variable, const char* value) { +#ifdef USE_DUMMY + return IRECV_E_UNSUPPORTED; +#else + char command[256]; + + if (check_context(client) != IRECV_E_SUCCESS) + return IRECV_E_NO_DEVICE; + + if(variable == NULL || value == NULL) { + return IRECV_E_UNKNOWN_ERROR; + } + + memset(command, '\0', sizeof(command)); + snprintf(command, sizeof(command)-1, "setenvnp %s %s", variable, value); + irecv_error_t error = irecv_send_command_raw(client, command, 0); + if(error != IRECV_E_SUCCESS) { + return error; + } + + return IRECV_E_SUCCESS; +#endif +} + IRECV_API irecv_error_t irecv_reboot(irecv_client_t client) { #ifdef USE_DUMMY return IRECV_E_UNSUPPORTED; |