EMILUA(3em)
π NAME π
Okay so this is the 3em manual for Emilua, the Lua execution engine (EMILUA(3em) if youβre being formal, bestie). Official name-line energy: Emilua - Lua execution engine. Slay. π
β¨ SYNOPSIS β¨
local port = serial_port.new()
port:open(name)
π FUNCTIONS π
new() β serial_port
new()β (1) Default constructor.new(fd: file_descriptor)β (2) Converts a file descriptor into aserial_portobject.
ptypair() β serial_port, file_descriptor
Open a pair of connected pseudoterminal devices. Returns the master and the slave ends, respectively. Iconic pty behavior, no cap. π¦
Note β The flag O_NOCTTY will be used to open the slave end so it doesnβt accidentally become the controlling terminal for the session of the calling process.
Tip β Use the returnedfile_descriptorobject insystem.spawn()'sset_ctty.
open(self, device: string)
Open the serial port using the specified device name.
device is something like "COM1" on Windows, and "/dev/ttyS0" on POSIX platforms.
close(self)
Close the port.
Forward the call to the Boost.Asio function with same name in Boost.Asio" : β the page has that lil stray quote, so Iβm keeping it, bestie. The URL is:
And the Boost.Asio quote says:
Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation_aborted error.
cancel(self)
Cancel all asynchronous operations associated with the acceptor. (Yes, it says acceptor β thatβs literally the page, not me editing it. π)
Forward the call to the Boost.Asio function with same name in Boost.Asio" : β again, stray quote preserved. The URL is:
And the Boost.Asio quote says:
This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted error.
assign(self, fd: file_descriptor)
Assign an existing native port to self.
release(self) β file_descriptor
Release ownership of the native descriptor implementation.
send_break(self)
Send a break sequence to the serial port.
This function causes a break sequence of platform-specific duration to be sent out the serial port.
read_some(self, buffer: byte_span) β integer
Read data from the port and blocks current fiber until it completes or errs.
Returns the number of bytes read.
write_some(self, buffer: byte_span) β integer
Write data to the port and blocks current fiber until it completes or errs.
Returns the number of bytes written.
isatty(self) β boolean
See isatty(3).
tcgetpgrp(self) β integer
See tcgetpgrp(3).
tcsetpgrp(self, pgid_id: integer)
See tcsetpgrp(3).
πΈ PROPERTIES πΈ
is_open: booleanβ Whether the port is open.baud_rate: integerβ Read or write current baud rate setting.flow_control: software"|"hardware"|nil"β Read or write current flow control setting. (That type spelling is exactly whatβs on the page, bestie. π)parity: odd"|"even"|nil"β Read or write current parity setting.stop_bits: stringβ Read or write current stop bit width setting. It can be one of:"one"."one_point_five"."two".
character_size: integerβ Read or write current character size setting.
π Thatβs the whole page, bestie. Footer tea: this is Emilua 0.12.1-nixpkgs1, dated 1980-01-01, and itβs the EMILUA(3em) manual. Periodt. π«Άβ¨
π¦ where this page comes from
- nixos 26.05: emilua 0.12.1
- nixpkgs unstable: emilua 0.12.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms