diff options
author | Martin Szulecki | 2009-04-14 22:42:25 +0200 |
---|---|---|
committer | Matt Colyer | 2009-04-19 15:11:28 -0700 |
commit | 8493fe20ecfaafb45dd80a0e352d6d0e1dfa6e70 (patch) | |
tree | 25fcbfa34e057ebd50efe329543a5b0e240c6491 | |
parent | bb2ce5fe74136cb3ce304a31641fb1e1a60dace7 (diff) | |
download | libimobiledevice-8493fe20ecfaafb45dd80a0e352d6d0e1dfa6e70.tar.gz libimobiledevice-8493fe20ecfaafb45dd80a0e352d6d0e1dfa6e70.tar.bz2 |
Expose debug mask and send/receive plists for lockdownd in Python API
[#29 state:resolved]
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r-- | swig/iphone.i | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/swig/iphone.i b/swig/iphone.i index 3ae0999..ae2e97f 100644 --- a/swig/iphone.i +++ b/swig/iphone.i @@ -31,6 +31,12 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd); %include "stdint.i" %include "plist/swig/plist.i" +#define DBGMASK_ALL 0xFFFF +#define DBGMASK_NONE 0x0000 +#define DBGMASK_USBMUX (1 << 1) +#define DBGMASK_LOCKDOWND (1 << 2) +#define DBGMASK_MOBILESYNC (1 << 3) + typedef struct { iphone_device_t dev; } iPhone; @@ -98,7 +104,6 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { iPhone() { iPhone* phone = (iPhone*) malloc(sizeof(iPhone)); phone->dev = NULL; - iphone_set_debug_mask(DBGMASK_LOCKDOWND | DBGMASK_MOBILESYNC); return phone; } @@ -106,12 +111,22 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { my_delete_iPhone($self); } + void set_debug_mask(uint16_t mask) { + iphone_set_debug_mask(mask); + } + int init_device() { if (IPHONE_E_SUCCESS == iphone_get_device ( &($self->dev))) return 1; return 0; } + int init_specific_device(int busnumber, int devicenumber) { + if (IPHONE_E_SUCCESS == iphone_get_specific_device ( busnumber, devicenumber, &($self->dev))) + return 1; + return 0; + } + Lockdownd* get_lockdown_client() { return my_new_Lockdownd($self); } @@ -127,6 +142,17 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { my_delete_Lockdownd($self); } + void send(PListNode* node) { + iphone_lckd_send($self->client, node->node); + } + + PListNode* receive() { + PListNode* node = (PListNode*)malloc(sizeof(PListNode)); + node->node = NULL; + iphone_lckd_recv($self->client, &(node->node)); + return node; + } + MobileSync* get_mobile_sync_client() { return my_new_MobileSync($self); } |