17 Jan 2013 22:53:10 UTC
- Distribution: AnyEvent-SerialPort
- Module version: 1.130171
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (1178 / 0 / 0)
- KwaliteeBus factor: 1
- 98.44% Coverage
- License: perl_5
- Activity24 month
- Download (13.61KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
AnyEvent::SerialPort - AnyEvent::Handle subclass for serial ports
use AnyEvent; use AnyEvent::SerialPort; my $cv = AnyEvent->condvar; my $hdl; $hdl = AnyEvent::SerialPort->new( serial_port => '/dev/ttyUSB0', # other AnyEvent::Handle arguments here ); # or to use something other than 9600 8n1 raw $hdl = AnyEvent::SerialPort->new ( serial_port => [ '/dev/ttyUSB0', [ baudrate => 4800 ], # other [ "Device::SerialPort setter name" => \@arguments ] here ], # other AnyEvent::Handle arguments here ); # obtain the Device::SerialPort object my $port = $hdl->serial_port;
This module is a subclass of AnyEvent::Handle for serial ports.
IMPORTANT: This is a new API and is still subject to change. Feedback and suggestions would be very welcome.
Constructs an AnyEvent::SerialPort object based on the given parameters. The permitted parameters are those of the AnyEvent::Handle super class constructor (except
fhwhich would not make sense) and a
serial_portparameter. The value of the serial port parameter may be either:
the full path name of the serial device, or
a list reference containing the full path name of the serial device and zero or more list references each containing a Device::SerialPort method name and arguments to be executed on the wrapped Device::SerialPort object.
By default, the following setter methods are called on the underlying Device::SerialPort object:
The second form of the
serial_portparameter value described above can be used to override these settings and apply additional setters.
See the "SYNOPSIS" for examples.
Return the wrapped Device::SerialPort object.
Mark Hindess <firstname.lastname@example.org>
This software is copyright (c) 2013 by Mark Hindess.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install AnyEvent::SerialPort, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install AnyEvent::SerialPort
For more information on module installation, please visit the detailed CPAN module installation guide.