readAvailable()no longer raises a PHP notice ("Device not configured") on every call once the device is gone. Under an event loop that was many thousand notices a second. The contract is unchanged: an empty string, andfeof($port->stream())tells you the port is gone.
Rewritten from scratch under the MIT License. No code from 2.x remains.
SerialPortopens and configures the device in the constructor: baud, data bits, parity, stop bits, flow control.read,readUntil,readLinewith a timeout;readAvailablenever waits;stream()for event loops.SerialPortLocator::candidates()lists serial devices on Linux, macOS and Windows.- Linux and macOS through
stty(device opened first, configured second). Windows throughmode, not yet verified on hardware. - Tests on real pseudo-terminals via
socat; loopback run on a Raspberry Pi indocs/verified-on.md.
- README now states the actual license of 2.x, GPL-3.0.