Unify device handling. "-d" for all now

This commit is contained in:
Stefan `Sec` Zehl 2012-04-07 16:35:04 +02:00
parent e4a9868bcc
commit 54257783cb
3 changed files with 21 additions and 6 deletions

View File

@ -13,7 +13,12 @@ use r0ket;
$|=1; $|=1;
r0ket::r0ket_init(); my $ser;
if($ARGV[0] eq "-d"){
shift;
$ser=shift;
};
r0ket::r0ket_init($ser);
# Default openbeacon settings. # Default openbeacon settings.
r0ket::set_txmac(pack("H*","0102030201")); r0ket::set_txmac(pack("H*","0102030201"));

View File

@ -12,7 +12,12 @@ use r0ket;
$|=1; $|=1;
r0ket::r0ket_init(); my $ser;
if($ARGV[0] eq "-d"){
shift;
$ser=shift;
};
r0ket::r0ket_init($ser);
# Default mesh settings. # Default mesh settings.
r0ket::set_txmac("ORBIT"); r0ket::set_txmac("ORBIT");

View File

@ -14,14 +14,19 @@ use r0ket;
$|=1; $|=1;
r0ket::r0ket_init(); my $ser;
if($ARGV[0] eq "-d"){
shift;
$ser=shift;
};
r0ket::r0ket_init($ser);
my @fh; my @fh;
my $read; my $read;
if ($ARGV[0] =~ /^-?-?h/){ if ($ARGV[0] =~ /^-?-?h/ || $#ARGV == -1){
print STDERR "Mini-Help:\n"; print STDERR "Mini-Help:\n";
print STDERR "-s <devicename> (or \$R0KETBRIDGE)\n"; print STDERR "-d <devicename> (or \$R0KETBRIDGE)\n";
print STDERR "-w write beacon2nick file\n"; print STDERR "-w write beacon2nick file\n";
print STDERR "\n"; print STDERR "\n";
print STDERR "recv<num>: receive (number) pakets\n"; print STDERR "recv<num>: receive (number) pakets\n";
@ -181,7 +186,7 @@ if($cmd =~ /^r/){
if($scmd eq "t"){ if($scmd eq "t"){
$pkt.="T"; $pkt.="T";
$pkt.=chr(shift); #gen $pkt.=chr(shift); #gen
$pkt.=pack("N",scalar(time)+1*60*60); $pkt.=pack("N",scalar(time)+2*60*60);
$pkt.=pack("N",0); $pkt.=pack("N",0);
$pkt.=pack("N",0); $pkt.=pack("N",0);