summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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";
}