From 54257783cb58b420a11a1ca5b1eac9b9d2755663 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sat, 7 Apr 2012 16:35:04 +0200 Subject: [PATCH] Unify device handling. "-d" for all now --- tools/mesh/beacontrace.pl | 7 ++++++- tools/mesh/meshtrace.pl | 7 ++++++- tools/mesh/rf | 13 +++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tools/mesh/beacontrace.pl b/tools/mesh/beacontrace.pl index 8b71c66..ea632fc 100755 --- a/tools/mesh/beacontrace.pl +++ b/tools/mesh/beacontrace.pl @@ -13,7 +13,12 @@ use r0ket; $|=1; -r0ket::r0ket_init(); +my $ser; +if($ARGV[0] eq "-d"){ + shift; + $ser=shift; +}; +r0ket::r0ket_init($ser); # Default openbeacon settings. r0ket::set_txmac(pack("H*","0102030201")); diff --git a/tools/mesh/meshtrace.pl b/tools/mesh/meshtrace.pl index 2ba2a33..c30caa2 100755 --- a/tools/mesh/meshtrace.pl +++ b/tools/mesh/meshtrace.pl @@ -12,7 +12,12 @@ use r0ket; $|=1; -r0ket::r0ket_init(); +my $ser; +if($ARGV[0] eq "-d"){ + shift; + $ser=shift; +}; +r0ket::r0ket_init($ser); # Default mesh settings. r0ket::set_txmac("ORBIT"); diff --git a/tools/mesh/rf b/tools/mesh/rf index ccc5894..2f23e76 100755 --- a/tools/mesh/rf +++ b/tools/mesh/rf @@ -14,14 +14,19 @@ use r0ket; $|=1; -r0ket::r0ket_init(); +my $ser; +if($ARGV[0] eq "-d"){ + shift; + $ser=shift; +}; +r0ket::r0ket_init($ser); my @fh; my $read; -if ($ARGV[0] =~ /^-?-?h/){ +if ($ARGV[0] =~ /^-?-?h/ || $#ARGV == -1){ print STDERR "Mini-Help:\n"; - print STDERR "-s (or \$R0KETBRIDGE)\n"; + print STDERR "-d (or \$R0KETBRIDGE)\n"; print STDERR "-w write beacon2nick file\n"; print STDERR "\n"; print STDERR "recv: receive (number) pakets\n"; @@ -181,7 +186,7 @@ if($cmd =~ /^r/){ if($scmd eq "t"){ $pkt.="T"; $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);