package serialport

  1. Overview
  2. Docs

Module Serialport.NativeSource

Sourcemodule type S = sig ... end
Sourcemodule Native_intf : S with type t = Unix.file_descr with type port_name = string with type port_options = Unix.terminal_io -> Unix.terminal_io
include module type of struct include Native_intf end
type t = Unix.file_descr

Native serial port type.

and port_name = string

Native serial port name type.

and port_options = Unix.terminal_io -> Unix.terminal_io

Native serial port options type.

Initialize functions

val initialize_serial_port : t -> port_options -> unit

initialize_serial_port ser_port opts

val initialize_serial_port_by_port_opts : t -> Port_options.t -> unit

initialize_serial_port_by_port_opts ser_port opts

val flush_serial_port : t -> unit

flush_serial_port ser_port

Modem control functions

type serial_lines = Native_intf.serial_lines =
  1. | Request_to_send
    (*

    RTS

    *)
  2. | Data_terminal_ready
    (*

    DTR

    *)
val set_serial_modem_bits : t -> serial_lines -> bool -> unit

set_serial_modem_bits ser_port ser_lines flag sets specific bits in the modem control registers on a tty device.

Port exclusive settings

val set_serial_port_exclusive : t -> bool -> unit

set_serial_port_exclusive ser_port enable