Module platform

Module platform 

Source
Expand description

Platform abstraction layer for BLE

This module defines the traits that platform-specific implementations must implement to provide BLE functionality.

§Supported Platforms

  • Linux: BlueZ via D-Bus (bluer crate)
  • Android: JNI to Android Bluetooth APIs
  • macOS/iOS: CoreBluetooth
  • Windows: WinRT Bluetooth APIs
  • Embedded: ESP-IDF NimBLE

§Architecture

Each platform provides an implementation of BleAdapter that handles:

  • Adapter initialization and power management
  • Discovery (scanning and advertising)
  • GATT server and client operations
  • Connection management

Modules§

linux
Linux/BlueZ platform implementation
mock
Mock BLE adapter for testing

Structs§

DiscoveredDevice
Discovered BLE device
StubAdapter
Stub adapter for testing and platforms without BLE

Enums§

ConnectionEvent
Connection event types
DisconnectReason
Reason for disconnection

Traits§

BleAdapter
Platform-specific BLE adapter

Type Aliases§

ConnectionCallback
Callback for connection events
DiscoveryCallback
Callback for discovered devices