openwebrx-clone/owrx/pocsag.py
2020-01-09 15:11:53 +01:00

9 lines
301 B
Python

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)