From 83ae6810ac448f323710df75f854e7c993eb3b69 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:02:56 +0100 Subject: [PATCH 1/3] Update config.template.ini Adding switch to enable/disable CRC-checking provided by multimon-ng --- config/config.template.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/config.template.ini b/config/config.template.ini index 80c82be..a3b4336 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -79,6 +79,12 @@ idDescribed = 0 # descriptions are loaded from csv/zvei.csv idDescribed = 0 +# Check for correct CRC-information is provided by multimon-ng +# As this seems to be incorrect in many cases it might be useful to disable this +# (0 - off | 1 - on) +# Better use RegEX to verify the correct data +checkCRC = 0 + [POC] # some very simple filters: # Allow only this RICs (empty: allow all, separator ",") From 4f65b5159e1aaf8ec0c6f935053b823f446db99e Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:03:51 +0100 Subject: [PATCH 2/3] Update decoder.py Fixing typos --- includes/decoder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/decoder.py b/includes/decoder.py index d62604d..26c8ba4 100644 --- a/includes/decoder.py +++ b/includes/decoder.py @@ -27,21 +27,21 @@ def decode(freq, decoded): # FMS Decoder Section # check FMS: -> check CRC -> validate -> check double alarm -> log if "FMS:" in decoded: - logging.debug("recieved FMS") + logging.debug("received FMS") from includes.decoders import fms fms.decode(freq, decoded) # ZVEI Decoder Section # check ZVEI: -> validate -> check double alarm -> log elif "ZVEI2:" in decoded: - logging.debug("recieved ZVEI") + logging.debug("received ZVEI") from includes.decoders import zvei zvei.decode(freq, decoded) # POCSAG Decoder Section # check POCSAG -> validate -> check double alarm -> log elif "POCSAG512:" in decoded or "POCSAG1200:" in decoded or "POCSAG2400:" in decoded: - logging.debug("recieved POCSAG") + logging.debug("received POCSAG") from includes.decoders import poc poc.decode(freq, decoded) From f996b722633dbba5829bbdd7c1b0a318dd3ebfa4 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:07:11 +0100 Subject: [PATCH 3/3] Update fms.py - enabling to (not) use the CRC-check from multimon-ng - fixing location-information with regard to TR-BOS (hex value is read as decimal value) ATTENTION: For proper usage multimon-ng is to be updated - please take the latest version from repository! --- includes/decoders/fms.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/decoders/fms.py b/includes/decoders/fms.py index 88c3234..b7d77d6 100644 --- a/includes/decoders/fms.py +++ b/includes/decoders/fms.py @@ -37,14 +37,25 @@ def decode(freq, decoded): try: fms_service = decoded[19] # Organisation fms_country = decoded[36] # Bundesland - fms_location = decoded[65:67] # Ort + fms_location = decoded[61:63] # Ort fms_vehicle = decoded[72:76] # Fahrzeug fms_status = decoded[84] # Status fms_direction = decoded[101] # Richtung fms_directionText = decoded[103:110] # Richtung (Text) fms_tsi = decoded[114:117] # Taktische Kruzinformation - if "CRC correct" in decoded: #check CRC is correct + # shall we use the CRC-check? + if (globalVars.config.getboolean("FMS", "CheckCRC")): + if "CRC correct" in decoded: + # if CRC is to be checked, do so and save result + proceed = True + else: + proceed = False + else: + # no CRC-check required - proceed + proceed = True + + if (proceed == True): fms_id = fms_service+fms_country+fms_location+fms_vehicle+fms_status+fms_direction # build FMS id # if FMS is valid if re.search("[0-9a-f]{8}[0-9a-f]{1}[01]{1}", fms_id):