Merge pull request #480 from bjc/freebsd-port
Add rules and scripts for building on FreeBSD.pull/499/head
commit
b9b0a5de0a
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Scan all USB devices to find the Model 01's modem device number.
|
||||||
|
#
|
||||||
|
my @output = qx(/usr/sbin/usbconfig show_ifdrv);
|
||||||
|
my $serial_port_number;
|
||||||
|
|
||||||
|
foreach my $line (@output) {
|
||||||
|
chomp $line;
|
||||||
|
|
||||||
|
next unless $line =~ m/umodem(\d+):.*Keyboardio Model 01/;
|
||||||
|
$serial_port_number = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
die "Can't find Model 01" unless defined($serial_port_number);
|
||||||
|
|
||||||
|
my $serial_port_name = "/dev/cuaU$serial_port_number";
|
||||||
|
die "Missing serial port at $serial_port_name" unless -e $serial_port_name;
|
||||||
|
print "$serial_port_name\n";
|
||||||
|
exit 0;
|
Loading…
Reference in new issue