🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
"""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",
|
|
]
|