mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -07:00
Overhaul Bluetooth scanning with DBus-based BlueZ integration
Major changes: - Add utils/bluetooth/ package with DBus scanner, fallback scanners (bleak, hcitool, bluetoothctl), device aggregation, and heuristics - New unified API at /api/bluetooth/ with REST endpoints and SSE streaming - Device observation aggregation with RSSI statistics and range bands - Behavioral heuristics: new, persistent, beacon-like, strong+stable - Frontend components: DeviceCard, MessageCard, RSSISparkline - TSCM integration via get_tscm_bluetooth_snapshot() helper - Unit tests for aggregator, heuristics, and API endpoints Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
70
utils/bluetooth/__init__.py
Normal file
70
utils/bluetooth/__init__.py
Normal file
@@ -0,0 +1,70 @@
|
||||
"""
|
||||
Bluetooth scanning package for INTERCEPT.
|
||||
|
||||
Provides unified Bluetooth scanning with DBus/BlueZ and fallback backends,
|
||||
device aggregation, RSSI statistics, and observable heuristics.
|
||||
"""
|
||||
|
||||
from .aggregator import DeviceAggregator
|
||||
from .capability_check import check_capabilities, quick_adapter_check
|
||||
from .constants import (
|
||||
# Range bands
|
||||
RANGE_VERY_CLOSE,
|
||||
RANGE_CLOSE,
|
||||
RANGE_NEARBY,
|
||||
RANGE_FAR,
|
||||
RANGE_UNKNOWN,
|
||||
# Protocols
|
||||
PROTOCOL_BLE,
|
||||
PROTOCOL_CLASSIC,
|
||||
PROTOCOL_AUTO,
|
||||
# Address types
|
||||
ADDRESS_TYPE_PUBLIC,
|
||||
ADDRESS_TYPE_RANDOM,
|
||||
ADDRESS_TYPE_RANDOM_STATIC,
|
||||
ADDRESS_TYPE_RPA,
|
||||
ADDRESS_TYPE_NRPA,
|
||||
)
|
||||
from .heuristics import HeuristicsEngine, evaluate_device_heuristics, evaluate_all_devices
|
||||
from .models import BTDeviceAggregate, BTObservation, ScanStatus, SystemCapabilities
|
||||
from .scanner import BluetoothScanner, get_bluetooth_scanner, reset_bluetooth_scanner
|
||||
|
||||
__all__ = [
|
||||
# Main scanner
|
||||
'BluetoothScanner',
|
||||
'get_bluetooth_scanner',
|
||||
'reset_bluetooth_scanner',
|
||||
|
||||
# Models
|
||||
'BTObservation',
|
||||
'BTDeviceAggregate',
|
||||
'ScanStatus',
|
||||
'SystemCapabilities',
|
||||
|
||||
# Aggregator
|
||||
'DeviceAggregator',
|
||||
|
||||
# Heuristics
|
||||
'HeuristicsEngine',
|
||||
'evaluate_device_heuristics',
|
||||
'evaluate_all_devices',
|
||||
|
||||
# Capability checks
|
||||
'check_capabilities',
|
||||
'quick_adapter_check',
|
||||
|
||||
# Constants
|
||||
'RANGE_VERY_CLOSE',
|
||||
'RANGE_CLOSE',
|
||||
'RANGE_NEARBY',
|
||||
'RANGE_FAR',
|
||||
'RANGE_UNKNOWN',
|
||||
'PROTOCOL_BLE',
|
||||
'PROTOCOL_CLASSIC',
|
||||
'PROTOCOL_AUTO',
|
||||
'ADDRESS_TYPE_PUBLIC',
|
||||
'ADDRESS_TYPE_RANDOM',
|
||||
'ADDRESS_TYPE_RANDOM_STATIC',
|
||||
'ADDRESS_TYPE_RPA',
|
||||
'ADDRESS_TYPE_NRPA',
|
||||
]
|
||||
Reference in New Issue
Block a user