Class UsbmuxdApi
Inheritance
Implements
Inherited Members
Namespace: iMobileDevice.Usbmuxd
Assembly: iMobileDevice-net.dll
Syntax
public class UsbmuxdApi : IUsbmuxdApi
Constructors
| Improve this Doc View SourceUsbmuxdApi(ILibiMobileDevice)
Declaration
public UsbmuxdApi(ILibiMobileDevice parent)
Parameters
Type | Name | Description |
---|---|---|
ILibiMobileDevice | parent |
Properties
| Improve this Doc View SourceParent
Declaration
public ILibiMobileDevice Parent { get; }
Property Value
Type | Description |
---|---|
ILibiMobileDevice |
Methods
| Improve this Doc View Sourcelibusbmuxd_set_debug_level(Int32)
Declaration
public virtual void libusbmuxd_set_debug_level(int level)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | level |
libusbmuxd_set_use_inotify(Int32)
Enable or disable the use of inotify extension. Enabled by default. Use 0 to disable and 1 to enable inotify support. This only has an effect on linux systems if inotify support has been built in. Otherwise and on all other platforms this function has no effect.
Declaration
public virtual void libusbmuxd_set_use_inotify(int set)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | set |
usbmuxd_connect(Int32, UInt16)
Request proxy connect to
Declaration
public virtual int usbmuxd_connect(int handle, ushort tcpPort)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | handle | returned by 'usbmuxd_scan()' |
System.UInt16 | tcpPort |
Returns
Type | Description |
---|---|
System.Int32 | file descriptor socket of the connection, or -1 on error |
usbmuxd_delete_pair_record(String)
Delete a pairing record
Declaration
public virtual int usbmuxd_delete_pair_record(string recordId)
Parameters
Type | Name | Description |
---|---|---|
System.String | recordId |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative errno value otherwise. |
usbmuxd_device_list_free(IntPtr)
Frees the device list returned by an usbmuxd_get_device_list call
Declaration
public virtual int usbmuxd_device_list_free(IntPtr deviceList)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | deviceList |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, -1 on error. |
usbmuxd_disconnect(Int32)
Disconnect. For now, this just closes the socket file descriptor.
Declaration
public virtual int usbmuxd_disconnect(int sfd)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sfd | socker file descriptor returned by usbmuxd_connect() |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, -1 on error. |
usbmuxd_get_device_by_udid(String, ref UsbmuxdDeviceInfo)
Gets device information for the device specified by udid.
Declaration
public virtual int usbmuxd_get_device_by_udid(string udid, ref UsbmuxdDeviceInfo device)
Parameters
Type | Name | Description |
---|---|---|
System.String | udid | A device UDID of the device to look for. If udid is NULL, This function will return the first device found. |
UsbmuxdDeviceInfo | device | Pointer to a previously allocated (or static) usbmuxd_device_info_t that will be filled with the device info. |
Returns
Type | Description |
---|---|
System.Int32 | 0 if no matching device is connected, 1 if the device was found, or a negative value on error. |
usbmuxd_get_device_list(ref IntPtr)
Contacts usbmuxd and retrieves a list of connected devices.
Declaration
public virtual int usbmuxd_get_device_list(ref IntPtr deviceList)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | deviceList |
Returns
Type | Description |
---|---|
System.Int32 | number of attached devices, zero on no devices, or negative if an error occured. |
Remarks
The user has to free the list returned.
usbmuxd_get_socket_type(ref Int32)
Gets the socket type (Unix socket or TCP socket) libusbmuxd should use when connecting to usbmuxd.
Declaration
public virtual int usbmuxd_get_socket_type(ref int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | A pointer to an integer which will reveive the current socket type |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success or negative on error |
usbmuxd_get_tcp_endpoint(out String, ref UInt16)
Gets the TCP endpoint to which usbmuxd will connect if th esocket type is set to SOCKET_TYPE_TCP
Declaration
public virtual int usbmuxd_get_tcp_endpoint(out string host, ref ushort port)
Parameters
Type | Name | Description |
---|---|---|
System.String | host | A pointer which will be set to the hostname or IP address to which to connect. The caller must free this string. |
System.UInt16 | port | The port to which to connect |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success or negative on error |
usbmuxd_read_buid(out String)
Reads the SystemBUID
Declaration
public virtual int usbmuxd_read_buid(out string buid)
Parameters
Type | Name | Description |
---|---|---|
System.String | buid | pointer to a variable that will be set to point to a newly allocated string with the System BUID returned by usbmuxd |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative errno value otherwise. |
usbmuxd_read_pair_record(String, out String, ref UInt32)
Read a pairing record
Declaration
public virtual int usbmuxd_read_pair_record(string recordId, out string recordData, ref uint recordSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | recordId | |
System.String | recordData | |
System.UInt32 | recordSize |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative error value otherwise. |
usbmuxd_recv(Int32, Byte[], UInt32, ref UInt32)
Receive data from the specified socket with a default timeout.
Declaration
public virtual int usbmuxd_recv(int sfd, byte[] data, uint len, ref uint recvBytes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sfd | socket file descriptor returned by usbmuxd_connect() |
System.Byte[] | data | buffer to put the data to |
System.UInt32 | len | number of bytes to receive |
System.UInt32 | recvBytes |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative errno value otherwise. |
usbmuxd_recv_timeout(Int32, Byte[], UInt32, ref UInt32, UInt32)
Receive data from the specified socket.
Declaration
public virtual int usbmuxd_recv_timeout(int sfd, byte[] data, uint len, ref uint recvBytes, uint timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sfd | socket file descriptor returned by usbmuxd_connect() |
System.Byte[] | data | buffer to put the data to |
System.UInt32 | len | number of bytes to receive |
System.UInt32 | recvBytes | |
System.UInt32 | timeout | how many milliseconds to wait for data |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative errno value otherwise. |
usbmuxd_save_pair_record(String, String, UInt32)
Save a pairing record
Declaration
public virtual int usbmuxd_save_pair_record(string recordId, string recordData, uint recordSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | recordId | |
System.String | recordData | |
System.UInt32 | recordSize |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative error value otherwise. |
usbmuxd_send(Int32, Byte[], UInt32, ref UInt32)
Send data to the specified socket.
Declaration
public virtual int usbmuxd_send(int sfd, byte[] data, uint len, ref uint sentBytes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sfd | socket file descriptor returned by usbmuxd_connect() |
System.Byte[] | data | buffer to send |
System.UInt32 | len | size of buffer to send |
System.UInt32 | sentBytes |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, a negative errno value otherwise. |
usbmuxd_set_socket_type(Int32)
Sets the socket type (Unix socket or TCP socket) libusbmuxd should use when connecting to usbmuxd.
Declaration
public virtual int usbmuxd_set_socket_type(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | SOCKET_TYPE_UNIX or SOCKET_TYPE_TCP |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success or negative on error |
usbmuxd_set_tcp_endpoint(String, UInt16)
Sets the TCP endpoint to which usbmuxd will connect if the socket type is set to SOCKET_TYPE_TCP
Declaration
public virtual int usbmuxd_set_tcp_endpoint(string host, ushort port)
Parameters
Type | Name | Description |
---|---|---|
System.String | host | The hostname or IP address to which to connect |
System.UInt16 | port | The port to which to connect. |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success or negative on error |
usbmuxd_subscribe(UsbmuxdEventCallBack, IntPtr)
Subscribe a callback function so that applications get to know about device add/remove events.
Declaration
public virtual int usbmuxd_subscribe(UsbmuxdEventCallBack callback, IntPtr userData)
Parameters
Type | Name | Description |
---|---|---|
UsbmuxdEventCallBack | callback | A callback function that is executed when an event occurs. |
System.IntPtr | userData |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success or negative on error. |
usbmuxd_unsubscribe()
Unsubscribe callback.
Declaration
public virtual int usbmuxd_unsubscribe()
Returns
Type | Description |
---|---|
System.Int32 | only 0 for now. |