(port_field: Optional[str])
| 3606 | |
| 3607 | if action == 'pwn_swap': |
| 3608 | # Toggle the Pwnagotchi<->Ragnar port bridge (only if pwnagotchi installed). |
| 3609 | if not shared_data.config.get('pwnagotchi_installed', False): |
| 3610 | return 'disabled', 409 |
| 3611 | try: |
| 3612 | import requests as _rq |
| 3613 | _rq.post('http://127.0.0.1:8000/api/pwnagotchi/swap', timeout=8) |
| 3614 | return 'started', 202 |
| 3615 | except Exception as exc: |
| 3616 | logger.warning(f"[cyd] pwn_swap failed: {exc}") |
| 3617 | return 'error', 500 |
| 3618 | |
| 3619 | return 'unknown', 400 |
| 3620 | |
| 3621 | |
| 3622 | @app.route('/api/cyd/wf', methods=['GET']) |
| 3623 | def cyd_wf(): |
| 3624 | """Waterfall row for the CYD's Waterfall screen (WiFi transport; the serial |
| 3625 | transport streams these over the cable). `band` selects the sweep, `on=0` |
| 3626 | releases the SDR. Returns a data row, {'waiting':1}, or {'err':'no SDR'}.""" |
no test coverage detected