summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-07-23 12:55:22 +0000
committerChristian Pointner <equinox@mur.at>2011-07-23 12:55:22 +0000
commit1ec2f22a92c7abd6f8f64b770ab88d3202735832 (patch)
tree906f694ea97f78c41bf4562a81f59dece35d34da /software
parentadded beacon decoder script (diff)
beacon decoder cleanup
git-svn-id: https://svn.spreadspace.org/mur.sat@44 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software')
-rwxr-xr-xsoftware/tests/beacon/decode.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/software/tests/beacon/decode.pl b/software/tests/beacon/decode.pl
index 2dc19e8..2d570c0 100755
--- a/software/tests/beacon/decode.pl
+++ b/software/tests/beacon/decode.pl
@@ -12,9 +12,10 @@ if(!$ARGV[0] || $ARGV[0] eq "-") {
close($fh)
}
-foreach(@beacons) {
- chomp;
+foreach(@beacons) {
my $beacon = $_;
+ $beacon =~ s/\s*$//g;
+ $beacon =~ s/^\s*//g;
if($beacon =~ /([^ ]+) ([A-Z2-7]{3}) ([A-Z2-7])/) {
my $preamble = $1;
@@ -30,7 +31,7 @@ foreach(@beacons) {
foreach(@values) { $csval_calc ^= $_ - ord(' '); }
$csval_calc = ($csval_calc & 0x1F) ^ (($csval_calc & 0x20) >> 5);
- print $beacon . " -> (cnt: " . sprintf("%04X", $cntval) . ") ";
+ print $beacon . " -> cnt: " . sprintf("%04X", $cntval);
if($csval_calc != $csval_recv) {
print " checksom wrong! (" . sprintf("%02X", $csval_recv) . " vs. " . sprintf("%02X", $csval_calc) . ")\n";
} else {
@@ -39,7 +40,7 @@ foreach(@beacons) {
} else {
- print "Beacon format wrong '" . $beacon . "'\n";
+ print $beacon . " -> Beacon format error!\n";
}