diff options
| author | 2016-04-06 00:17:00 +0200 | |
|---|---|---|
| committer | 2019-12-16 15:18:33 +0100 | |
| commit | 315cea700da438395c4d2b66e0af2b0b38a2b3d0 (patch) | |
| tree | 77971a3c0391f9a98e7614b1937766c5205a731f | |
| parent | 9f79242a441ce37c28db2b84d49621d26418dc53 (diff) | |
| download | libimobiledevice-315cea700da438395c4d2b66e0af2b0b38a2b3d0.tar.gz libimobiledevice-315cea700da438395c4d2b66e0af2b0b38a2b3d0.tar.bz2 | |
Define the flags for the diagnostics_relay_* methods in a diagnostics_relay_action_t enum
| -rw-r--r-- | include/libimobiledevice/diagnostics_relay.h | 12 | ||||
| -rw-r--r-- | src/diagnostics_relay.c | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/include/libimobiledevice/diagnostics_relay.h b/include/libimobiledevice/diagnostics_relay.h index 97ac363..d1d44c2 100644 --- a/include/libimobiledevice/diagnostics_relay.h +++ b/include/libimobiledevice/diagnostics_relay.h | |||
| @@ -42,9 +42,11 @@ typedef enum { | |||
| 42 | DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR = -256 | 42 | DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR = -256 |
| 43 | } diagnostics_relay_error_t; | 43 | } diagnostics_relay_error_t; |
| 44 | 44 | ||
| 45 | #define DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT (1 << 1) | 45 | typedef enum { |
| 46 | #define DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS (1 << 2) | 46 | DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT = 1 << 1, |
| 47 | #define DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL (1 << 3) | 47 | DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS = 1 << 2, |
| 48 | DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL = 1 << 3 | ||
| 49 | } diagnostics_relay_action_t; | ||
| 48 | 50 | ||
| 49 | #define DIAGNOSTICS_RELAY_REQUEST_TYPE_ALL "All" | 51 | #define DIAGNOSTICS_RELAY_REQUEST_TYPE_ALL "All" |
| 50 | #define DIAGNOSTICS_RELAY_REQUEST_TYPE_WIFI "WiFi" | 52 | #define DIAGNOSTICS_RELAY_REQUEST_TYPE_WIFI "WiFi" |
| @@ -136,7 +138,7 @@ diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t cli | |||
| 136 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | 138 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the |
| 137 | * request | 139 | * request |
| 138 | */ | 140 | */ |
| 139 | diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags); | 141 | diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags); |
| 140 | 142 | ||
| 141 | /** | 143 | /** |
| 142 | * Shutdown of the device and optionally show a user notification. | 144 | * Shutdown of the device and optionally show a user notification. |
| @@ -153,7 +155,7 @@ diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t c | |||
| 153 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | 155 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the |
| 154 | * request | 156 | * request |
| 155 | */ | 157 | */ |
| 156 | diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags); | 158 | diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags); |
| 157 | 159 | ||
| 158 | /** | 160 | /** |
| 159 | * Shutdown of the device and optionally show a user notification. | 161 | * Shutdown of the device and optionally show a user notification. |
diff --git a/src/diagnostics_relay.c b/src/diagnostics_relay.c index 0834700..3ac6058 100644 --- a/src/diagnostics_relay.c +++ b/src/diagnostics_relay.c | |||
| @@ -229,7 +229,7 @@ LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_sleep(diagnosti | |||
| 229 | return ret; | 229 | return ret; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_relay_client_t client, const char* name, int flags) | 232 | static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_relay_client_t client, const char* name, diagnostics_relay_action_t flags) |
| 233 | { | 233 | { |
| 234 | if (!client) | 234 | if (!client) |
| 235 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; | 235 | return DIAGNOSTICS_RELAY_E_INVALID_ARG; |
| @@ -273,12 +273,12 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r | |||
| 273 | return ret; | 273 | return ret; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags) | 276 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) |
| 277 | { | 277 | { |
| 278 | return internal_diagnostics_relay_action(client, "Restart", flags); | 278 | return internal_diagnostics_relay_action(client, "Restart", flags); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags) | 281 | LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) |
| 282 | { | 282 | { |
| 283 | return internal_diagnostics_relay_action(client, "Shutdown", flags); | 283 | return internal_diagnostics_relay_action(client, "Shutdown", flags); |
| 284 | } | 284 | } |
