package usbmux

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Module containing types definitions and functions for communicating with usbmuxd.

type msg_version_t =
  1. | Binary
  2. | Plist

A plist can be either binary or XML.

type conn_code =
  1. | Success
  2. | Device_requested_not_connected
  3. | Port_requested_not_available
  4. | Malformed_request

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

type event =
  1. | Attached of device_t
  2. | Detached of int

A device event with associated metadata.

and device_t = {
  1. serial_number : string;
  2. connection_speed : int;
  3. connection_type : string;
  4. product_id : int;
  5. location_id : int;
  6. device_id : int;
}

High level self documenting metadata about the device connection.

type msg_t =
  1. | Result of conn_code
  2. | Event of event

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

type exn +=
  1. | 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.

OCaml

Innovation. Community. Security.