Control port remapping for iOS devices
Module type
Class type
Library usbmux
Module Usbmux . Protocol
type msg_version_t =
| Binary
| Plist

A plist can be either binary or XML.

type conn_code =
| Success
| Device_requested_not_connected
| Port_requested_not_available
| Malformed_request

Result code after trying to establish a connection for a device, variant names are self-documenting.

type event =
| Attached of device_t
| Detached of int

A device event with associated metadata.

and device_t = {
serial_number : string;
connection_speed : int;
connection_type : string;
product_id : int;
location_id : int;
device_id : int;

High level self documenting metadata about the device connection.

type msg_t =
| Result of conn_code
| Event of event

Reply from usbmuxd, could be an event or reply to a query.

type exn +=
| Unknown_reply of string
val create_listener : ?event_cb:( msg_t -> unit Lwt.t ) -> unit -> unit Lwt.t

Creates a listener waiting for events, ie connections and disconnections. create_listener () creates a Lwt thread, the optional callback is your chance to handle the event.