Commit Graph

6 Commits

Author SHA1 Message Date
Lephenixnoir 85d7fcf9e9
libfxlink: fix race condition leading to lost messages
Basically if the calculator sends two messages in a row, it is possible
for a single libusb_handle_events() to get both. And the comm structure
wasn't designed for that, because it could buffer only one message at a
time, which the user needed to read after event handling.

The comm structure now has a 16-message buffer, which should be more
than enough for any single event handling loop. On the user level this
has implications in that fxlink_device_finish_bulk_IN() must be called
*in a loop* after each event handling cycle.

Reported in Lephenixnoir/gint#27
2024-03-24 19:25:35 +01:00
Lephenixnoir 7b77fb9c0b
libfxlink: add status functions to avoid looking into fdev fields 2023-04-01 21:35:28 +02:00
Lephenixnoir 394d05726d
fxlink: add missing <unistd.h> to tui/tui-interactive.c 2023-03-28 21:43:59 +02:00
Lephenixnoir 3f4aa1e750
fxlink: usable TUI command setup + gintctl test commands 2023-03-26 11:41:55 +02:00
Lephenixnoir cef9d21076
fxlink: start implementing TUI commands (mainly gintctl tests) 2023-03-17 21:32:01 +01:00
Lephenixnoir 9d30377d90
fxlink: full rewrite; deeper device management and TUI
This commit rewrites the entire device management layer of fxlink on the
libusb side, providing new abstractions that support live/async device
management, including communication.

This system is put to use in a new TUI interactive mode (fxlink -t)
which can run in the background, connects to calculators automatically
without interfering with file transfer tools, and is much more detailed
in its interface than the previous interactive mode (fxlink -i).

The TUI mode will also soon be extended to support sending data.
2023-03-03 00:29:00 +01:00