Fixes namespace collision with Reticulum's own RNS.Interfaces package.
When both packages were installed, the collision caused import issues
and prevented BLE discovery between devices.
Changes:
- Rename src/RNS/Interfaces/ to src/ble_reticulum/
- Update pyproject.toml package configuration
- Update all imports in source and test files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The original D-Bus monitoring implementation (from peripheral disconnect fix)
wasn't receiving signals due to improper low-level API usage. This commit
replaces it with two reliable solutions:
Solution A: High-Level ObjectManager API
- Uses proper D-Bus proxy interface with automatic signal subscription
- Discovers and subscribes to all BlueZ devices (existing + new)
- PropertiesChanged callbacks properly integrated with asyncio event loop
- Signals now correctly delivered when centrals disconnect
Solution B: Timeout-Based Polling Fallback
- Polls BlueZ device state every 30 seconds as safety net
- Detects stale connections missed by D-Bus signals
- Uses sync dbus-python for simplicity and reliability
- Guaranteed cleanup within 30s even if signals fail
Implementation:
- Replaced _monitor_device_disconnections() with ObjectManager-based approach
- Added _poll_stale_connections() as polling fallback
- Both threads run concurrently for dual-layer monitoring
- Cleanup is idempotent (both detecting same disconnect is safe)
Testing:
- Added test_dbus_disconnect_monitoring.py (10 test cases)
- Added test_stale_connection_polling.py (8 test cases)
- Added 2 integration tests to test_peripheral_disconnect_cleanup.py
- All tests mock D-Bus libraries, no real D-Bus required
- Manual validation script (test_monitoring.py) verified locally
Impact:
- Peripheral disconnects now detected within ~1s (D-Bus) or 30s max (polling)
- Prevents "max peers (7) reached" blocking after multiple disconnect cycles
- System can handle unlimited connect/disconnect cycles without memory leaks
Reference: DBUS_MONITORING_FIX.md for complete analysis and troubleshooting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>