EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

πŸŽ€ 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 a serial_port object.

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 returned file_descriptor object in system.spawn()'s set_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:

https://www.boost.org/doc/libs/1_78_0/doc/html/boost_asio/reference/basic_serial_port/close/overload2.html

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:

https://www.boost.org/doc/libs/1_78_0/doc/html/boost_asio/reference/basic_serial_port/cancel/overload2.html

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