Kleidos API Search

In development. It changes without notice.

Topic

BLE Facade & HID Manager

The one entry point to Bluetooth for the screens and the portal, and the manager that runs the keyboard service behind it.

  • kleidos::ble::Facade starts and stops the radio, queues what to type and reports how it went, carries the pairing prompts and lists the bonded hosts. No file above this module includes the stack's headers.
  • BleHidManager builds the keyboard service, asks for LE Secure Connections with numeric comparison, and types.
  • kleidos::ble::IBleStack is the same interface as the facade for a test on a computer; each of its members is checked against the facade's when it is compiled.
See also
BLE HID Keyboard, BLE Stack Integration, Pairing & Numeric Comparison

Files

file src/ble/ble_facade.h
Single public BLE entry point for the FSM, UI and web layers.
file src/ble/ble_hid_manager.h
Runtime BLE HID keyboard adapter built on the raw Apache NimBLE host.
file src/ble/i_ble_stack.h
Polymorphic BLE-stack seam used by native unit tests.

Classes

struct kleidos::ble::PeerInfo
Read-only snapshot of the currently connected peer. More about kleidos::ble::PeerInfo
struct kleidos::ble::LinkInfo
Read-only snapshot of the controller and the link, for diagnostics. More about kleidos::ble::LinkInfo
struct kleidos::ble::BondInfo
Read-only snapshot of one bonded-host slot. More about kleidos::ble::BondInfo
class kleidos::ble::Facade
Static facade exposing the entire BLE surface to the rest of the firmware. More about kleidos::ble::Facade
class kleidos::BleHidManager
Static runtime adapter that owns the NimBLE HID session and bond table. More about kleidos::BleHidManager
class kleidos::ble::IBleStack
The subset of ble::Facade a native test drives, implemented by FakeBleStack and checked against the facade's signatures at compile time. More about kleidos::ble::IBleStack

Typedefs

usingkleidos::ble::TypingToken
Monotonic typing-operation handle; 0 = invalid.
usingkleidos::ble::NcTicket
The Numeric Comparison request a dialog shows and answers: its generation and its digits.
usingkleidos::ble::NcVerdict
How a Numeric Comparison request was answered.

Enumerations

enum class kleidos::ble::StartMode : uint8_t { kleidos::ble::StartMode::Bounded30s , kleidos::ble::StartMode::StandbyForever }
enum class kleidos::ble::TypingStatus : uint8_t { kleidos::ble::TypingStatus::Pending, kleidos::ble::TypingStatus::Running, kleidos::ble::TypingStatus::Success, kleidos::ble::TypingStatus::Disconnected, kleidos::ble::TypingStatus::NotConnected, kleidos::ble::TypingStatus::Error, kleidos::ble::TypingStatus::CapsLockOn }
enum class kleidos::BleTypingStatus : uint8_t { kleidos::BleTypingStatus::IDLE, kleidos::BleTypingStatus::PENDING, kleidos::BleTypingStatus::RUNNING, kleidos::BleTypingStatus::SUCCESS, kleidos::BleTypingStatus::NotConnected, kleidos::BleTypingStatus::DISCONNECTED, kleidos::BleTypingStatus::ERROR, kleidos::BleTypingStatus::CapsLockOn }

Enumeration Type Documentation

BleTypingStatus #

enum class kleidos::BleTypingStatus : uint8_t

Async typing operation status; polled via BleHidManager::pollTyping().

Enumerator
IDLE 

No typing in flight (token mismatch / completed long ago).

PENDING 

Queued, waiting for the stack task to pick it up.

RUNNING 

Stack task is sending HID reports.

SUCCESS 

Typed without error.

NotConnected 

Link not in CONNECTED state at start.

DISCONNECTED 

Host disconnected mid-typing.

ERROR 

Generic failure (queue full, post failed, …).

CapsLockOn 

The host's Caps Lock stayed on: nothing, or not all, was typed.

StartMode #

enum class kleidos::ble::StartMode : uint8_t

Advertising lifetime requested at start().

Enumerator
Bounded30s 

Typical credential flow: pair, type, deinit. The pairing window stays closed.

StandbyForever 

Setup's pairing page: the pairing window is open, and stays open while the mode lasts — a connection does not close it. The 3-minute cap bounds advertising only: never a connected link, and it restarts after an authenticated host disconnects. What ends the window is the caller's own Facade::stop(); the page that starts this mode owns it.

TypingStatus #

enum class kleidos::ble::TypingStatus : uint8_t

Result of polling an async typing token via pollTyping().

Enumerator
Pending 

Queued, not yet started.

Running 

Reports in flight.

Success 

Credential typed without error.

Disconnected 

Host disconnected mid-typing.

NotConnected 

Link not connected at start.

Error 

Generic failure.

CapsLockOn 

The host's Caps Lock stayed on: the owner turns it off and sends again.