diff options
Diffstat (limited to 'include/libimobiledevice/diagnostics_relay.h')
| -rw-r--r-- | include/libimobiledevice/diagnostics_relay.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/include/libimobiledevice/diagnostics_relay.h b/include/libimobiledevice/diagnostics_relay.h index 17e73dd..b25750b 100644 --- a/include/libimobiledevice/diagnostics_relay.h +++ b/include/libimobiledevice/diagnostics_relay.h | |||
| @@ -58,17 +58,128 @@ typedef int16_t diagnostics_relay_error_t; | |||
| 58 | typedef struct diagnostics_relay_client_private diagnostics_relay_client_private; | 58 | typedef struct diagnostics_relay_client_private diagnostics_relay_client_private; |
| 59 | typedef diagnostics_relay_client_private *diagnostics_relay_client_t; /**< The client handle. */ | 59 | typedef diagnostics_relay_client_private *diagnostics_relay_client_t; /**< The client handle. */ |
| 60 | 60 | ||
| 61 | /** | ||
| 62 | * Connects to the diagnostics_relay service on the specified device. | ||
| 63 | * | ||
| 64 | * @param device The device to connect to. | ||
| 65 | * @param service The service descriptor returned by lockdownd_start_service. | ||
| 66 | * @param client Reference that will point to a newly allocated | ||
| 67 | * diagnostics_relay_client_t upon successful return. | ||
| 68 | * | ||
| 69 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 70 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when one of the parameters is invalid, | ||
| 71 | * or DIAGNOSTICS_RELAY_E_MUX_ERROR when the connection failed. | ||
| 72 | */ | ||
| 61 | diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client); | 73 | diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client); |
| 74 | |||
| 75 | /** | ||
| 76 | * Starts a new diagnostics_relay service on the specified device and connects to it. | ||
| 77 | * | ||
| 78 | * @param device The device to connect to. | ||
| 79 | * @param client Pointer that will point to a newly allocated | ||
| 80 | * diagnostics_relay_client_t upon successful return. Must be freed using | ||
| 81 | * diagnostics_relay_client_free() after use. | ||
| 82 | * @param label The label to use for communication. Usually the program name. | ||
| 83 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 84 | * | ||
| 85 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, or an DIAGNOSTICS_RELAY_E_* error | ||
| 86 | * code otherwise. | ||
| 87 | */ | ||
| 62 | diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t* client, const char* label); | 88 | diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t* client, const char* label); |
| 89 | |||
| 90 | /** | ||
| 91 | * Disconnects a diagnostics_relay client from the device and frees up the | ||
| 92 | * diagnostics_relay client data. | ||
| 93 | * | ||
| 94 | * @param client The diagnostics_relay client to disconnect and free. | ||
| 95 | * | ||
| 96 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 97 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when one of client or client->parent | ||
| 98 | * is invalid, or DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR when the was an | ||
| 99 | * error freeing the parent property_list_service client. | ||
| 100 | */ | ||
| 63 | diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client); | 101 | diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client); |
| 64 | 102 | ||
| 103 | |||
| 104 | /** | ||
| 105 | * Sends the Goodbye request signaling the end of communication. | ||
| 106 | * | ||
| 107 | * @param client The diagnostics_relay client | ||
| 108 | * | ||
| 109 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 110 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL, | ||
| 111 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | ||
| 112 | * request | ||
| 113 | */ | ||
| 65 | diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client); | 114 | diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client); |
| 115 | |||
| 116 | /** | ||
| 117 | * Puts the device into deep sleep mode and disconnects from host. | ||
| 118 | * | ||
| 119 | * @param client The diagnostics_relay client | ||
| 120 | * | ||
| 121 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 122 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL, | ||
| 123 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | ||
| 124 | * request | ||
| 125 | */ | ||
| 66 | diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client); | 126 | diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client); |
| 127 | |||
| 128 | /** | ||
| 129 | * Restart the device and optionally show a user notification. | ||
| 130 | * | ||
| 131 | * @param client The diagnostics_relay client | ||
| 132 | * @param flags A binary flag combination of | ||
| 133 | * DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT to wait until | ||
| 134 | * diagnostics_relay_client_free() disconnects before execution and | ||
| 135 | * DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL to show a "FAIL" dialog | ||
| 136 | * or DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS to show an "OK" dialog | ||
| 137 | * | ||
| 138 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 139 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL, | ||
| 140 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | ||
| 141 | * request | ||
| 142 | */ | ||
| 67 | diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags); | 143 | diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, int flags); |
| 144 | |||
| 145 | /** | ||
| 146 | * Shutdown of the device and optionally show a user notification. | ||
| 147 | * | ||
| 148 | * @param client The diagnostics_relay client | ||
| 149 | * @param flags A binary flag combination of | ||
| 150 | * DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT to wait until | ||
| 151 | * diagnostics_relay_client_free() disconnects before execution and | ||
| 152 | * DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL to show a "FAIL" dialog | ||
| 153 | * or DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS to show an "OK" dialog | ||
| 154 | * | ||
| 155 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 156 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL, | ||
| 157 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | ||
| 158 | * request | ||
| 159 | */ | ||
| 68 | diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags); | 160 | diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, int flags); |
| 161 | |||
| 162 | /** | ||
| 163 | * Shutdown of the device and optionally show a user notification. | ||
| 164 | * | ||
| 165 | * @param client The diagnostics_relay client | ||
| 166 | * @param flags A binary flag combination of | ||
| 167 | * DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT to wait until | ||
| 168 | * diagnostics_relay_client_free() disconnects before execution and | ||
| 169 | * DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL to show a "FAIL" dialog | ||
| 170 | * or DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS to show an "OK" dialog | ||
| 171 | * | ||
| 172 | * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, | ||
| 173 | * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL, | ||
| 174 | * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the | ||
| 175 | * request | ||
| 176 | */ | ||
| 69 | diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics); | 177 | diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics); |
| 178 | |||
| 70 | diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result); | 179 | diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result); |
| 180 | |||
| 71 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* name, const char* class, plist_t* result); | 181 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* name, const char* class, plist_t* result); |
| 182 | |||
| 72 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result); | 183 | diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result); |
| 73 | 184 | ||
| 74 | #ifdef __cplusplus | 185 | #ifdef __cplusplus |
