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