mirror of
https://github.com/smittix/intercept.git
synced 2026-07-21 07:48:11 -07:00
Add debug logging for BT queue and stream
Added debug prints to trace device flow: - "[BT] Queuing device:" when adding to queue - "[BT Stream] Sending device:" when SSE sends to client 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -5756,11 +5756,13 @@ def stream_bt_scan(process, scan_mode):
|
|||||||
is_new = mac not in bt_devices
|
is_new = mac not in bt_devices
|
||||||
bt_devices[mac] = device
|
bt_devices[mac] = device
|
||||||
|
|
||||||
bt_queue.put({
|
queue_data = {
|
||||||
'type': 'device',
|
'type': 'device',
|
||||||
'action': 'new' if is_new else 'update',
|
'action': 'new' if is_new else 'update',
|
||||||
**device
|
**device
|
||||||
})
|
}
|
||||||
|
print(f"[BT] Queuing device: {mac} - {name}")
|
||||||
|
bt_queue.put(queue_data)
|
||||||
except OSError:
|
except OSError:
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -6189,6 +6191,8 @@ def stream_bt():
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
msg = bt_queue.get(timeout=1)
|
msg = bt_queue.get(timeout=1)
|
||||||
|
if msg.get('type') == 'device':
|
||||||
|
print(f"[BT Stream] Sending device: {msg.get('mac')}")
|
||||||
yield f"data: {json.dumps(msg)}\n\n"
|
yield f"data: {json.dumps(msg)}\n\n"
|
||||||
except queue.Empty:
|
except queue.Empty:
|
||||||
yield f"data: {json.dumps({'type': 'keepalive'})}\n\n"
|
yield f"data: {json.dumps({'type': 'keepalive'})}\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user