Files
pi-pm3/app/backend/ble/__init__.py
michael 4f35df1781 Initial commit - Phase 3/4
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 13:46:22 -08:00

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",
]