https://github.com/daverandom/serial
Serial device manipulation toolkit
https://github.com/daverandom/serial
Last synced: 8 months ago
JSON representation
Serial device manipulation toolkit
- Host: GitHub
- URL: https://github.com/daverandom/serial
- Owner: DaveRandom
- License: mit
- Created: 2018-05-31T13:19:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T13:19:29.000Z (about 8 years ago)
- Last Synced: 2025-10-09T22:14:17.800Z (8 months ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# Serial
```php
getConfigForDevice(COM_PORT);
var_dump($config);
// Modify some parameters and set the config
$config
->setBaudRate(9600)
->setParityMode(ParityMode::NONE)
->setDataBits(8)
->setStopBits(1)
->setControlFlowMode(ControlFlowMode::NONE)
;
$manager->configureDevice(COM_PORT, $config);
// Open the device
$device = $manager->openDevice(COM_PORT);
// Send a message to the device
$device->write('D');
// Read some data from the device
var_dump($device->read());
```