Start AP mode with smart timeout management
(self)
| 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()] |
no test coverage detected