[248975]: / PC_Mainboard / Apps / cards / usb / card.mli  Maximize  Restore  History

Download this file

33 lines (24 with data), 890 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(*
* card.mli
* --------
* Copyright : (c) 2009, Jeremie Dimino <jeremie@dimino.org>
* Licence : BSD3
*
* This file is a part of [kro]bot.
*)
(** Lowlevel card interfaces *)
type t
(** Type of an opened card *)
val open_card : vendor_id : int -> product_id : int -> t Lwt.t
(** Opten the card with given product-id and vendor-id *)
val close : t -> unit Lwt.t
val make_buffer : unit -> string
(** Creates a new buffer for serialization (with the right size) *)
val send_request : t -> int -> string -> string Lwt.t
(** [send_request card request data] sends a request to the USB
device and wait for the reply *)
val send_command : t -> int -> string -> unit Lwt.t
(** Sends a command to the device *)
val connect : t -> int -> < event : string React.event; stop : unit >
(** [connect card command] connects to signals [command] emitted by
[card] *)