Module Usb_fun

module Usb_fun: sig  end
Higher level interface to libusb

Type Definitions

type write_endpoint = int 
type read_endpoint = int 

type endpoint =
| ReadEp of read_endpoint
| WriteEp of write_endpoint

type device = {
   filename : string;
   bus : unit -> bus;
   descriptor : Usb.usb_device_descriptor;
   ep : endpoint array;
   usb_device : Usb.usb_device Com.opaque;
Record that rapresents a Usb.usb_device:

type bus = {
   dirname : string;
   devices : device list;
Record that rapresents a Usb.usb_bus:

Utility functions

val is_readable_ep : endpoint -> bool
Returns true if the endpoint is of type Usb_fun.read_endpoint, false if it is of type Usb_fun.write_endpoint
val bus_of_usb_bus : Usb.usb_bus Com.opaque -> bus
bus_of_usb_bus b
Returns a Usb_fun.bus record corresponding to b
val get_busses_list : unit -> bus list
Returns an ocaml list of Usb_fun.bus values corresponding to the C-style list returned by Usb.usb_get_busses
val open_dev : device -> Usb.usb_dev_handle Com.opaque option
open_dev dev
Returns (Some Usb.usb_dev_handle) returned by Usb.usb_open dev if it is not NULL, or else it returns None