2017 © Pedro Peláez
 

library serially

Talk to serial devices in PHP

image

themainframe/serially

Talk to serial devices in PHP

  • Sunday, February 2, 2014
  • by themainframe
  • Repository
  • 2 Watchers
  • 2 Stars
  • 14 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Serially

Talk to serial devices in PHP from various* platforms., (*1)

Getting It

Get Composer. Make your project require Serially., (*2)

composer require themainframe/serially dev-master

Examples

The ConnectionManager class enables you to write platform-portable code against Serially by abstracting the platform detection process away from your code., (*3)

The getConnection method returns an connection instance implementing ConnectionInterface suitable for the current platform., (*4)

$manager = new ConnectionManager;
$connection = $manager->getConnection('/dev/ttyS0');
$connection->writeLine('Hello from PHP');

Logging

Debugging serial devices and the communication between them can be difficult. Serially logs to a PSR-3-conformant LoggerInterface to make the process easier., (*5)

// $myLogger implements LoggerInterface
// Connections created with this manager will be logged to $myLogger
$manager->setLogger($myLogger);

Limitations

Reading bytes from serial ports is a challenge in PHP. Depending on the platform, you may observe that data received before readLine() or readByte() is called may or may not be available., (*6)

Platform agility is a work-in-progress. The PlatformSpecific namespace contains platform-specific connection implementations (of ConnectionInterface) for Mac OS X (Darwin) and Linux. A Windows one may emerge soon., (*7)

Attributions & Thanks

The Versions

02/02 2014

dev-master

9999999-dev

Talk to serial devices in PHP

  Sources   Download

MIT

The Requires