This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Serial device manipulation toolkit

dev-master 2018-05-31 13:18 UTC

This package is auto-updated.

Last update: 2021-11-25 01:27:36 UTC



use DaveRandom\Serial\DeviceManager;
use DaveRandom\Serial\ParityMode;
use DaveRandom\Serial\ControlFlowMode;

// Use COM1
const COM_PORT = 1;

// Create the correct device manager for the current platform (only windows supported so far)
$manager = DeviceManager::create();

// Get the current config for COM1
$config = $manager->getConfigForDevice(COM_PORT);

// Modify some parameters and set the config
$manager->configureDevice(COM_PORT, $config);

// Open the device
$device = $manager->openDevice(COM_PORT);

// Send a message to the device

// Read some data from the device