package serialport

  1. Overview
  2. Docs

Module Serialport_lwtSource

Sourcetype t

Interface for a opened serial port.

Sourceval open_communication : ?switch:Lwt_switch.t -> ?exclusive:bool -> opts:Port_options.t -> string -> t Lwt.t

open_communication ?switch ?exclusive ~opts port_name open the serial port using the specified opts configuration.

  • raises Unix.Unix_error
Sourceval with_open_communication : ?exclusive:bool -> opts:Port_options.t -> string -> (t -> 'a Lwt.t) -> 'a Lwt.t

with_open_communication ?exclusive ~opts port_name callback similar to open_communication but with an auto-closing mechanism.

  • raises Unix.Unix_error
Sourceval close_communication : t -> unit Lwt.t

close ser_port close the serial port.

I/O

to_channels ser_port

  • returns

    Channel abstraction pair for input/output tasks.

Modem

Sourcemodule Modem : sig ... end

Modem controls.

Exclusive

Sourceval set_exclusive : t -> bool -> unit

set_exclusive ser_port enable

Exceptions

Sourceexception Not_found_port of string

raise if the port name does not exist.

Pretty print

Sourceval pp : Lwt_fmt.formatter -> t -> unit Lwt.t