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

Method stop_serial

wardriving.py:1756–1767  ·  view source on GitHub ↗

Stop one companion (by port) or all companions.

(self, port: str | None = None)

Source from the content-addressed store, hash-verified

1754 # run fine, and this is the user's call.
1755 try:
1756 from resource_monitor import ResourceMonitor
1757 power = ResourceMonitor().get_power_status()
1758 if power.get('supported') and power.get('status') != 'ok':
1759 logger.warning(
1760 f"Wardriving: POWER — {power.get('message')} "
1761 f"(throttle register {power.get('raw')}, "
1762 f"{len(self.interfaces)} radio(s) about to start)")
1763 except Exception as e:
1764 logger.debug(f"power status check failed: {e}")
1765
1766 # Bring each interface up (rfkill unblock + ip link up). USB adapters
1767 # like the NETGEAR mt76x2u enumerate as admin-DOWN; iw scan on a DOWN
1768 # interface returns "Network is down" and zero results forever.
1769 for iface in self.interfaces:
1770 self._prepare_interface(iface)

Callers 2

_detach_deviceMethod · 0.95
wardriving_serialFunction · 0.80

Calls 3

popMethod · 0.80
valuesMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected