| 1 |
/* |
| 2 |
* device_link_service.h |
| 3 |
* Definitions for the DeviceLink service |
| 4 |
* |
| 5 |
* Copyright (c) 2010-2019 Nikias Bassen, All Rights Reserved. |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Lesser General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2.1 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Lesser General Public License for more details. |
| 16 |
* |
| 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 |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef __DEVICE_LINK_SERVICE_H |
| 23 |
#define __DEVICE_LINK_SERVICE_H |
| 24 |
|
| 25 |
#include "idevice.h" |
| 26 |
#include "property_list_service.h" |
| 27 |
|
| 28 |
/* Error Codes */ |
| 29 |
typedef enum { |
| 30 |
DEVICE_LINK_SERVICE_E_SUCCESS = 0, |
| 31 |
DEVICE_LINK_SERVICE_E_INVALID_ARG = -1, |
| 32 |
DEVICE_LINK_SERVICE_E_PLIST_ERROR = -2, |
| 33 |
DEVICE_LINK_SERVICE_E_MUX_ERROR = -3, |
| 34 |
DEVICE_LINK_SERVICE_E_SSL_ERROR = -4, |
| 35 |
DEVICE_LINK_SERVICE_E_RECEIVE_TIMEOUT = -5, |
| 36 |
DEVICE_LINK_SERVICE_E_BAD_VERSION = -6, |
| 37 |
DEVICE_LINK_SERVICE_E_UNKNOWN_ERROR = -256 |
| 38 |
} device_link_service_error_t; |
| 39 |
|
| 40 |
struct device_link_service_client_private { |
| 41 |
property_list_service_client_t parent; |
| 42 |
}; |
| 43 |
|
| 44 |
typedef struct device_link_service_client_private *device_link_service_client_t; |
| 45 |
|
| 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); |
| 47 |
device_link_service_error_t device_link_service_client_free(device_link_service_client_t client); |
| 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); |
| 49 |
device_link_service_error_t device_link_service_send_ping(device_link_service_client_t client, const char *message); |
| 50 |
device_link_service_error_t device_link_service_receive_message(device_link_service_client_t client, plist_t *msg_plist, char **dlmessage); |
| 51 |
device_link_service_error_t device_link_service_send_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); |
| 53 |
device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client, const char *message); |
| 54 |
device_link_service_error_t device_link_service_send(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); |
| 56 |
|
| 57 |
#endif |