error handling in decoder.py

This commit is contained in:
Schrolli 2015-05-26 09:14:04 +02:00
parent 297f27c81c
commit be9aa3b722

View file

@ -4,24 +4,27 @@
import logging import logging
def decode(freq, decoded): def decode(freq, decoded):
try:
#FMS Decoder Section #FMS Decoder Section
#check FMS: -> check CRC -> validate -> check double alarm -> log #check FMS: -> check CRC -> validate -> check double alarm -> log
if "FMS:" in decoded: if "FMS:" in decoded:
logging.debug("recieved FMS") logging.debug("recieved FMS")
from includes.decoders import fms from includes.decoders import fms
fms.decode(freq, decoded) fms.decode(freq, decoded)
#ZVEI Decoder Section #ZVEI Decoder Section
#check ZVEI: -> validate -> check double alarm -> log #check ZVEI: -> validate -> check double alarm -> log
if "ZVEI2:" in decoded: if "ZVEI2:" in decoded:
logging.debug("recieved ZVEI") logging.debug("recieved ZVEI")
from includes.decoders import zvei from includes.decoders import zvei
zvei.decode(freq, decoded) zvei.decode(freq, decoded)
#POCSAG Decoder Section #POCSAG Decoder Section
#check POCSAG -> validate -> check double alarm -> log #check POCSAG -> validate -> check double alarm -> log
if "POCSAG" in decoded: if "POCSAG" in decoded:
logging.debug("recieved POCSAG") logging.debug("recieved POCSAG")
from includes.decoders import poc from includes.decoders import poc
poc.decode(freq, decoded) poc.decode(freq, decoded)
except:
logging.exception("cannot start decoder")