MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _reconnect_gpsd

Method _reconnect_gpsd

gps_manager.py:508–523  ·  view source on GitHub ↗

Attempt to reconnect to gpsd.

(self)

Source from the content-addressed store, hash-verified

506
507 # Talker code -> human constellation name, for the sky view. Shared by the
508 # gpsd (SKY) and serial (GSV) paths, both of which key by these codes.
509 _TALKER_NAMES = {
510 'GP': 'GPS', 'GL': 'GLONASS', 'GA': 'Galileo', 'GB': 'BeiDou',
511 'BD': 'BeiDou', 'GQ': 'QZSS', 'GI': 'NavIC', 'GN': 'combined',
512 }
513
514 def get_sky_view(self):
515 """Per-satellite sky list (constellation / prn / az / elev / snr) for the
516 sky-view plot, from the live GSV/SKY bookkeeping. Only satellites with
517 both azimuth and elevation (the plottable ones); stale talkers (>30 s)
518 are skipped. Cheap enough to poll at ~1 Hz for a live view."""
519 now = time.time()
520 with self._lock:
521 items = [(t, s, ts) for t, (s, ts) in self._sats_by_talker.items()]
522 out = []
523 for talker, sats, ts in items:
524 if ts and now - ts > 30:
525 continue
526 cons = self._TALKER_NAMES.get(talker, talker)

Callers 1

_read_loop_gpsdMethod · 0.95

Calls 3

_try_gpsdFunction · 0.85
infoMethod · 0.80
sleepMethod · 0.45

Tested by

no test coverage detected