Skip to content

Commit

Permalink
fixed replies to positionrequests to be compliant with format expecte…
Browse files Browse the repository at this point in the history
…d by DPRS interface
  • Loading branch information
maurizioandreotti committed May 29, 2020
1 parent e73f5af commit 274b613
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
1 change: 0 additions & 1 deletion d-rats_repeater.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
gettext.install("D-RATS")

from d_rats import dplatform

from d_rats import transport
from d_rats import comm
from d_rats.debug import printlog
Expand Down
27 changes: 18 additions & 9 deletions d_rats/sessions/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,27 +363,36 @@ def RPC_pos_report(self, job):
try:
#obtaining current position from config or local gps
fix = self.emit("get-current-position", rqcall)
result = fix.to_NMEA_GGA()

#result = fix.to_NMEA_GGA()
result["rc"] = "True"
result["msg"] = fix.to_APRS(symtab=self.__config.get("settings", "aprssymtab"),
symbol=self.__config.get("settings", "aprssymbol"))

except Exception as e:
print(("RPC : Case KO : Exception while getting position of %s: " % rqcall))
log_exception()
fix = None
result["rc"] = "KO"
result["msg"] = "No data for station '%s'" % job.get_station()
result["rc"] = "False"
result["msg"] = " No data for station '%s'" % job.get_station()

if fix:
#sending the position to transport // but this is broken!!
print(("RPC : port is : %s" % self.__port))
print(("RPC : fix is : %s" % fix))
print(("RPC : fix in NMEA GGA is: %s" % fix.to_NMEA_GGA()))
print(("RPC : fix in APRS is: %s" % result))

#self.emit("user-send-chat","CQCQCQ", self.__port, fix.to_NMEA_GGA(), True)
self.emit("user-send-chat",
"CQCQCQ", self.__port, fix.to_NMEA_GGA(), True)
"CQCQCQ",
self.__port,
result["msg"],
True)

print(("RPC : result : %s" % format(result)))
print("-----------------------")
return result

print("--------------------------------------------------------------------------------------------")

return None
def RPC_file_list(self, job):
result = {}

Expand Down

0 comments on commit 274b613

Please sign in to comment.