diff options
Diffstat (limited to 'src/device_link_service.h')
-rw-r--r-- | src/device_link_service.h | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/device_link_service.h b/src/device_link_service.h index 9953f77..0255b21 100644 --- a/src/device_link_service.h +++ b/src/device_link_service.h | |||
@@ -1,39 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * device_link_service.h | 2 | * device_link_service.h |
3 | * Definitions for the DeviceLink service | 3 | * Definitions for the DeviceLink service |
4 | * | 4 | * |
5 | * Copyright (c) 2010 Nikias Bassen, All Rights Reserved. | 5 | * Copyright (c) 2010-2019 Nikias Bassen, All Rights Reserved. |
6 | * | 6 | * |
7 | * This library is free software; you can redistribute it and/or | 7 | * This library is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU Lesser General Public | 8 | * modify it under the terms of the GNU Lesser General Public |
9 | * License as published by the Free Software Foundation; either | 9 | * License as published by the Free Software Foundation; either |
10 | * version 2.1 of the License, or (at your option) any later version. | 10 | * version 2.1 of the License, or (at your option) any later version. |
11 | * | 11 | * |
12 | * This library is distributed in the hope that it will be useful, | 12 | * This library is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | * Lesser General Public License for more details. | 15 | * Lesser General Public License for more details. |
16 | * | 16 | * |
17 | * You should have received a copy of the GNU Lesser General Public | 17 | * You should have received a copy of the GNU Lesser General Public |
18 | * License along with this library; if not, write to the Free Software | 18 | * License along with this library; if not, write to the Free Software |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | */ | 20 | */ |
21 | #ifndef DEVICE_LINK_SERVICE_H | ||
22 | #define DEVICE_LINK_SERVICE_H | ||
23 | 21 | ||
22 | #ifndef __DEVICE_LINK_SERVICE_H | ||
23 | #define __DEVICE_LINK_SERVICE_H | ||
24 | |||
25 | #include "idevice.h" | ||
24 | #include "property_list_service.h" | 26 | #include "property_list_service.h" |
25 | 27 | ||
26 | /* Error Codes */ | 28 | /* Error Codes */ |
27 | #define DEVICE_LINK_SERVICE_E_SUCCESS 0 | 29 | typedef enum { |
28 | #define DEVICE_LINK_SERVICE_E_INVALID_ARG -1 | 30 | DEVICE_LINK_SERVICE_E_SUCCESS = 0, |
29 | #define DEVICE_LINK_SERVICE_E_PLIST_ERROR -2 | 31 | DEVICE_LINK_SERVICE_E_INVALID_ARG = -1, |
30 | #define DEVICE_LINK_SERVICE_E_MUX_ERROR -3 | 32 | DEVICE_LINK_SERVICE_E_PLIST_ERROR = -2, |
31 | #define DEVICE_LINK_SERVICE_E_BAD_VERSION -4 | 33 | DEVICE_LINK_SERVICE_E_MUX_ERROR = -3, |
32 | 34 | DEVICE_LINK_SERVICE_E_SSL_ERROR = -4, | |
33 | #define DEVICE_LINK_SERVICE_E_UNKNOWN_ERROR -256 | 35 | DEVICE_LINK_SERVICE_E_RECEIVE_TIMEOUT = -5, |
34 | 36 | DEVICE_LINK_SERVICE_E_BAD_VERSION = -6, | |
35 | /** Represents an error code. */ | 37 | DEVICE_LINK_SERVICE_E_UNKNOWN_ERROR = -256 |
36 | typedef int16_t device_link_service_error_t; | 38 | } device_link_service_error_t; |
37 | 39 | ||
38 | struct device_link_service_client_private { | 40 | struct device_link_service_client_private { |
39 | property_list_service_client_t parent; | 41 | property_list_service_client_t parent; |
@@ -41,14 +43,14 @@ struct device_link_service_client_private { | |||
41 | 43 | ||
42 | typedef struct device_link_service_client_private *device_link_service_client_t; | 44 | typedef struct device_link_service_client_private *device_link_service_client_t; |
43 | 45 | ||
44 | device_link_service_error_t device_link_service_client_new(idevice_t device, uint16_t port, device_link_service_client_t *client); | 46 | device_link_service_error_t device_link_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, device_link_service_client_t *client); |
45 | device_link_service_error_t device_link_service_client_free(device_link_service_client_t client); | 47 | device_link_service_error_t device_link_service_client_free(device_link_service_client_t client); |
46 | device_link_service_error_t device_link_service_version_exchange(device_link_service_client_t client, uint64_t version_major, uint64_t version_minor); | 48 | device_link_service_error_t device_link_service_version_exchange(device_link_service_client_t client, uint64_t version_major, uint64_t version_minor); |
47 | device_link_service_error_t device_link_service_send_ping(device_link_service_client_t client, const char *message); | 49 | device_link_service_error_t device_link_service_send_ping(device_link_service_client_t client, const char *message); |
48 | device_link_service_error_t device_link_service_receive_message(device_link_service_client_t client, plist_t *msg_plist, char **dlmessage); | 50 | device_link_service_error_t device_link_service_receive_message(device_link_service_client_t client, plist_t *msg_plist, char **dlmessage); |
49 | device_link_service_error_t device_link_service_send_process_message(device_link_service_client_t client, plist_t message); | 51 | device_link_service_error_t device_link_service_send_process_message(device_link_service_client_t client, plist_t message); |
50 | device_link_service_error_t device_link_service_receive_process_message(device_link_service_client_t client, plist_t *message); | 52 | device_link_service_error_t device_link_service_receive_process_message(device_link_service_client_t client, plist_t *message); |
51 | device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client); | 53 | device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client, const char *message); |
52 | device_link_service_error_t device_link_service_send(device_link_service_client_t client, plist_t plist); | 54 | device_link_service_error_t device_link_service_send(device_link_service_client_t client, plist_t plist); |
53 | device_link_service_error_t device_link_service_receive(device_link_service_client_t client, plist_t *plist); | 55 | device_link_service_error_t device_link_service_receive(device_link_service_client_t client, plist_t *plist); |
54 | 56 | ||