summaryrefslogtreecommitdiffstats
path: root/cython
diff options
context:
space:
mode:
Diffstat (limited to 'cython')
-rw-r--r--cython/imobiledevice.pxd2
-rw-r--r--cython/imobiledevice.pyx17
2 files changed, 19 insertions, 0 deletions
diff --git a/cython/imobiledevice.pxd b/cython/imobiledevice.pxd
index cd17061..a614124 100644
--- a/cython/imobiledevice.pxd
+++ b/cython/imobiledevice.pxd
@@ -51,8 +51,10 @@ cdef class BaseService(Base):
51cdef class PropertyListService(BaseService): 51cdef class PropertyListService(BaseService):
52 cpdef send(self, plist.Node node) 52 cpdef send(self, plist.Node node)
53 cpdef object receive(self) 53 cpdef object receive(self)
54 cpdef object receive_with_timeout(self, int timeout_ms)
54 cdef int16_t _send(self, plist.plist_t node) 55 cdef int16_t _send(self, plist.plist_t node)
55 cdef int16_t _receive(self, plist.plist_t* c_node) 56 cdef int16_t _receive(self, plist.plist_t* c_node)
57 cdef int16_t _receive_with_timeout(self, plist.plist_t* c_node, int timeout_ms)
56 58
57cdef extern from "libimobiledevice/lockdown.h": 59cdef extern from "libimobiledevice/lockdown.h":
58 cdef struct lockdownd_client_private: 60 cdef struct lockdownd_client_private:
diff --git a/cython/imobiledevice.pyx b/cython/imobiledevice.pyx
index 9d2e13d..cdb9978 100644
--- a/cython/imobiledevice.pyx
+++ b/cython/imobiledevice.pyx
@@ -210,12 +210,29 @@ cdef class PropertyListService(BaseService):
210 plist.plist_free(c_node) 210 plist.plist_free(c_node)
211 raise 211 raise
212 212
213 cpdef object receive_with_timeout(self, int timeout_ms):
214 cdef:
215 plist.plist_t c_node = NULL
216 int16_t err
217 err = self._receive_with_timeout(&c_node, timeout_ms)
218 try:
219 self.handle_error(err)
220
221 return plist.plist_t_to_node(c_node)
222 except BaseError, e:
223 if c_node != NULL:
224 plist.plist_free(c_node)
225 raise
226
213 cdef int16_t _send(self, plist.plist_t node): 227 cdef int16_t _send(self, plist.plist_t node):
214 raise NotImplementedError("send is not implemented") 228 raise NotImplementedError("send is not implemented")
215 229
216 cdef int16_t _receive(self, plist.plist_t* c_node): 230 cdef int16_t _receive(self, plist.plist_t* c_node):
217 raise NotImplementedError("receive is not implemented") 231 raise NotImplementedError("receive is not implemented")
218 232
233 cdef int16_t _receive_with_timeout(self, plist.plist_t* c_node, int timeout_ms):
234 raise NotImplementedError("receive_with_timeout is not implemented")
235
219cdef class DeviceLinkService(PropertyListService): 236cdef class DeviceLinkService(PropertyListService):
220 pass 237 pass
221 238