From 083632066c8b364437aac6754dafef2708c681cb Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 23 May 2008 09:14:22 +0000 Subject: try to use ttyUSB2 as control device first --- lib/network/connection/cellular_card.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm index 432a048..5eaa7c3 100644 --- a/lib/network/connection/cellular_card.pm +++ b/lib/network/connection/cellular_card.pm @@ -62,10 +62,13 @@ sub get_tty_device { sub get_control_device { my ($self) = @_; my $tty_device = $self->get_tty_device; - my $usb_control_device = "/dev/ttyUSB1"; - $tty_device eq "/dev/ttyUSB0" && -e $usb_control_device ? - $usb_control_device : - $tty_device; + if ($tty_device eq "/dev/ttyUSB0") { + for my $id (2, 1) { + my $usb_control_device = "/dev/ttyUSB" . $id; + return $usb_control_device if -e $usb_control_device; + } + } + $tty_device; } sub network_scan_is_slow() { 1 } -- cgit v1.2.1