AmbientOrb-Serial

 view release on metacpan or  search on metacpan

lib/AmbientOrb/Serial.pm  view on Meta::CPAN

    return $serial_port;
}
	
	

sub send {
    my ( $self, $message ) = @_;
    $self->serial_port->write( $message );
    my $result;

    #the docs say that you have to poll a lot to get the 
    #correct result back.  there is no doubt a better way 
    #to do this, but 1000 seems to be a nice magic number 
    for ( 1 .. 1000 )
    {
	$result = $self->serial_port->input;
	if ( $result =~ /\w+/ )
	{
	    last;
	}
    }



( run in 1.449 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )