diff --git a/boswatch/decoder/fms.py b/boswatch/decoder/fms.py index abf9554..4b7798d 100644 --- a/boswatch/decoder/fms.py +++ b/boswatch/decoder/fms.py @@ -51,7 +51,7 @@ class Fms: tacticalInfo = data[114:117] fms_id = service + country + location + vehicle + status + direction - if re.search("[0-9a-f]{8}[0-9a-f]{1}[01]{1}", fms_id): + if re.search("[0-9a-f]{8}[0-9a-f][01]", fms_id): logging.debug("found valid FMS") bwPacket = packet.Packet() diff --git a/boswatch/decoder/pocsag.py b/boswatch/decoder/pocsag.py index 2f81a98..1029e77 100644 --- a/boswatch/decoder/pocsag.py +++ b/boswatch/decoder/pocsag.py @@ -42,10 +42,10 @@ class Pocsag: @return BOSWatch POCSAG packet or None""" bitrate, ric, subric = Pocsag._getBitrateRicSubric(data) - if re.search("[0-9]{7}", ric) and re.search("[1-4]{1}", subric): + if re.search("[0-9]{7}", ric) and re.search("[1-4]", subric): if "Alpha:" in data: message = data.split('Alpha: ')[1].strip() - message = message.replace('', '').replace('', '').replace('', '').replace('', '').strip() + message = message.replace('', '').replace('', '').replace('', '').strip() else: message = "" subricText = subric.replace("1", "a").replace("2", "b").replace("3", "c").replace("4", "d") diff --git a/boswatch/descriptor/descriptor.py b/boswatch/descriptor/descriptor.py index 6556d53..78a9038 100644 --- a/boswatch/descriptor/descriptor.py +++ b/boswatch/descriptor/descriptor.py @@ -12,7 +12,7 @@ @file: descriptor.py @date: 07.01.2018 @author: Bastian Schroll -@description: +@description: Descriptor to load Descriptions from csv files """ import logging import csv diff --git a/boswatch/network/server.py b/boswatch/network/server.py index c42ef18..41dbfcd 100644 --- a/boswatch/network/server.py +++ b/boswatch/network/server.py @@ -108,6 +108,7 @@ class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): logging.exception("cannot stop the server") return False + @staticmethod def clientsConnected(self): # pragma: no cover """!Number of currently connected Clients @@ -119,6 +120,7 @@ class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): else: return 0 + @staticmethod def getData(self): """!Function to get the data packages from server must be polled by main program @@ -130,6 +132,7 @@ class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): return message return None + @staticmethod def flushData(self): """!To flush all existing data in queue""" logging.debug("Flush client data queue")