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

Method get_status

gps_manager.py:376–403  ·  view source on GitHub ↗

Return full GPS status dict.

(self)

Source from the content-addressed store, hash-verified

374 logger.error(self.error)
375 return False
376 except Exception as e:
377 self.error = f"GPS init failed: {e}"
378 logger.error(self.error)
379 return False
380
381 def stop(self):
382 """Stop GPS reading."""
383 self._running = False
384 self.connected = False
385 if self._serial:
386 try:
387 self._serial.close()
388 except Exception:
389 pass
390 self._serial = None
391 if self._gpsd_sock:
392 try:
393 self._gpsd_sock.close()
394 except Exception:
395 pass
396 self._gpsd_sock = None
397 logger.info("GPS stopped")
398
399 def attach(self, port):
400 """(Re)point the GPS reader at a serial port — called by the wardriving
401 device monitor when a GPS puck is hot-plugged or re-enumerates.
402
403 Idempotent: if already reading that port, do nothing. Prefers gpsd when
404 it is running (it owns the serial device). This is what makes GPS
405 self-healing — a puck that appears minutes after boot, or bounces
406 (disconnect→reconnect), is attached automatically with no restart.

Callers 7

wardriving_statusFunction · 0.45
wardriving_gpsFunction · 0.45
get_wifi_statusFunction · 0.45
get_bluetooth_statusFunction · 0.45
get_current_statusFunction · 0.45
get_dashboard_quickFunction · 0.45
_get_wardriving_dataMethod · 0.45

Calls 1

has_fixMethod · 0.95

Tested by

no test coverage detected