ipsocode / hypervel-serial
Serial port connections for Hypervel: named connections over a tty, framed protocols with configurable encodings and checksums, coroutine-safe transactions with retries, and a simulator for testing without the hardware
Requires
- hypervel/components: 0.4.x-dev
Requires (Dev)
- brianium/paratest: ^7.27.2
- fakerphp/faker: ^1.24
- friendsofphp/php-cs-fixer: ^3.57.2
- hypervel/testbench: ^0.4
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.2.15
- phpunit/phpunit: ~13.4.3
Suggests
- ext-dio: Required by the dio transport, which opens the device and sets its line settings (baud, data bits, stop bits, parity) from PHP.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-31 00:05:14 UTC
README
Serial ports for Hypervel: named connections to a device over a tty, framed protocols with configurable encodings and checksums, transactions that never interleave between coroutines and retry what fails, and a simulator for working without the hardware.
Warning
Development only — do not use this package in production until Hypervel 0.4 is released.
It is built for Hypervel 0.4, which has no release yet: 0.4 exists only as the
0.4.x-dev branch of hypervel/components,
and this package is developed and tested against that moving branch. Until 0.4
ships, anything here can change without a deprecation period — the API and the
configuration included. Use it to evaluate or to build against Hypervel 0.4,
and pin the version you tested.
Requirements
- PHP 8.4 or newer (CI runs 8.4 and 8.5)
- Hypervel 0.4, which today means
hypervel/componentsat0.4.x-dev. The package requireshypervel/componentsitself rather than its split packages. - A serial device the application can open, such as
/dev/ttyUSB0, with its line settings applied bystty(why), or ext-dio to have the package apply them.
Installation
composer require ipsocode/hypervel-serial php artisan vendor:publish --tag=serial-config
Hypervel 0.4 is only available as a dev branch, so your application's
composer.json must already allow it: "minimum-stability": "dev" together
with "prefer-stable": true.
Usage
use Ipsocode\Serial\Facades\Serial; use Ipsocode\Serial\Request; $result = Serial::connection()->transact(new Request(code: 0x04)); if ($result->success()) { $firmware = $result->data(); }
Getting started shows the same with a device's commands as an enum, and a protocol of its own.
Documentation
The documentation lists every page in reading order.
Contributing
The development setup, the checks CI runs, the coroutine-safety rules every change is held to, and how releases are cut are in CONTRIBUTING.md.
Security
Report security issues privately, as described in SECURITY.md, rather than in a public issue.
License
MIT. See LICENSE.