open usb serial ports and normal serials
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 9 Oct 2014 14:52:05 +0000 (16:52 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 9 Oct 2014 14:52:05 +0000 (16:52 +0200)
lib/Biblio/RFID/Reader/Serial.pm

index 39282f0..f954f39 100644 (file)
@@ -29,7 +29,7 @@ sub new {
 
 =head2 port
 
-Tries to open usb serial ports C</dev/ttyUSB*>
+Tries to open usb serial ports C</dev/ttyUSB*> and serial ports C</dev/ttyS*>
 
   my $serial_obj = $self->port;
 
@@ -45,7 +45,7 @@ sub port {
        return $self->{port} if defined $self->{port};
 
        my $settings = $self->serial_settings;
-       my @devices  = $ENV{RFID_DEVICE} ? ( $ENV{RFID_DEVICE} ) : glob '/dev/ttyUSB*';
+       my @devices  = $ENV{RFID_DEVICE} ? ( $ENV{RFID_DEVICE} ) : glob '/dev/ttyUSB* /dev/ttyS*';
        warn "# port devices ",dump(@devices);
 
        foreach my $device ( @devices ) {