From f9e3c761e4d856a2a47c02502e7278c55cd88a75 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 29 Jul 2011 13:19:27 +0000 Subject: moved software tests to tools git-svn-id: https://svn.spreadspace.org/mur.sat@70 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/tests/beacon/decode.pl | 48 ----------------------------------------- software/tests/beacon/test.dat | 7 ------ 2 files changed, 55 deletions(-) delete mode 100755 software/tests/beacon/decode.pl delete mode 100644 software/tests/beacon/test.dat (limited to 'software/tests/beacon') diff --git a/software/tests/beacon/decode.pl b/software/tests/beacon/decode.pl deleted file mode 100755 index 28bf82b..0000000 --- a/software/tests/beacon/decode.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use MIME::Base32 qw( RFC ); - -my @beacons; -if(!$ARGV[0] || $ARGV[0] eq "-") { - @beacons = ; -} else { - open(my $fh, "<", $ARGV[0]) or die "Unable to open file " . $ARGV[0]; - @beacons = <$fh>; - close($fh) -} - -foreach(@beacons) { - my $beacon = $_; - $beacon =~ s/\s*$//g; - $beacon =~ s/^\s*//g; - - if($beacon =~ /([^ ]+) ([A-Z2-7]{3}) ([A-Z2-7])/) { - my $preamble = $1; - my $cnt = $2; - my $checksum = $3; - - my $cntval = unpack("n", MIME::Base32::decode($cnt . "=")) >> 1; - my $csval_recv = unpack("C", MIME::Base32::decode($checksum . "=")) >> 3; - - my $csval_calc = ord('N') - ord(' '); - my @values = unpack("C*", $preamble); - @values = (@values, unpack("C*", $cnt)); - foreach(@values) { $csval_calc ^= $_ - ord(' '); } - $csval_calc = ($csval_calc & 0x1F) ^ (($csval_calc & 0x20) >> 5); - - print $beacon . " -> cnt: " . $cntval; - if($csval_calc != $csval_recv) { - print " checksom wrong! (" . sprintf("%02X", $csval_recv) . " vs. " . sprintf("%02X", $csval_calc) . ")\n"; - } else { - print " checksom ok! (" . sprintf("%02X", $csval_recv) . ")\n"; - } - - - } else { - print $beacon . " -> Beacon format error!\n"; - } - - -} - diff --git a/software/tests/beacon/test.dat b/software/tests/beacon/test.dat deleted file mode 100644 index 3acc496..0000000 --- a/software/tests/beacon/test.dat +++ /dev/null @@ -1,7 +0,0 @@ -A OE6MUR FZO F -A OE6MUR FZP 2 -A OE6MUR FZQ 3 -A OE6MUR FZR Y -T OE6MUR FZK B -A OE6MUR FZL G -A OE6MUR FZM H \ No newline at end of file -- cgit v1.2.3