diff options
| author | 2010-03-05 16:27:07 +0100 | |
|---|---|---|
| committer | 2010-03-08 21:08:07 -0800 | |
| commit | 77aa0b3c5b4fc6cff147e98a2130dd11204b40ad (patch) | |
| tree | fecc02a1721d32a1188dcfd7af8a7601bbc2b63c /src/notification_proxy.c | |
| parent | 32b65dea4abc416320a97b8b7a438b90b2d449b0 (diff) | |
| download | libimobiledevice-77aa0b3c5b4fc6cff147e98a2130dd11204b40ad.tar.gz libimobiledevice-77aa0b3c5b4fc6cff147e98a2130dd11204b40ad.tar.bz2 | |
notification_proxy: docs updated
Diffstat (limited to 'src/notification_proxy.c')
| -rw-r--r-- | src/notification_proxy.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index eb5e6b2..827468e 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * notification_proxy.c | 2 | * notification_proxy.c |
| 3 | * Notification Proxy implementation. | 3 | * com.apple.mobile.notification_proxy service implementation. |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2009 Nikias Bassen, All Rights Reserved. | 5 | * Copyright (c) 2009 Nikias Bassen, All Rights Reserved. |
| 6 | * | 6 | * |
| @@ -35,9 +35,10 @@ struct np_thread { | |||
| 35 | np_notify_cb_t cbfunc; | 35 | np_notify_cb_t cbfunc; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | /** Locks an NP client, done for thread safety stuff. | 38 | /** |
| 39 | * Locks a notification_proxy client, used for thread safety. | ||
| 39 | * | 40 | * |
| 40 | * @param client The NP | 41 | * @param client notification_proxy client to lock |
| 41 | */ | 42 | */ |
| 42 | static void np_lock(np_client_t client) | 43 | static void np_lock(np_client_t client) |
| 43 | { | 44 | { |
| @@ -45,9 +46,10 @@ static void np_lock(np_client_t client) | |||
| 45 | g_mutex_lock(client->mutex); | 46 | g_mutex_lock(client->mutex); |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | /** Unlocks an NP client, done for thread safety stuff. | 49 | /** |
| 50 | * Unlocks a notification_proxy client, used for thread safety. | ||
| 49 | * | 51 | * |
| 50 | * @param client The NP | 52 | * @param client notification_proxy client to unlock |
| 51 | */ | 53 | */ |
| 52 | static void np_unlock(np_client_t client) | 54 | static void np_unlock(np_client_t client) |
| 53 | { | 55 | { |
| @@ -81,7 +83,8 @@ static np_error_t np_error(property_list_service_error_t err) | |||
| 81 | return NP_E_UNKNOWN_ERROR; | 83 | return NP_E_UNKNOWN_ERROR; |
| 82 | } | 84 | } |
| 83 | 85 | ||
| 84 | /** Makes a connection to the NP service on the phone. | 86 | /** |
| 87 | * Connects to the notification_proxy on the specified device. | ||
| 85 | * | 88 | * |
| 86 | * @param device The device to connect to. | 89 | * @param device The device to connect to. |
| 87 | * @param port Destination port (usually given by lockdownd_start_service). | 90 | * @param port Destination port (usually given by lockdownd_start_service). |
| @@ -117,9 +120,11 @@ np_error_t np_client_new(idevice_t device, uint16_t port, np_client_t *client) | |||
| 117 | return NP_E_SUCCESS; | 120 | return NP_E_SUCCESS; |
| 118 | } | 121 | } |
| 119 | 122 | ||
| 120 | /** Disconnects an NP client from the device. | 123 | /** |
| 124 | * Disconnects a notification_proxy client from the device and frees up the | ||
| 125 | * notification_proxy client data. | ||
| 121 | * | 126 | * |
| 122 | * @param client The client to disconnect. | 127 | * @param client The notification_proxy client to disconnect and free. |
| 123 | * | 128 | * |
| 124 | * @return NP_E_SUCCESS on success, or NP_E_INVALID_ARG when client is NULL. | 129 | * @return NP_E_SUCCESS on success, or NP_E_INVALID_ARG when client is NULL. |
| 125 | */ | 130 | */ |
| @@ -142,7 +147,8 @@ np_error_t np_client_free(np_client_t client) | |||
| 142 | return NP_E_SUCCESS; | 147 | return NP_E_SUCCESS; |
| 143 | } | 148 | } |
| 144 | 149 | ||
| 145 | /** Sends a notification to the device's Notification Proxy. | 150 | /** |
| 151 | * Sends a notification to the device's notification_proxy. | ||
| 146 | * | 152 | * |
| 147 | * @param client The client to send to | 153 | * @param client The client to send to |
| 148 | * @param notification The notification message to send | 154 | * @param notification The notification message to send |
| @@ -177,7 +183,8 @@ np_error_t np_post_notification(np_client_t client, const char *notification) | |||
| 177 | return res; | 183 | return res; |
| 178 | } | 184 | } |
| 179 | 185 | ||
| 180 | /** Notifies the device to send a notification on the specified event. | 186 | /** |
| 187 | * Tells the device to send a notification on the specified event. | ||
| 181 | * | 188 | * |
| 182 | * @param client The client to send to | 189 | * @param client The client to send to |
| 183 | * @param notification The notifications that should be observed. | 190 | * @param notification The notifications that should be observed. |
| @@ -206,7 +213,8 @@ np_error_t np_observe_notification( np_client_t client, const char *notification | |||
| 206 | return res; | 213 | return res; |
| 207 | } | 214 | } |
| 208 | 215 | ||
| 209 | /** Notifies the device to send a notification on specified events. | 216 | /** |
| 217 | * Tells the device to send a notification on specified events. | ||
| 210 | * | 218 | * |
| 211 | * @param client The client to send to | 219 | * @param client The client to send to |
| 212 | * @param notification_spec Specification of the notifications that should be | 220 | * @param notification_spec Specification of the notifications that should be |
| @@ -242,7 +250,7 @@ np_error_t np_observe_notifications(np_client_t client, const char **notificatio | |||
| 242 | } | 250 | } |
| 243 | 251 | ||
| 244 | /** | 252 | /** |
| 245 | * Checks if a notification has been sent. | 253 | * Checks if a notification has been sent by the device. |
| 246 | * | 254 | * |
| 247 | * @param client NP to get a notification from | 255 | * @param client NP to get a notification from |
| 248 | * @param notification Pointer to a buffer that will be allocated and filled | 256 | * @param notification Pointer to a buffer that will be allocated and filled |
