From 04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 1 Jul 2009 15:52:28 +0000 Subject: move serialPort function from mouse.pm to detect_devices.pm --- perl-install/detect_devices.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 02dd6ef4f..251bf4fe4 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -544,6 +544,11 @@ sub getInputDevices_and_usb() { @l; } +sub serialPorts() { map { "ttyS$_" } 0..7 } +sub serialPort2text { + $_[0] =~ /ttyS(\d+)/ ? "$_[0] / COM" . ($1 + 1) : $_[0]; +} + sub getSerialModem { my ($modules_conf, $o_mouse) = @_; my $mouse = $o_mouse || {}; @@ -554,7 +559,7 @@ sub getSerialModem { my @modems; probeSerialDevices(); - foreach my $port (map { "ttyS$_" } (0..7)) { + foreach my $port (serialPorts()) { next if $mouse->{device} =~ /$port/; my $device = "/dev/$port"; next if !-e $device || !hasModem($device); -- cgit v1.2.1