Merge pull request #199 from flothi/flothi-fms-patch

FMS patch
This commit is contained in:
Bastian Schroll 2017-01-16 16:06:46 +01:00 committed by GitHub
commit b84f84a420
3 changed files with 22 additions and 5 deletions

View file

@ -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 ",")

View file

@ -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)

View file

@ -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):