openwebrx-clone/owrx/pocsag.py

9 lines
301 B
Python
Raw Normal View History

from owrx.parser import Parser
class PocsagParser(Parser):
def parse(self, raw):
fields = raw.decode("ascii", "replace").rstrip("\n").split(";")
meta = {v[0]: "".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
self.handler.write_pocsag_data(meta)