Minor fix to raw APRS output.

This commit is contained in:
Marat Fayzullin 2024-08-02 19:06:56 -04:00
parent ef7cd8147b
commit aa0e7513ab
1 changed files with 8 additions and 4 deletions

View File

@ -63,7 +63,7 @@ class Ax25Parser(PickleModule):
"source": self.extractCallsign(ax25frame[7:14]),
"path": [self.extractCallsign(c, True) for c in chunks(ax25frame[14:control_pid], 7)],
"data": ax25frame[control_pid + 2 :],
"hex": "".join('{:02x}'.format(x) for x in ax25frame),
"raw": "".join('{:02X}'.format(x) for x in ax25frame),
}
except (ValueError, IndexError):
logger.exception("error parsing ax25 frame")
@ -282,8 +282,12 @@ class AprsParser(PickleModule):
information = data["data"]
# forward some of the ax25 data
aprsData = {"source": data["source"], "destination": data["destination"], "path": data["path"],
"hex": data["hex"]}
aprsData = {
"source": data["source"],
"destination": data["destination"],
"path": data["path"],
"raw": data["raw"]
}
if information[0] == 0x1C or information[0] == ord("`") or information[0] == ord("'"):
aprsData.update(MicEParser().parse(data))
@ -522,7 +526,7 @@ class AprsParser(PickleModule):
if cnt>0:
out += bytes([buf])
# For now, just pring data in hex
# For now, just print data in hex
result["message"] = " ".join(["%02X" % x for x in out])
return result