ppelisset/php-serial

Serial port access for Unix system in PHP

Installs: 496

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/ppelisset/php-serial

v0.1.0 2022-08-12 14:33 UTC

This package is auto-updated.

Last update: 2025-12-12 21:56:32 UTC


README

This package is a test to port base of pyserial in pure PHP with FFI. It append a Serial object to access to a serial port on Linux/Darwin (MacOS).

Installation

php-serial require PHP8.1 and php-ffi enabled. To install this package, use composer to require package ppelisset/php-serial.

Documentation

PHPSerial\Serial::__construct() - Create a serial object with port configuration

PHPSerial\Serial::open - Open port and configure system to access to him

PHPSerial\Serial::isOpen - Check port is currently open

PHPSerial\Serial::read - Read a max of $count byte on serial port (less if not enough bytes is available). Default value is 0, to read all available bytes.

PHPSerial\Serial::write - Write data on serial port

PHPSerial\Serial::close - Close port access