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

Method _find_wardrive_ap_interface

wifi_manager.py:2435–2458  ·  view source on GitHub ↗

Pick a WiFi adapter to host the KEY1 AP on. Preference order, so wardriving AND an active WiFi uplink keep running whenever the hardware allows: 1. a radio used by neither wardriving nor the live WiFi connection; 2. any radio not used by wardriving (may be the Wi

(self)

Source from the content-addressed store, hash-verified

2433 self.logger.warning(f"Failed to connect to {network}: {result.stderr}")
2434 except Exception as e:
2435 self.logger.warning(f"Error connecting to {network}: {e}")
2436
2437 return False
2438
2439 def start_ap_mode_with_timeout(self):
2440 """Start AP mode with smart timeout management"""
2441 self.ap_logger.info("Starting AP mode with timeout management")
2442 if self.start_ap_mode():
2443 self.ap_mode_start_time = time.time()
2444 self.cycling_mode = True
2445 self.logger.info(f"AP mode started with {self.ap_timeout}s timeout")
2446 self.ap_logger.info(f"AP mode started with {self.ap_timeout}s timeout in cycling mode")
2447 return True
2448 else:
2449 self.ap_logger.error("Failed to start AP mode with timeout")
2450 return False
2451
2452 def enable_ap_mode_from_web(self):
2453 """Enable AP mode from web interface - uses endless loop behavior"""
2454 self.logger.info("AP mode requested from web interface")
2455 if self.wifi_connected:
2456 # If connected, disconnect first
2457 self.disconnect_wifi()
2458
2459 # Stop current AP if running
2460 if self.ap_mode_active:
2461 self.stop_ap_mode()

Callers 1

start_wardrive_apMethod · 0.95

Calls 5

_wardriving_engineMethod · 0.95
gather_wifi_interfacesFunction · 0.90
debugMethod · 0.80
setFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected