From 315cea700da438395c4d2b66e0af2b0b38a2b3d0 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 6 Apr 2016 00:17:00 +0200 Subject: Define the flags for the diagnostics_relay_* methods in a diagnostics_relay_action_t enum --- include/libimobiledevice/diagnostics_relay.h | 12 +++++++----- 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 { DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR = -256 } diagnostics_relay_error_t; -#define DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT (1 << 1) -#define DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS (1 << 2) -#define DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL (1 << 3) +typedef enum { + DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT = 1 << 1, + DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS = 1 << 2, + DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL = 1 << 3 +} diagnostics_relay_action_t; #define DIAGNOSTICS_RELAY_REQUEST_TYPE_ALL "All" #define DIAGNOSTICS_RELAY_REQUEST_TYPE_WIFI "WiFi" @@ -136,7 +138,7 @@ diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t cli * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the * request */ -diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags); +diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags); /** * 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 * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the * request */ -diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags); +diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags); /** * 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 return ret; } -static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_relay_client_t client, const char* name, int flags) +static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_relay_client_t client, const char* name, diagnostics_relay_action_t flags) { if (!client) return DIAGNOSTICS_RELAY_E_INVALID_ARG; @@ -273,12 +273,12 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r return ret; } -LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags) +LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) { return internal_diagnostics_relay_action(client, "Restart", flags); } -LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags) +LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags) { return internal_diagnostics_relay_action(client, "Shutdown", flags); } -- cgit v1.1-32-gdbae