Initial commit - Phase 3/4
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
48
app/backend/ble/__init__.py
Normal file
48
app/backend/ble/__init__.py
Normal file
@@ -0,0 +1,48 @@
|
||||
"""BLE GATT server implementation for Dangerous Pi.
|
||||
|
||||
This module provides Bluetooth Low Energy (BLE) GATT server functionality
|
||||
that reuses the service layer for business logic, ensuring consistency
|
||||
with the REST API.
|
||||
|
||||
Components:
|
||||
- DangerousPiGATTServer: GATT handlers that call service layer
|
||||
- BlueZGATTAdapter: Bridges bless library to GATT handlers
|
||||
- Characteristic UUIDs: Service and characteristic definitions
|
||||
"""
|
||||
|
||||
from .gatt_server import DangerousPiGATTServer
|
||||
from .characteristics import (
|
||||
PM3CharacteristicUUIDs,
|
||||
WiFiCharacteristicUUIDs,
|
||||
SystemCharacteristicUUIDs,
|
||||
UpdateCharacteristicUUIDs,
|
||||
)
|
||||
|
||||
# BlueZ adapter (requires bless library)
|
||||
try:
|
||||
from .bluez_adapter import (
|
||||
BlueZGATTAdapter,
|
||||
get_ble_adapter,
|
||||
start_ble_server,
|
||||
stop_ble_server,
|
||||
)
|
||||
BLESS_AVAILABLE = True
|
||||
except ImportError:
|
||||
BlueZGATTAdapter = None
|
||||
get_ble_adapter = None
|
||||
start_ble_server = None
|
||||
stop_ble_server = None
|
||||
BLESS_AVAILABLE = False
|
||||
|
||||
__all__ = [
|
||||
"DangerousPiGATTServer",
|
||||
"PM3CharacteristicUUIDs",
|
||||
"WiFiCharacteristicUUIDs",
|
||||
"SystemCharacteristicUUIDs",
|
||||
"UpdateCharacteristicUUIDs",
|
||||
"BlueZGATTAdapter",
|
||||
"get_ble_adapter",
|
||||
"start_ble_server",
|
||||
"stop_ble_server",
|
||||
"BLESS_AVAILABLE",
|
||||
]
|
||||
Reference in New Issue
Block a user