From 40ae5169057769ffb43c0f013365bfe836135c08 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 21 Dec 2025 15:17:00 +0000 Subject: [PATCH] Fix BT device type field in charts and add debug logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed updateBtTypeChart to use device_type instead of type field - Fixed hcitool queue data to include device_type field (was overwriting type) - Added console.log debug statements to trace device intelligence flow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- intercept.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/intercept.py b/intercept.py index 88c3b10..8f8b4f8 100755 --- a/intercept.py +++ b/intercept.py @@ -2814,6 +2814,7 @@ HTML_TEMPLATE = ''' // Track a device transmission function trackDevice(data) { + console.log('[INTEL] trackDevice called:', data.protocol, data.address, 'reconEnabled:', reconEnabled); const now = Date.now(); const deviceId = generateDeviceId(data); const protocol = data.protocol || data.model || 'Unknown'; @@ -2878,6 +2879,7 @@ HTML_TEMPLATE = ''' // Update reconnaissance display function updateReconDisplay(deviceId, profile, isNewDevice, anomalies) { + console.log('[INTEL] updateReconDisplay:', deviceId, 'protocol:', profile.protocol); const content = document.getElementById('reconContent'); // Remove placeholder if present @@ -3835,6 +3837,7 @@ HTML_TEMPLATE = ''' // Handle discovered Bluetooth device function handleBtDevice(device) { + console.log('[BT] handleBtDevice:', device.mac, 'device_type:', device.device_type, 'manufacturer:', device.manufacturer); const isNew = !btDevices[device.mac]; btDevices[device.mac] = device; @@ -4125,10 +4128,11 @@ HTML_TEMPLATE = ''' let phones = 0, audio = 0, wearables = 0, trackers = 0, other = 0; Object.values(btDevices).forEach(d => { + const devType = d.device_type || 'other'; if (d.tracker) trackers++; - else if (d.type === 'phone') phones++; - else if (d.type === 'audio') audio++; - else if (d.type === 'wearable') wearables++; + else if (devType === 'phone') phones++; + else if (devType === 'audio') audio++; + else if (devType === 'wearable') wearables++; else other++; }); @@ -5693,11 +5697,13 @@ def stream_bt_scan(process, scan_mode): is_new = mac not in bt_devices bt_devices[mac] = device - bt_queue.put({ - 'type': 'device', + queue_data = { + **device, + 'type': 'device', # Must come after **device to not be overwritten + 'device_type': device.get('type', 'other'), 'action': 'new' if is_new else 'update', - **device - }) + } + bt_queue.put(queue_data) elif scan_mode == 'bluetoothctl': # bluetoothctl scan output - read from pty