summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/heartbeat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libimobiledevice/heartbeat.h')
-rw-r--r--include/libimobiledevice/heartbeat.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/libimobiledevice/heartbeat.h b/include/libimobiledevice/heartbeat.h
new file mode 100644
index 0000000..e5adb0d
--- /dev/null
+++ b/include/libimobiledevice/heartbeat.h
@@ -0,0 +1,64 @@
1/**
2 * @file libimobiledevice/heartbeat.h
3 * @brief Send "heartbeat" to device to allow service connections over network.
4 * \internal
5 *
6 * Copyright (c) 2013 Martin Szulecki All Rights Reserved.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef IHEARTBEAT_H
24#define IHEARTBEAT_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <libimobiledevice/libimobiledevice.h>
31#include <libimobiledevice/lockdown.h>
32
33#define HEARTBEAT_SERVICE_NAME "com.apple.mobile.heartbeat"
34
35/** @name Error Codes */
36/*@{*/
37#define HEARTBEAT_E_SUCCESS 0
38#define HEARTBEAT_E_INVALID_ARG -1
39#define HEARTBEAT_E_PLIST_ERROR -2
40#define HEARTBEAT_E_MUX_ERROR -3
41#define HEARTBEAT_E_SSL_ERROR -4
42#define HEARTBEAT_E_UNKNOWN_ERROR -256
43/*@}*/
44
45/** Represents an error code. */
46typedef int16_t heartbeat_error_t;
47
48typedef struct heartbeat_client_private heartbeat_client_private;
49typedef heartbeat_client_private *heartbeat_client_t; /**< The client handle. */
50
51heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client);
52heartbeat_error_t heartbeat_client_free(heartbeat_client_t client);
53
54heartbeat_error_t heartbeat_start_service(idevice_t device, heartbeat_client_t * client);
55
56heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist);
57heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist);
58heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms);
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif