diff options
| author | 2013-02-27 15:10:57 +0100 | |
|---|---|---|
| committer | 2013-02-27 15:10:57 +0100 | |
| commit | 0cac547eb79492e04176ad541fe6fb1d1f576824 (patch) | |
| tree | c285e1a996233b2829645144bdfb936d64b4fcc1 /cython/mobilesync.pxi | |
| parent | 12754fa1c93d810f408b2de291b44e39eaee7ee5 (diff) | |
| download | libimobiledevice-0cac547eb79492e04176ad541fe6fb1d1f576824.tar.gz libimobiledevice-0cac547eb79492e04176ad541fe6fb1d1f576824.tar.bz2 | |
cython: Port all binding code to latest API and fix broken compilation
Diffstat (limited to 'cython/mobilesync.pxi')
| -rw-r--r-- | cython/mobilesync.pxi | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cython/mobilesync.pxi b/cython/mobilesync.pxi index e610191..ba9d585 100644 --- a/cython/mobilesync.pxi +++ b/cython/mobilesync.pxi | |||
| @@ -24,12 +24,12 @@ cdef extern from "libimobiledevice/mobilesync.h": | |||
| 24 | char *host_anchor | 24 | char *host_anchor |
| 25 | ctypedef mobilesync_anchors *mobilesync_anchors_t | 25 | ctypedef mobilesync_anchors *mobilesync_anchors_t |
| 26 | 26 | ||
| 27 | mobilesync_error_t mobilesync_client_new(idevice_t device, uint16_t port, mobilesync_client_t * client) | 27 | mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilesync_client_t * client) |
| 28 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) | 28 | mobilesync_error_t mobilesync_client_free(mobilesync_client_t client) |
| 29 | mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist.plist_t *plist) | 29 | mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist.plist_t *plist) |
| 30 | mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist.plist_t plist) | 30 | mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist.plist_t plist) |
| 31 | 31 | ||
| 32 | 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) | 32 | 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) |
| 33 | mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, char* reason) | 33 | mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, char* reason) |
| 34 | mobilesync_error_t mobilesync_finish(mobilesync_client_t client) | 34 | mobilesync_error_t mobilesync_finish(mobilesync_client_t client) |
| 35 | 35 | ||
| @@ -73,8 +73,8 @@ cdef class MobileSyncClient(DeviceLinkService): | |||
| 73 | __service_name__ = "com.apple.mobilesync" | 73 | __service_name__ = "com.apple.mobilesync" |
| 74 | cdef mobilesync_client_t _c_client | 74 | cdef mobilesync_client_t _c_client |
| 75 | 75 | ||
| 76 | def __cinit__(self, iDevice device not None, int port, *args, **kwargs): | 76 | def __cinit__(self, iDevice device not None, LockdownServiceDescriptor descriptor, *args, **kwargs): |
| 77 | self.handle_error(mobilesync_client_new(device._c_dev, port, &(self._c_client))) | 77 | self.handle_error(mobilesync_client_new(device._c_dev, descriptor._c_service_descriptor, &(self._c_client))) |
| 78 | 78 | ||
| 79 | def __dealloc__(self): | 79 | def __dealloc__(self): |
| 80 | cdef mobilesync_error_t err | 80 | cdef mobilesync_error_t err |
| @@ -88,6 +88,7 @@ cdef class MobileSyncClient(DeviceLinkService): | |||
| 88 | mobilesync_sync_type_t sync_type | 88 | mobilesync_sync_type_t sync_type |
| 89 | uint64_t computer_data_class_version = 1 | 89 | uint64_t computer_data_class_version = 1 |
| 90 | uint64_t device_data_class_version | 90 | uint64_t device_data_class_version |
| 91 | char* error_description = NULL | ||
| 91 | 92 | ||
| 92 | if device_anchor is None: | 93 | if device_anchor is None: |
| 93 | anchors = mobilesync_anchors_new(NULL, host_anchor) | 94 | anchors = mobilesync_anchors_new(NULL, host_anchor) |
| @@ -95,8 +96,8 @@ cdef class MobileSyncClient(DeviceLinkService): | |||
| 95 | anchors = mobilesync_anchors_new(device_anchor, host_anchor) | 96 | anchors = mobilesync_anchors_new(device_anchor, host_anchor) |
| 96 | 97 | ||
| 97 | try: | 98 | try: |
| 98 | self.handle_error(mobilesync_start(self._c_client, data_class, anchors, computer_data_class_version, &sync_type, &device_data_class_version)) | 99 | self.handle_error(mobilesync_start(self._c_client, data_class, anchors, computer_data_class_version, &sync_type, &device_data_class_version, &error_description)) |
| 99 | return (sync_type, <bint>computer_data_class_version, <bint>device_data_class_version) | 100 | return (sync_type, <bint>computer_data_class_version, <bint>device_data_class_version, <bytes>error_description) |
| 100 | except Exception, e: | 101 | except Exception, e: |
| 101 | raise | 102 | raise |
| 102 | finally: | 103 | finally: |
