Get Ethernet scanning enabled status.
()
| 11333 | @app.route('/api/wardriving/serial/detect', methods=['GET']) |
| 11334 | def wardriving_serial_detect(): |
| 11335 | """Auto-detect all ESP32 companions on serial ports.""" |
| 11336 | try: |
| 11337 | engine = _get_wardriving_engine() |
| 11338 | ports = engine._detect_all_esp32_serial() |
| 11339 | return jsonify({'found': bool(ports), 'ports': ports, 'port': ports[0] if ports else ''}) |
| 11340 | except Exception as e: |
| 11341 | logger.error(f"Wardriving serial detect error: {e}") |
| 11342 | return jsonify({'found': False, 'ports': [], 'port': '', 'error': str(e)}) |
| 11343 | |
| 11344 | @app.route('/api/wardriving/serial', methods=['GET', 'POST']) |
| 11345 | def wardriving_serial(): |
| 11346 | """Get or set serial ESP32 listener configuration. Supports multiple companions.""" |
| 11347 | try: |
| 11348 | engine = _get_wardriving_engine() |
| 11349 | |
| 11350 | if request.method == 'GET': |
| 11351 | companions = [c.as_dict() for c in engine._companions.values()] |
| 11352 | return jsonify({ |
| 11353 | 'connected': engine.serial_connected, |
nothing calls this directly
no test coverage detected