12345678910111213141516171819202122232425262728293031(** Configuration for opening a Serial connection *)moduletypeConfig_T=sigvalconnection:Connection.tend(** Main module *)moduletypeT=sig(** Location of opened serial port *)valport:string(** Connection Baud rate *)valbaud_rate:int(** Submodule for values that should not be used externally *)modulePrivate:sigvalstate:Connection.tendvalread_line:unit->stringLwt.tvalwrite_line:string->unitLwt.tvalwrite:string->unitLwt.t(** Wait for the specified string to be received. *)valwait_for_line:string->timeout_s:(floatoption)->Wait_for.tLwt.t(** Open two-way communication between std(i/o) and the Serial device.
Supply [Some "$KEYWORD"] to exit the loop upon entering the specified
line in stdin. Supplying [None] causes this function to loop indefinitely. *)valio_loop:stringoption->unitLwt.tend