Merge branch 'develop' of https://github.com/Schrolli91/BOSWatch into develop

This commit is contained in:
Bastian Schroll 2015-07-03 23:28:47 +02:00
commit 18acae9e36
2 changed files with 105 additions and 37 deletions

View file

@ -330,29 +330,26 @@ try:
logging.debug("cannot start multimon-ng", exc_info=True)
exit(1)
# multimon-ng started, continue...
logging.debug("start decoding")
#
# Get decoded data from multimon-ng and call BOSWatch-decoder
#
while True:
if not args.test:
if not args.test:
logging.debug("start decoding")
while True:
decoded = str(multimon_ng.stdout.readline()) #Get line data from multimon stdout
from includes import decoder
decoder.decode(converter.freqToHz(args.freq), decoded)
else:
# Test-strings only for develop
#decoded = "ZVEI2: 25832"
#decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct\n'"
#decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct\n'"
#decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct\n'"
#decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct\n'"
#decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct\n'"
decoded = "POCSAG1200: Address: 1234567 Function: 1 Alpha: Hello World"
time.sleep(1)
from includes import decoder
decoder.decode(converter.freqToHz(args.freq), decoded)
else:
logging.debug("start testing")
testFile = open(globals.script_path+"/testdata/testdata.txt","r")
for testData in testFile:
if (len(testData) > 1) and ("#" not in testData[0]):
logging.info("Testdata: %s", testData.rstrip(' \t\n\r'))
from includes import decoder
decoder.decode(converter.freqToHz(args.freq), testData)
time.sleep(1)
logging.debug("test finished")
except KeyboardInterrupt:
logging.warning("Keyboard Interrupt")

109
testdata/testdata.txt vendored
View file

@ -1,30 +1,101 @@
#Testdata for the BOSWatch Test Mode function
#Data in Multimon-NG Raw Format
#Data is alternately passed to the decoder to simulate an used Radio-Frequency
# Testdata for the BOSWatch Test Mode function
# Data in Multimon-NG Raw Format
# Data is alternately passed to the decoder to simulate an used Radio-Frequency
#POCSAG
#all bitrates, all functions, with and without text, duplicates same and other msg
#
# POCSAG
# ------
#
#witch csv
POCSAG512: Address: 1234567 Function: 1 Alpha: Hello World
#
# The following settings in config.ini are expected for pocsag
#
# [BOSWatch]
# useDescription = 1
# doubleFilter_ignore_entries = 10
# doubleFilter_check_msg = 1
#
# [POC]
# deny_ric = 7777777
# filter_range_start = 1000000
# filter_range_end = 8999999
# idDescribed = 1
#
#without csv
POCSAG1200: Address: 2345678 Function: 2 Alpha: Hello World
POCSAG2400: Address: 3456789 Function: 3 Alpha: Hello World
# bitrate
POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test: okay
POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay
POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay
#OHNE TEXT????
POCSAG1200: Address: 1358246 Function: 4
# function-code
POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay
POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay
POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay
POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay
#duplicate with same and other msg
POCSAG1200: Address: 2345678 Function: 2 Alpha: Hello World
POCSAG1200: Address: 2345678 Function: 2 Alpha: Bye Earth
# witch csv
POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv
#invalid
POCSAG1200: Address: 123567 Function: 1 Alpha: Hello World
# without csv
POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv
POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv
#FMS
# OHNE TEXT????
POCSAG1200: Address: 1100000 Function: 1
POCSAG1200: Address: 1100000 Function: 2
POCSAG1200: Address: 1100000 Function: 3
POCSAG1200: Address: 1100000 Function: 4
# duplicate with same and other msg
POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay
# duplicate in different order
POCSAG1200: Address: 2100000 Function: 2 Alpha:
POCSAG1200: Address: 2100001 Function: 2 Alpha:
POCSAG1200: Address: 2100002 Function: 2 Alpha:
POCSAG1200: Address: 2100000 Function: 2 Alpha:
POCSAG1200: Address: 2100001 Function: 2 Alpha:
POCSAG1200: Address: 2100002 Function: 2 Alpha:
POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate
# invalid
POCSAG512: Address: 123456 Function: 0 Alpha: BOSWatch-Test: invalid
POCSAG1200: Address: 123456 Function: 1 Alpha: BOSWatch-Test: invalid
POCSAG2400: Address: 1234567 Function: 4 Alpha: BOSWatch-Test: invalid
# denied
POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied
# out of filter Range
POCSAG1200: Address: 0999999 Function: 1 Alpha: BOSWatch-Test: out of filter start
POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end
# regEx-Filter?
#
# FMS
# ---
#
FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct
FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct
FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct
FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct
FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct
#
# ZVEI
# ----
#
#ZVEI
#with csv description
ZVEI2: 12345
#without csv description