package mindstorm

  1. Overview
  2. Docs
type usb
type bluetooth
type 'a conn
val connect_bluetooth : ?check_status:bool -> string -> bluetooth conn
module USB : sig ... end
val close : 'a conn -> unit
type error =
  1. | No_more_handles
  2. | No_space
  3. | No_more_files
  4. | EOF_expected
  5. | Not_a_linear_file
  6. | No_linear_space
  7. | Undefined_error
  8. | File_is_busy
  9. | No_write_buffers
  10. | Append_not_possible
  11. | File_is_full
  12. | File_exists
  13. | Module_not_found
  14. | Out_of_boundary
  15. | Illegal_file_name
  16. | Pending
  17. | Empty_mailbox
  18. | Failed
  19. | Unknown
  20. | Insane
  21. | Out_of_range
  22. | Bus_error
  23. | Buffer_full
  24. | Invalid_conn
  25. | Busy_conn
  26. | No_program
  27. | Bad_size
  28. | Bad_mailbox
  29. | Bad_field
  30. | Bad_io
  31. | Out_of_memory
  32. | Bad_arg
exception Error of error
exception File_not_found
module Program : sig ... end
module Motor : sig ... end
module Sensor : sig ... end
module Sound : sig ... end
module Message : sig ... end
type 'a in_channel
val open_in : 'a conn -> string -> 'a in_channel
val in_channel_length : 'a in_channel -> int
val close_in : 'a in_channel -> unit
val input : 'a in_channel -> string -> int -> int -> int
type 'a out_channel
type out_flag = [
  1. | `Append
  2. | `Data of int
  3. | `File of int
  4. | `Linear of int
]
val open_out : 'a conn -> out_flag -> string -> 'a out_channel
val close_out : 'a out_channel -> unit
val output : 'a out_channel -> string -> int -> int -> int
val remove : 'a conn -> string -> unit
module Find : sig ... end
val firmware_version : 'a conn -> int * int * int * int
val set_brick_name : ?check_status:bool -> 'a conn -> string -> unit
type brick_info = {
  1. brick_name : string;
  2. bluetooth_addr : string;
  3. signal_strength : int;
  4. free_user_flash : int;
}
val get_device_info : 'a conn -> brick_info
val keep_alive : 'a conn -> int
val battery_level : 'a conn -> int
val delete_user_flash : 'a conn -> unit
val bluetooth_reset : usb conn -> unit
val boot : usb conn -> unit
val poll_length : 'a conn -> [ `High_speed_buffer | `Poll_buffer ] -> int
val poll_command : 'a conn -> [ `High_speed_buffer | `Poll_buffer ] -> int -> int * string
OCaml

Innovation. Community. Security.