structured callsign data

This commit is contained in:
Jakob Ketterl
2022-11-30 01:07:16 +01:00
parent 975f5ffdf0
commit 258e41669e
9 changed files with 130 additions and 94 deletions

View File

@ -56,7 +56,7 @@ class PskReporter(Reporter):
self.timer.start()
def spotEquals(self, s1, s2):
keys = ["callsign", "timestamp", "locator", "mode", "msg"]
keys = ["source", "timestamp", "locator", "mode", "msg"]
return reduce(and_, map(lambda key: s1[key] == s2[key], keys))
@ -141,7 +141,7 @@ class Uploader(object):
def encodeSpot(self, spot):
try:
return bytes(
self.encodeString(spot["callsign"])
self.encodeString(spot["source"]["callsign"])
+ list(int(spot["freq"]).to_bytes(4, "big"))
+ list(int(spot["db"]).to_bytes(1, "big", signed=True))
+ self.encodeString(spot["mode"])

View File

@ -56,7 +56,7 @@ class Worker(threading.Thread):
# FST4W does not have drift
"drift": spot["drift"] if "drift" in spot else 0,
"tqrg": spot["freq"] / 1e6,
"tcall": spot["callsign"],
"tcall": spot["source"]["callsign"],
"tgrid": spot["locator"],
"dbm": spot["dbm"],
"version": openwebrx_version,