mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-05 04:20:37 +02:00
atrf-path/genpathprof: profile generator
- genpathprof: generate a profile for atrf-path from measurements and/or user-provided limits - profile.example: example profile
This commit is contained in:
parent
87b76af2fa
commit
66d641f624
53
tools/atrf-path/genpathprof
Executable file
53
tools/atrf-path/genpathprof
Executable file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# atrf-path/genpathprof - Generate profile for atrf-path
|
||||
#
|
||||
# Written 2011 by Werner Almesberger
|
||||
# Copyright 2011 Werner Almesberger
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
|
||||
sub usage
|
||||
{
|
||||
print STDERR <<"END"
|
||||
usage: $0 below above [file ...]
|
||||
|
||||
below/above define either absolute values or clearances:
|
||||
10 = 10.0 dBm
|
||||
-3.5 = -3.5 dBm
|
||||
+5 = 5 dBm below or above the minimum/maximum measurement
|
||||
END
|
||||
;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$below = shift @ARGV;
|
||||
$above = shift @ARGV;
|
||||
|
||||
&usage unless defined $below && defined $above;
|
||||
|
||||
while (<>) {
|
||||
next unless /^(\d+)\.5\s+(-?\d+(\.\d*))\s+/;
|
||||
$f = int(($1+2.5)/5)*5;
|
||||
$min{$f} = $2 if $min{$f} > $2 || !defined $min{$f};
|
||||
$max{$f} = $2 if $max{$f} < $2 || !defined $max{$f};
|
||||
}
|
||||
print "# min\tmax\t Chan\tMHz\n";
|
||||
for ($i = 0; $i != 16; $i++) {
|
||||
$f = 2405+5*$i;
|
||||
if ($below =~ /^\+/) {
|
||||
$min = $min{$f}-$';
|
||||
} else {
|
||||
$min = $below;
|
||||
}
|
||||
if ($above =~ /^\+/) {
|
||||
$max = $max{$f}+$';
|
||||
} else {
|
||||
$max = $above;
|
||||
}
|
||||
printf("%.2f\t%.2f\t# %d\t%d\n", $min, $max, $i+11, $f);
|
||||
}
|
17
tools/atrf-path/profile.example
Normal file
17
tools/atrf-path/profile.example
Normal file
@ -0,0 +1,17 @@
|
||||
# min max Chan MHz
|
||||
-61.00 -40.00 # 11 2405
|
||||
-61.00 -40.00 # 12 2410
|
||||
-60.85 -40.00 # 13 2415
|
||||
-60.70 -40.00 # 14 2420
|
||||
-60.25 -40.00 # 15 2425
|
||||
-59.20 -40.00 # 16 2430
|
||||
-58.45 -40.00 # 17 2435
|
||||
-58.90 -40.00 # 18 2440
|
||||
-58.60 -40.00 # 19 2445
|
||||
-60.10 -40.00 # 20 2450
|
||||
-61.00 -40.00 # 21 2455
|
||||
-61.45 -40.00 # 22 2460
|
||||
-62.65 -40.00 # 23 2465
|
||||
-63.70 -40.00 # 24 2470
|
||||
-64.30 -40.00 # 25 2475
|
||||
-65.05 -40.00 # 26 2480
|
Loading…
Reference in New Issue
Block a user