summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/service.h
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2014-03-27 10:07:09 -0400
committerGravatar Aaron Burghardt2014-03-27 21:40:43 -0400
commit2342dc5b4ef148b993fbe3816f3facdef8365546 (patch)
tree69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /include/libimobiledevice/service.h
parentee82e861a8c942b5013accd7589cf898d1f97167 (diff)
downloadlibimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz
libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2
Moved Doxygen comments from source files to public headers.
Conflicts: include/libimobiledevice/afc.h
Diffstat (limited to 'include/libimobiledevice/service.h')
-rw-r--r--include/libimobiledevice/service.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/include/libimobiledevice/service.h b/include/libimobiledevice/service.h
index 6585fe7..acf846b 100644
--- a/include/libimobiledevice/service.h
+++ b/include/libimobiledevice/service.h
@@ -49,15 +49,120 @@ typedef service_client_private* service_client_t; /**< The client handle. */
49#define SERVICE_CONSTRUCTOR(x) (int16_t (*)(idevice_t, lockdownd_service_descriptor_t, void**))(x) 49#define SERVICE_CONSTRUCTOR(x) (int16_t (*)(idevice_t, lockdownd_service_descriptor_t, void**))(x)
50 50
51/* Interface */ 51/* Interface */
52
53/**
54 * Creates a new service for the specified service descriptor.
55 *
56 * @param device The device to connect to.
57 * @param service The service descriptor returned by lockdownd_start_service.
58 * @param client Pointer that will be set to a newly allocated
59 * service_client_t upon successful return.
60 *
61 * @return SERVICE_E_SUCCESS on success,
62 * SERVICE_E_INVALID_ARG when one of the arguments is invalid,
63 * or SERVICE_E_MUX_ERROR when connecting to the device failed.
64 */
52service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client); 65service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client);
66
67/**
68 * Starts a new service on the specified device with given name and
69 * connects to it.
70 *
71 * @param device The device to connect to.
72 * @param service_name The name of the service to start.
73 * @param client Pointer that will point to a newly allocated service_client_t
74 * upon successful return. Must be freed using service_client_free() after
75 * use.
76 * @param label The label to use for communication. Usually the program name.
77 * Pass NULL to disable sending the label in requests to lockdownd.
78 *
79 * @return SERVICE_E_SUCCESS on success, or a SERVICE_E_* error code
80 * otherwise.
81 */
53service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code); 82service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code);
83
84/**
85 * Frees a service instance.
86 *
87 * @param client The service instance to free.
88 *
89 * @return SERVICE_E_SUCCESS on success,
90 * SERVICE_E_INVALID_ARG when client is invalid, or a
91 * SERVICE_E_UNKNOWN_ERROR when another error occured.
92 */
54service_error_t service_client_free(service_client_t client); 93service_error_t service_client_free(service_client_t client);
55 94
95
96/**
97 * Sends data using the given service client.
98 *
99 * @param client The service client to use for sending.
100 * @param data Data to send
101 * @param size Size of the data to send
102 * @param sent Number of bytes sent (can be NULL to ignore)
103 *
104 * @return SERVICE_E_SUCCESS on success,
105 * SERVICE_E_INVALID_ARG when one or more parameters are
106 * invalid, or SERVICE_E_UNKNOWN_ERROR when an unspecified
107 * error occurs.
108 */
56service_error_t service_send(service_client_t client, const char *data, uint32_t size, uint32_t *sent); 109service_error_t service_send(service_client_t client, const char *data, uint32_t size, uint32_t *sent);
110
111/**
112 * Receives data using the given service client with specified timeout.
113 *
114 * @param client The service client to use for receiving
115 * @param data Buffer that will be filled with the data received
116 * @param size Number of bytes to receive
117 * @param received Number of bytes received (can be NULL to ignore)
118 * @param timeout Maximum time in milliseconds to wait for data.
119 *
120 * @return SERVICE_E_SUCCESS on success,
121 * SERVICE_E_INVALID_ARG when one or more parameters are
122 * invalid, SERVICE_E_MUX_ERROR when a communication error
123 * occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified
124 * error occurs.
125 */
57service_error_t service_receive_with_timeout(service_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout); 126service_error_t service_receive_with_timeout(service_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout);
127
128/**
129 * Receives data using the given service client.
130 *
131 * @param client The service client to use for receiving
132 * @param data Buffer that will be filled with the data received
133 * @param size Number of bytes to receive
134 * @param received Number of bytes received (can be NULL to ignore)
135 *
136 * @return SERVICE_E_SUCCESS on success,
137 * SERVICE_E_INVALID_ARG when one or more parameters are
138 * invalid, SERVICE_E_MUX_ERROR when a communication error
139 * occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified
140 * error occurs.
141 */
58service_error_t service_receive(service_client_t client, char *data, uint32_t size, uint32_t *received); 142service_error_t service_receive(service_client_t client, char *data, uint32_t size, uint32_t *received);
59 143
144
145/**
146 * Enable SSL for the given service client.
147 *
148 * @param client The connected service client for that SSL should be enabled.
149 *
150 * @return SERVICE_E_SUCCESS on success,
151 * SERVICE_E_INVALID_ARG if client or client->connection is
152 * NULL, SERVICE_E_SSL_ERROR when SSL could not be enabled,
153 * or SERVICE_E_UNKNOWN_ERROR otherwise.
154 */
60service_error_t service_enable_ssl(service_client_t client); 155service_error_t service_enable_ssl(service_client_t client);
156
157/**
158 * Disable SSL for the given service client.
159 *
160 * @param client The connected service client for that SSL should be disabled.
161 *
162 * @return SERVICE_E_SUCCESS on success,
163 * SERVICE_E_INVALID_ARG if client or client->connection is
164 * NULL, or SERVICE_E_UNKNOWN_ERROR otherwise.
165 */
61service_error_t service_disable_ssl(service_client_t client); 166service_error_t service_disable_ssl(service_client_t client);
62 167
63#ifdef __cplusplus 168#ifdef __cplusplus