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

Method start_ap_mode_with_timeout

wifi_manager.py:2277–2288  ·  view source on GitHub ↗

Start AP mode with smart timeout management

(self)

Source from the content-addressed store, hash-verified

2275 except Exception as e:
2276 self.logger.error(f"Error removing known network {ssid}: {e}")
2277 return False
2278
2279 def check_ap_clients(self):
2280 """Check how many clients are connected to the AP"""
2281 if not self.ap_mode_active:
2282 return 0
2283
2284 try:
2285 self.ap_logger.debug("Checking for connected AP clients...")
2286
2287 # Method 1: Check hostapd_cli if available
2288 result = subprocess.run(['hostapd_cli', '-i', self.ap_interface, 'list_sta'],
2289 capture_output=True, text=True, timeout=5)
2290 if result.returncode == 0:
2291 clients = [line.strip() for line in result.stdout.strip().split('\n') if line.strip()]

Callers 1

Calls 3

start_ap_modeMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected