sub_getgps.pl 548 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
sub sub_getgps {
	print ">> Use GPS...? [y/n] 	 				: " ;
	chop($gpsans = <STDIN>) ;
	print "\n" ;
	if ($gpsans =~ /[yY]/) {
	print ">> Port name...?  	 				: " ;
	chop($gpsport = <STDIN>) ;
	print "\n" ;
	print ">> Baud rate...?  	 				: " ;
	chop($gpsbaud = <STDIN>) ;
	print "\n" ;
	$gps = new GPS::NMEA(  'Port'      => "$gpsport",
	                       'Baud'      =>  $gpsbaud,
			);	
15
16
17
18
19
20
21
	$gpson = 1 ;
	} else {
	$gpson   = 0 ;
	$gpsport = "NaN" ;
	$gpsbaud = "NaN" ;
	$gps     = "NaN" ;
	}
22
23
	
	
24
	return ($gps,$gpson,$gpsport,$gpsbaud) ;
25
26
27
}

1;