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

Method _cell_scan_loop

wardriving.py:3173–3194  ·  view source on GitHub ↗

Background loop: scan for cell towers every ~30 seconds.

(self)

Source from the content-addressed store, hash-verified

3171 pass
3172 return False
3173
3174 def _scan_loop(self):
3175 """Main scanning loop — runs fast continuous scans."""
3176 logger.info(f"Scan loop started with {len(self.interfaces)} interface(s)")
3177
3178 while self._running:
3179 scan_start = time.time()
3180
3181 # Pick up a hot-plugged (or removed) WiFi adapter without a restart.
3182 if scan_start - self._last_iface_rescan >= self._iface_rescan_interval:
3183 self._last_iface_rescan = scan_start
3184 self._refresh_interfaces()
3185
3186 try:
3187 # Get GPS position
3188 pos = self._gps.get_position() if self._gps else None
3189 lat = pos['lat'] if pos else None
3190 lon = pos['lon'] if pos else None
3191 alt = pos['alt'] if pos else None
3192 speed = pos['speed_kmh'] if pos else None
3193 hdop = pos['hdop'] if pos else None
3194
3195 # Log GPS track periodically
3196 if pos and (time.time() - self._last_gps_track) >= self._gps_track_interval:
3197 self.session.log_gps_track(

Callers

nothing calls this directly

Calls 7

_scan_cell_networksMethod · 0.95
infoMethod · 0.80
get_positionMethod · 0.80
upsert_cell_towerMethod · 0.80
debugMethod · 0.80
getMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected