diff options
Diffstat (limited to 'swig')
| -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); | |||
| 31 | %include "stdint.i" | 31 | %include "stdint.i" |
| 32 | %include "plist/swig/plist.i" | 32 | %include "plist/swig/plist.i" |
| 33 | 33 | ||
| 34 | #define DBGMASK_ALL 0xFFFF | ||
| 35 | #define DBGMASK_NONE 0x0000 | ||
| 36 | #define DBGMASK_USBMUX (1 << 1) | ||
| 37 | #define DBGMASK_LOCKDOWND (1 << 2) | ||
| 38 | #define DBGMASK_MOBILESYNC (1 << 3) | ||
| 39 | |||
| 34 | typedef struct { | 40 | typedef struct { |
| 35 | iphone_device_t dev; | 41 | iphone_device_t dev; |
| 36 | } iPhone; | 42 | } iPhone; |
| @@ -98,7 +104,6 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { | |||
| 98 | iPhone() { | 104 | iPhone() { |
| 99 | iPhone* phone = (iPhone*) malloc(sizeof(iPhone)); | 105 | iPhone* phone = (iPhone*) malloc(sizeof(iPhone)); |
| 100 | phone->dev = NULL; | 106 | phone->dev = NULL; |
| 101 | iphone_set_debug_mask(DBGMASK_LOCKDOWND | DBGMASK_MOBILESYNC); | ||
| 102 | return phone; | 107 | return phone; |
| 103 | } | 108 | } |
| 104 | 109 | ||
| @@ -106,12 +111,22 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { | |||
| 106 | my_delete_iPhone($self); | 111 | my_delete_iPhone($self); |
| 107 | } | 112 | } |
| 108 | 113 | ||
| 114 | void set_debug_mask(uint16_t mask) { | ||
| 115 | iphone_set_debug_mask(mask); | ||
| 116 | } | ||
| 117 | |||
| 109 | int init_device() { | 118 | int init_device() { |
| 110 | if (IPHONE_E_SUCCESS == iphone_get_device ( &($self->dev))) | 119 | if (IPHONE_E_SUCCESS == iphone_get_device ( &($self->dev))) |
| 111 | return 1; | 120 | return 1; |
| 112 | return 0; | 121 | return 0; |
| 113 | } | 122 | } |
| 114 | 123 | ||
| 124 | int init_specific_device(int busnumber, int devicenumber) { | ||
| 125 | if (IPHONE_E_SUCCESS == iphone_get_specific_device ( busnumber, devicenumber, &($self->dev))) | ||
| 126 | return 1; | ||
| 127 | return 0; | ||
| 128 | } | ||
| 129 | |||
| 115 | Lockdownd* get_lockdown_client() { | 130 | Lockdownd* get_lockdown_client() { |
| 116 | return my_new_Lockdownd($self); | 131 | return my_new_Lockdownd($self); |
| 117 | } | 132 | } |
| @@ -127,6 +142,17 @@ MobileSync* my_new_MobileSync(Lockdownd* lckd) { | |||
| 127 | my_delete_Lockdownd($self); | 142 | my_delete_Lockdownd($self); |
| 128 | } | 143 | } |
| 129 | 144 | ||
| 145 | void send(PListNode* node) { | ||
| 146 | iphone_lckd_send($self->client, node->node); | ||
| 147 | } | ||
| 148 | |||
| 149 | PListNode* receive() { | ||
| 150 | PListNode* node = (PListNode*)malloc(sizeof(PListNode)); | ||
| 151 | node->node = NULL; | ||
| 152 | iphone_lckd_recv($self->client, &(node->node)); | ||
| 153 | return node; | ||
| 154 | } | ||
| 155 | |||
| 130 | MobileSync* get_mobile_sync_client() { | 156 | MobileSync* get_mobile_sync_client() { |
| 131 | return my_new_MobileSync($self); | 157 | return my_new_MobileSync($self); |
| 132 | } | 158 | } |
