mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
error handling in decoder.py
This commit is contained in:
parent
297f27c81c
commit
be9aa3b722
|
|
@ -4,24 +4,27 @@
|
|||
import logging
|
||||
|
||||
def decode(freq, decoded):
|
||||
|
||||
#FMS Decoder Section
|
||||
#check FMS: -> check CRC -> validate -> check double alarm -> log
|
||||
if "FMS:" in decoded:
|
||||
logging.debug("recieved FMS")
|
||||
from includes.decoders import fms
|
||||
fms.decode(freq, decoded)
|
||||
try:
|
||||
#FMS Decoder Section
|
||||
#check FMS: -> check CRC -> validate -> check double alarm -> log
|
||||
if "FMS:" in decoded:
|
||||
logging.debug("recieved FMS")
|
||||
from includes.decoders import fms
|
||||
fms.decode(freq, decoded)
|
||||
|
||||
#ZVEI Decoder Section
|
||||
#check ZVEI: -> validate -> check double alarm -> log
|
||||
if "ZVEI2:" in decoded:
|
||||
logging.debug("recieved ZVEI")
|
||||
from includes.decoders import zvei
|
||||
zvei.decode(freq, decoded)
|
||||
|
||||
#POCSAG Decoder Section
|
||||
#check POCSAG -> validate -> check double alarm -> log
|
||||
if "POCSAG" in decoded:
|
||||
logging.debug("recieved POCSAG")
|
||||
from includes.decoders import poc
|
||||
poc.decode(freq, decoded)
|
||||
#ZVEI Decoder Section
|
||||
#check ZVEI: -> validate -> check double alarm -> log
|
||||
if "ZVEI2:" in decoded:
|
||||
logging.debug("recieved ZVEI")
|
||||
from includes.decoders import zvei
|
||||
zvei.decode(freq, decoded)
|
||||
|
||||
#POCSAG Decoder Section
|
||||
#check POCSAG -> validate -> check double alarm -> log
|
||||
if "POCSAG" in decoded:
|
||||
logging.debug("recieved POCSAG")
|
||||
from includes.decoders import poc
|
||||
poc.decode(freq, decoded)
|
||||
|
||||
except:
|
||||
logging.exception("cannot start decoder")
|
||||
|
|
|
|||
Loading…
Reference in a new issue