fix decoder

This commit is contained in:
Bastian Schroll 2019-09-20 17:38:33 +02:00
parent 0c6044072a
commit 957b22e087
2 changed files with 5 additions and 4 deletions

View file

@ -32,6 +32,7 @@ class Decoder:
@param data: data to decode
@return bwPacket instance"""
logging.debug("search decoder")
data = str(data)
if "FMS" in data:
return FmsDecoder.decode(data)
elif "POCSAG" in data:

View file

@ -70,20 +70,20 @@ class PocsagDecoder:
@return bitrate
@return ric
@return subric"""
bitrate, ric, subric = 0, 0, 0
bitrate, ric, subric = "0", "0", "0"
if "POCSAG512:" in data:
bitrate = 512
bitrate = "512"
ric = data[20:27].replace(" ", "").zfill(7)
subric = str(int(data[39]) + 1)
elif "POCSAG1200:" in data:
bitrate = 1200
bitrate = "1200"
ric = data[21:28].replace(" ", "").zfill(7)
subric = str(int(data[40]) + 1)
elif "POCSAG2400:" in data:
bitrate = 2400
bitrate = "2400"
ric = data[21:28].replace(" ", "").zfill(7)
subric = str(int(data[40]) + 1)