summaryrefslogtreecommitdiffstats
path: root/cython/mobilesync.pxi
diff options
context:
space:
mode:
Diffstat (limited to 'cython/mobilesync.pxi')
-rw-r--r--cython/mobilesync.pxi27
1 files changed, 16 insertions, 11 deletions
diff --git a/cython/mobilesync.pxi b/cython/mobilesync.pxi
index e610191..23f0005 100644
--- a/cython/mobilesync.pxi
+++ b/cython/mobilesync.pxi
@@ -7,11 +7,13 @@ cdef extern from "libimobiledevice/mobilesync.h":
MOBILESYNC_E_INVALID_ARG = -1
MOBILESYNC_E_PLIST_ERROR = -2
MOBILESYNC_E_MUX_ERROR = -3
- MOBILESYNC_E_BAD_VERSION = -4
- MOBILESYNC_E_SYNC_REFUSED = -5
- MOBILESYNC_E_CANCELLED = -6
- MOBILESYNC_E_WRONG_DIRECTION = -7
- MOBILESYNC_E_NOT_READY = -8
+ MOBILESYNC_E_SSL_ERROR = -4
+ MOBILESYNC_E_RECEIVE_TIMEOUT = -5
+ MOBILESYNC_E_BAD_VERSION = -6
+ MOBILESYNC_E_SYNC_REFUSED = -7
+ MOBILESYNC_E_CANCELLED = -8
+ MOBILESYNC_E_WRONG_DIRECTION = -9
+ MOBILESYNC_E_NOT_READY = -10
MOBILESYNC_E_UNKNOWN_ERROR = -256
ctypedef enum mobilesync_sync_type_t:
@@ -24,12 +26,12 @@ cdef extern from "libimobiledevice/mobilesync.h":
char *host_anchor
ctypedef mobilesync_anchors *mobilesync_anchors_t
- mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, mobilesync_client_t * client)
+ mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilesync_client_t * client)
mobilesync_error_t mobilesync_client_free(mobilesync_client_t client)
mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist.plist_t *plist)
mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist.plist_t plist)
- mobilesync_error_t mobilesync_start(mobilesync_client_t client, char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version)
+ mobilesync_error_t mobilesync_start(mobilesync_client_t client, char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description)
mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, char* reason)
mobilesync_error_t mobilesync_finish(mobilesync_client_t client)
@@ -60,6 +62,8 @@ cdef class MobileSyncError(BaseError):
MOBILESYNC_E_INVALID_ARG: "Invalid argument",
MOBILESYNC_E_PLIST_ERROR: "Property list error",
MOBILESYNC_E_MUX_ERROR: "MUX error",
+ MOBILESYNC_E_SSL_ERROR: "SSL error",
+ MOBILESYNC_E_RECEIVE_TIMEOUT: "Receive timeout",
MOBILESYNC_E_BAD_VERSION: "Bad version",
MOBILESYNC_E_SYNC_REFUSED: "Sync refused",
MOBILESYNC_E_CANCELLED: "Sync cancelled",
@@ -73,8 +77,8 @@ cdef class MobileSyncClient(DeviceLinkService):
__service_name__ = "com.apple.mobilesync"
cdef mobilesync_client_t _c_client
- def __cinit__(self, iDevice device not None, int port, *args, **kwargs):
- self.handle_error(mobilesync_client_new(device._c_dev, port, &(self._c_client)))
+ def __cinit__(self, iDevice device not None, LockdownServiceDescriptor descriptor, *args, **kwargs):
+ self.handle_error(mobilesync_client_new(device._c_dev, descriptor._c_service_descriptor, &(self._c_client)))
def __dealloc__(self):
cdef mobilesync_error_t err
@@ -88,6 +92,7 @@ cdef class MobileSyncClient(DeviceLinkService):
mobilesync_sync_type_t sync_type
uint64_t computer_data_class_version = 1
uint64_t device_data_class_version
+ char* error_description = NULL
if device_anchor is None:
anchors = mobilesync_anchors_new(NULL, host_anchor)
@@ -95,8 +100,8 @@ cdef class MobileSyncClient(DeviceLinkService):
anchors = mobilesync_anchors_new(device_anchor, host_anchor)
try:
- self.handle_error(mobilesync_start(self._c_client, data_class, anchors, computer_data_class_version, &sync_type, &device_data_class_version))
- return (sync_type, <bint>computer_data_class_version, <bint>device_data_class_version)
+ self.handle_error(mobilesync_start(self._c_client, data_class, anchors, computer_data_class_version, &sync_type, &device_data_class_version, &error_description))
+ return (sync_type, <bint>computer_data_class_version, <bint>device_data_class_version, <bytes>error_description)
except Exception, e:
raise
finally: