From f5ab55ba0b16bce9fd359a5391fec8486839c27d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 11 May 2009 18:06:06 +0200 Subject: Fix distcheck target for swig binding generation --- swig/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swig') diff --git a/swig/Makefile.am b/swig/Makefile.am index 726014b..d65b984 100644 --- a/swig/Makefile.am +++ b/swig/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) -I$(includedir) +INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) -I$(oldincludedir) BUILT_SOURCES = iphone_wrap.c SWIG_SOURCES = iphone.i -- cgit v1.1-32-gdbae From ba381c9fb036f63c6db42da7cc606847a934cd44 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 22 Jun 2009 00:36:35 +0200 Subject: Update python bindings to use allow targeting device by uuid --- swig/iphone.i | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 7a003d4..0a337ad 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -16,7 +16,7 @@ } Lockdownd; typedef struct { - Lockdownd* lckd; + iPhone* dev; iphone_msync_client_t client; } MobileSync; @@ -29,6 +29,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd); %} /* Parse the header file to generate wrappers */ %include "stdint.i" +%include "cstring.i" %include "plist/swig/plist.i" #define DBGMASK_ALL 0xFFFF @@ -47,7 +48,7 @@ typedef struct { } Lockdownd; typedef struct { - Lockdownd* lckd; + iPhone* dev; iphone_msync_client_t client; } MobileSync; @@ -78,7 +79,6 @@ Lockdownd* my_new_Lockdownd(iPhone* phone) { void my_delete_Lockdownd(Lockdownd* lckd) { if (lckd) { - my_delete_iPhone(lckd->dev); iphone_lckd_free_client ( lckd->client ); free(lckd); } @@ -90,7 +90,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { int port = 0; if (IPHONE_E_SUCCESS == iphone_lckd_start_service ( lckd->client, "com.apple.mobilesync", &port )) { client = (MobileSync*) malloc(sizeof(MobileSync)); - client->lckd = lckd; + client->dev = lckd->dev; client->client = NULL; iphone_msync_new_client ( lckd->dev->dev, port, &(client->client)); } @@ -115,15 +115,28 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { iphone_set_debug_mask(mask); } + void set_debug_level(int level) { + iphone_set_debug(level); + } + + int init_device_by_uuid(char* uuid) { + if (IPHONE_E_SUCCESS == iphone_get_device_by_uuid ( &($self->dev), uuid)) + return 1; + return 0; + } + int init_device() { if (IPHONE_E_SUCCESS == iphone_get_device ( &($self->dev))) return 1; return 0; } - char* serial_number(){ - return iphone_get_uuid($self->dev); - } + %newobject get_uuid; + char* get_uuid(){ + char* uuid = NULL; + uuid = (char *)iphone_get_uuid($self->dev); + return uuid; + } Lockdownd* get_lockdown_client() { return my_new_Lockdownd($self); @@ -162,7 +175,6 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } ~MobileSync() { - my_delete_Lockdownd($self->lckd); iphone_msync_free_client ( $self->client ); free($self); } -- cgit v1.1-32-gdbae From 62a6f558ac7ca7a9b83c2ed810929732c02bbc9d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 7 Jul 2009 21:02:00 +0200 Subject: Cleanup lockdown request API and fix docs, tools, bindings and exports --- swig/iphone.i | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 0a337ad..25687f5 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -4,15 +4,16 @@ %{ /* Includes the header in the wrapper code */ #include + #include #include -#include "../src/utils.h" + #include "../src/utils.h" typedef struct { iphone_device_t dev; } iPhone; typedef struct { iPhone* dev; - iphone_lckd_client_t client; + lockdownd_client_t client; } Lockdownd; typedef struct { @@ -44,7 +45,7 @@ typedef struct { typedef struct { iPhone* dev; - iphone_lckd_client_t client; + lockdownd_client_t client; } Lockdownd; typedef struct { @@ -68,7 +69,7 @@ Lockdownd* my_new_Lockdownd(iPhone* phone) { Lockdownd* client = (Lockdownd*) malloc(sizeof(Lockdownd)); client->dev = phone; client->client = NULL; - if (IPHONE_E_SUCCESS == iphone_lckd_new_client ( phone->dev , &(client->client))) { + if (IPHONE_E_SUCCESS == lockdownd_new_client ( phone->dev , &(client->client))) { return client; } else { @@ -79,7 +80,7 @@ Lockdownd* my_new_Lockdownd(iPhone* phone) { void my_delete_Lockdownd(Lockdownd* lckd) { if (lckd) { - iphone_lckd_free_client ( lckd->client ); + lockdownd_free_client ( lckd->client ); free(lckd); } } @@ -88,7 +89,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { if (!lckd || !lckd->dev) return NULL; MobileSync* client = NULL; int port = 0; - if (IPHONE_E_SUCCESS == iphone_lckd_start_service ( lckd->client, "com.apple.mobilesync", &port )) { + if (IPHONE_E_SUCCESS == lockdownd_start_service ( lckd->client, "com.apple.mobilesync", &port )) { client = (MobileSync*) malloc(sizeof(MobileSync)); client->dev = lckd->dev; client->client = NULL; @@ -154,13 +155,13 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } void send(PListNode* node) { - iphone_lckd_send($self->client, node->node); + lockdownd_send($self->client, node->node); } PListNode* receive() { PListNode* node = (PListNode*)malloc(sizeof(PListNode)); node->node = NULL; - iphone_lckd_recv($self->client, &(node->node)); + lockdownd_recv($self->client, &(node->node)); return node; } -- cgit v1.1-32-gdbae From a68a82800f116706354adb97da1ef0cfd3e38a52 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 14 Jul 2009 14:21:53 +0200 Subject: Cleanup mobilesync API and bindings. Move get_all_contacts() into msyncclient. --- swig/iphone.i | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 25687f5..53fa8da 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -5,6 +5,7 @@ /* Includes the header in the wrapper code */ #include #include + #include #include #include "../src/utils.h" typedef struct { @@ -18,7 +19,7 @@ typedef struct { iPhone* dev; - iphone_msync_client_t client; + mobilesync_client_t client; } MobileSync; //now declare funtions to handle creation and deletion of objects @@ -50,7 +51,7 @@ typedef struct { typedef struct { iPhone* dev; - iphone_msync_client_t client; + mobilesync_client_t client; } MobileSync; %inline %{ @@ -93,7 +94,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { client = (MobileSync*) malloc(sizeof(MobileSync)); client->dev = lckd->dev; client->client = NULL; - iphone_msync_new_client ( lckd->dev->dev, port, &(client->client)); + mobilesync_new_client ( lckd->dev->dev, port, &(client->client)); } return client; } @@ -165,7 +166,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { return node; } - MobileSync* get_mobile_sync_client() { + MobileSync* get_mobilesync_client() { return my_new_MobileSync($self); } }; @@ -176,18 +177,18 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } ~MobileSync() { - iphone_msync_free_client ( $self->client ); + mobilesync_free_client ( $self->client ); free($self); } void send(PListNode* node) { - iphone_msync_send($self->client, node->node); + mobilesync_send($self->client, node->node); } PListNode* receive() { PListNode* node = (PListNode*)malloc(sizeof(PListNode)); node->node = NULL; - iphone_msync_recv($self->client, &(node->node)); + mobilesync_recv($self->client, &(node->node)); return node; } }; -- cgit v1.1-32-gdbae From 601e70e8ee757b769bdc10b16e108e846a1a0b93 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 17:46:30 +0200 Subject: Rename iphone_set_debug() to iphone_set_debug_level() and code using it --- swig/iphone.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 53fa8da..a089cc2 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -118,7 +118,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } void set_debug_level(int level) { - iphone_set_debug(level); + iphone_set_debug_level(level); } int init_device_by_uuid(char* uuid) { -- cgit v1.1-32-gdbae From 15e2c165ac63e225e3fbfc531da5c1f19fede569 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 17:59:39 +0200 Subject: Remove DBGMASK_USBMUX as it is obsolete since the libusbmuxd code merge --- swig/iphone.i | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index a089cc2..59be4ef 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -36,9 +36,8 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd); #define DBGMASK_ALL 0xFFFF #define DBGMASK_NONE 0x0000 -#define DBGMASK_USBMUX (1 << 1) -#define DBGMASK_LOCKDOWND (1 << 2) -#define DBGMASK_MOBILESYNC (1 << 3) +#define DBGMASK_LOCKDOWND (1 << 1) +#define DBGMASK_MOBILESYNC (1 << 2) typedef struct { iphone_device_t dev; -- cgit v1.1-32-gdbae From 19a28b0ed18c8ca2f855e7d129ddcdb8c939a707 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 23:51:53 +0200 Subject: Use iphone_device_get_uuid() not lockdown, for less overhead where possible --- swig/iphone.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 59be4ef..64a8727 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -135,7 +135,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { %newobject get_uuid; char* get_uuid(){ char* uuid = NULL; - uuid = (char *)iphone_get_uuid($self->dev); + uuid = (char *)iphone_device_get_uuid($self->dev); return uuid; } -- cgit v1.1-32-gdbae From e2372b2f7f8f9017c9f90a7ed4d01997fb9ba464 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 01:02:11 +0200 Subject: Fix Python bindings build due to signature change of iphone_device_get_uuid() --- swig/iphone.i | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'swig') diff --git a/swig/iphone.i b/swig/iphone.i index 64a8727..3c208ef 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -59,7 +59,7 @@ typedef struct { void my_delete_iPhone(iPhone* dev) { if (dev) { - iphone_free_device ( dev->dev ); + iphone_device_free(dev->dev); free(dev); } } @@ -69,7 +69,7 @@ Lockdownd* my_new_Lockdownd(iPhone* phone) { Lockdownd* client = (Lockdownd*) malloc(sizeof(Lockdownd)); client->dev = phone; client->client = NULL; - if (IPHONE_E_SUCCESS == lockdownd_new_client ( phone->dev , &(client->client))) { + if (LOCKDOWN_E_SUCCESS == lockdownd_client_new(phone->dev , &(client->client))) { return client; } else { @@ -80,7 +80,7 @@ Lockdownd* my_new_Lockdownd(iPhone* phone) { void my_delete_Lockdownd(Lockdownd* lckd) { if (lckd) { - lockdownd_free_client ( lckd->client ); + lockdownd_client_free(lckd->client); free(lckd); } } @@ -89,11 +89,11 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { if (!lckd || !lckd->dev) return NULL; MobileSync* client = NULL; int port = 0; - if (IPHONE_E_SUCCESS == lockdownd_start_service ( lckd->client, "com.apple.mobilesync", &port )) { + if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(lckd->client, "com.apple.mobilesync", &port)) { client = (MobileSync*) malloc(sizeof(MobileSync)); client->dev = lckd->dev; client->client = NULL; - mobilesync_new_client ( lckd->dev->dev, port, &(client->client)); + mobilesync_client_new(lckd->dev->dev, port, &(client->client)); } return client; } @@ -121,13 +121,13 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } int init_device_by_uuid(char* uuid) { - if (IPHONE_E_SUCCESS == iphone_get_device_by_uuid ( &($self->dev), uuid)) + if (IPHONE_E_SUCCESS == iphone_get_device_by_uuid(&($self->dev), uuid)) return 1; return 0; } int init_device() { - if (IPHONE_E_SUCCESS == iphone_get_device ( &($self->dev))) + if (IPHONE_E_SUCCESS == iphone_get_device(&($self->dev))) return 1; return 0; } @@ -135,7 +135,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { %newobject get_uuid; char* get_uuid(){ char* uuid = NULL; - uuid = (char *)iphone_device_get_uuid($self->dev); + iphone_device_get_uuid($self->dev, &uuid); return uuid; } @@ -176,7 +176,7 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { } ~MobileSync() { - mobilesync_free_client ( $self->client ); + mobilesync_client_free($self->client); free($self); } -- cgit v1.1-32-gdbae