Add debug method for device detection diagnostics

Implements debug_managed_device_detection() to provide verbose output about CrossPoint Reader network detection, including connection status, discovery attempts, and error reporting. Bypasses discovery throttle to force fresh scans during debugging.
This commit is contained in:
Justin Mitchell
2026-08-02 23:22:32 -04:00
parent 3687d5030b
commit 2bcb355d64
+20
View File
@@ -93,6 +93,26 @@ class CrossPointDevice(DeviceConfig, DevicePlugin):
self._log('[CrossPoint] discovery failed')
return None
def debug_managed_device_detection(self, devices_on_system, output):
from functools import partial
p = partial(print, file=output)
if self.is_connected:
p(f'A CrossPoint Reader is already connected at {self.device_host}:{self.device_port}')
return True
p('Looking for a CrossPoint Reader on the network...')
try:
# Bypass the discovery throttle so a fresh scan happens.
self.last_discovery = 0.0
dev = self.detect_managed_devices(devices_on_system, force_refresh=True)
except Exception as exc:
p(f'Error while probing for a CrossPoint Reader: {exc}')
return False
if dev is not None:
p(f'Found a CrossPoint Reader at {self.device_host}:{self.device_port}')
return True
p('No CrossPoint Reader detected on the network')
return False
def _detect_device_model(self):
"""Query /api/status for the device model (X3/X4), like the web UI."""
try: