Add "quiet" flag.
This commit is contained in:
parent
69bfec0359
commit
2c03614af8
|
@ -13,6 +13,7 @@ use Time::HiRes;
|
||||||
|
|
||||||
our $verbose=0;
|
our $verbose=0;
|
||||||
our $bridge; # Open device
|
our $bridge; # Open device
|
||||||
|
our $quiet=0;
|
||||||
|
|
||||||
### Utility
|
### Utility
|
||||||
sub sprint{
|
sub sprint{
|
||||||
|
@ -111,7 +112,7 @@ sub get_packet{
|
||||||
if($firstpkt){
|
if($firstpkt){
|
||||||
$firstpkt--;
|
$firstpkt--;
|
||||||
}else{
|
}else{
|
||||||
print STDERR "Unparseable stuff: <",sprint($1),">\n";
|
print STDERR "Unparseable stuff: <",sprint($1),">\n" if(!$quiet);
|
||||||
};
|
};
|
||||||
}elsif ($buffer =~ s/^\\2\\0//s){
|
}elsif ($buffer =~ s/^\\2\\0//s){
|
||||||
return 'ack'; # In-band signalling. Evil %)
|
return 'ack'; # In-band signalling. Evil %)
|
||||||
|
@ -128,7 +129,7 @@ sub get_packet{
|
||||||
|
|
||||||
sub rest{
|
sub rest{
|
||||||
if(length($buffer)>0){
|
if(length($buffer)>0){
|
||||||
print "rest: <", sprint($buffer), ">\n";
|
print "rest: <", sprint($buffer), ">\n" if(!$quiet);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -255,7 +256,7 @@ sub nice_beacon{
|
||||||
$out->{idx},
|
$out->{idx},
|
||||||
$out->{beacon};
|
$out->{beacon};
|
||||||
if(unpack("H*",substr($pkt,12,2)) ne "ffff"){
|
if(unpack("H*",substr($pkt,12,2)) ne "ffff"){
|
||||||
print "unused=",unpack("H*",substr($pkt,12,2))," ";
|
print "unused=",unpack("H*",substr($pkt,12,2))," " if (!$quiet);
|
||||||
};
|
};
|
||||||
}elsif($type eq "\x23"){
|
}elsif($type eq "\x23"){
|
||||||
$out->{type}= "nick";
|
$out->{type}= "nick";
|
||||||
|
|
Loading…
Reference in New Issue