Git is being dumb about
67c071633d This PR is identical to that one and will supercede it.
Fix --auto new and --auto latest on MacOS.
'device_list' was both a global (eww!) and a local inside
tty_search_for_serial_devices(). The local got set and
returned, so it looked sane, but the caller used the global
instead of the return value of the function it had just
called, meaning (global) device_list was NULL while
(ignored, local) device_list held a perfectly lovely
linked list.
Tested:
tio --auto new waits for a new device to appare and connects
tio --latest will connect to the most recently attached device
which, in most worlds, is the most recently enumerated USB
device, conveniently skipping all the bluetooth nonsense.
If the lone USB device is disconnected, it then connects to
one of those, meaning you really do have to restart tio.
for MacOS
- Added error handling and memory management
- Improved code readability and consistency
- Updated coding style to match project conventions
- Added robust error checking for CoreFoundation property retrieval
- Implemented more defensive memory allocation and type checking
- Switched to using callout device key for more reliable device discovery
- Added single-line block bracing consistent with project style
- Improved comments and code formatting
- Used `kIOCalloutDeviceKey` instead of `kIODialinDeviceKey` for device path retrieval
- Enhanced type checking for CoreFoundation objects
- Simplified memory management and error handling
- Added additional logging and error reporting
- Verified functionality on MacOS 10.11 and 10.15. Tested with ESP32-P4 and ESP32-BOX
Resolves potential device discovery and memory management issues in the MacOS serial device detection code.
+ Add missing timestamp-format epoch
+ Update send_ to use fsync and tcdrain like normal tty_sync does
+ Rework read_line to save partial line at timeout
+ Simplified read_line to reduce cyclomatic complexity
+ renamed example files read.lua and read_line.lua
+ moved #define READ_LINE_SIZE to top of file
+ renamed g_linebuf to linebuf, and moved it into read_line as a static variable
This caused a problem for some highly timing sensitive modem read-eval-print
loops because the input line and line termination characters (cr/nl) would be
shifted out on the UART with too big delay inbetween because of two
syncs.
To include the contents of another configuration file simply do e.g.:
[include raspberrypi.conf]
Also, included file can include other files which can include other
files etc.
This feature is useful for managing many configuration files and sharing
configuration files with others.
Use up and down arrow keys to navigate history.
Use left and right arrow keys to move cursor back and forth.
We try mimic the behaviour of GNU readline which we can not use because
we also need to react to key commands.