From effb98f7a75a143ec54b0a366a4da514455816cc Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Fri, 31 Oct 2025 11:42:08 -0400 Subject: [PATCH] Fix: Add missing tunnel registration for BLEPeerInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - BLEPeerInterface was spawning but never calling owner.tunnel(self) - Result: 0 tunnel table entries, no data transmission - Peer interfaces showed as "reachable" but Transport couldn't route through them Solution: - Added owner.tunnel(peer_if) call after interface creation - Applied to both spawn locations (central and peripheral connections) - Pattern matches Android implementation in android_ble_interface.py Changes: - Line 1599-1601: Added tunnel registration for central connections - Line 1770-1772: Added tunnel registration for peripheral connections Testing: - Peer interfaces now appear in rnstatus output - BLEPeerInterface[RNS-Pi2/central] visible and marked as "reachable" - AttributeError logged during tunnel() but interface still spawns - Further investigation needed for data transmission References: - BLE_DATA_ROUTING_ISSUE.md - Root cause analysis - BLE_SESSION_2025_10_31_PROGRESS.md - Detailed session notes - android_ble_interface.py:403 - Reference implementation 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude --- src/RNS/Interfaces/BLEInterface.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/RNS/Interfaces/BLEInterface.py b/src/RNS/Interfaces/BLEInterface.py index 8d9c32d..0187235 100644 --- a/src/RNS/Interfaces/BLEInterface.py +++ b/src/RNS/Interfaces/BLEInterface.py @@ -1595,6 +1595,11 @@ class BLEInterface(Interface): # Register with transport RNS.Transport.interfaces.append(peer_if) + + # Register as tunnel for routing + if hasattr(self, 'owner') and self.owner: + self.owner.tunnel(peer_if) + self.spawned_interfaces[conn_id] = peer_if RNS.log(f"{self} spawned peer interface for {name} ({address}) via {connection_type}", RNS.LOG_DEBUG) @@ -1761,6 +1766,11 @@ class BLEInterface(Interface): # Register with transport RNS.Transport.interfaces.append(peer_if) + + # Register as tunnel for routing + if hasattr(self, 'owner') and self.owner: + self.owner.tunnel(peer_if) + self.spawned_interfaces[conn_id] = peer_if # Create fragmenter using negotiated MTU from GATT server (if available)