[BRLTTY] Low-level BrlAPI questions

Aura Kelloniemi kaura.dev at sange.fi
Fri May 7 07:19:50 EDT 2021


Hello

Here is another fork of this thread regarding connection states.

The BrlAPI reference manual explains the various connection states, but the
API has been expanded since the documentation was written, and there are
details missing.

Looking at the server code, I noticed, that the server is not always strict
about the connection state. For example it seems that the server can be
queried for parameter values regardless of the connection state – at least I
did not find any hard assertions preventing this.

Anyways, the information that I am looking for is:
- what packets can be sent/received in which mode, and
- are the connection modes mutually exclusive – i.e. can the connection be in
raw and tty modes simultaneously – i.e. the connection returns to TTY mode
after leaving raw mode if TTY mode was active before entering raw mode.

The reason why I ask these questions is Rust's type system: I want to help the
client programmer by making sure that they cannot accidentally call invalid
methods. The Rust compiler can prevent this, if the user-facing connection
type changes with the connection mode. I.e. if the user holds a
Connection<NormalMode> object, they cannot call the write method, instead they
need to call enter_tty_mode in order to acquire a Connection<TtyMode> object
which has a write method. In order to do this properly, I need to work out all
the corner cases, like should Connection::<RawMode>::leave_raw_mode return a
Connection<TtyMode> or Connection<NormalMode> object or does it depend on the
original connection state (before entering raw mode).

Thanks in advance!

-- 
Aura


More information about the BRLTTY mailing list