|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <IKeyboardProvider.h>
Public Member Functions | |
| virtual | ~IKeyboardProvider ()=default |
| virtual bool | isConnected () const =0 |
| virtual bool | typeString (const char *text, uint16_t delayMs=50)=0 |
| virtual bool | typeChar (char c)=0 |
| virtual bool | isBusy () const =0 |
| virtual void | cancel ()=0 |
| virtual const char * | getStatusText () const |
| virtual bool | setDiscoverable (bool on) |
Keyboard Provider Interface
Allows modules (TOTP, Password, etc.) to type text without knowing the implementation details (BLE HID, USB HID, etc.).
Usage pattern: // Consumer (e.g., TOTP module): auto* kb = ServiceRegistry::instance().request<IKeyboardProvider>(ServiceType::KEYBOARD); if (kb && kb->isConnected()) { kb->typeString(totpCode); }
// Provider (e.g. a USB or BLE HID module): ServiceRegistry::instance().provide<IKeyboardProvider>(ServiceType::KEYBOARD, this);
Definition at line 23 of file IKeyboardProvider.h.
|
virtualdefault |
|
pure virtual |
Cancel current typing operation
|
inlinevirtual |
Get human-readable connection status for UI
Definition at line 63 of file IKeyboardProvider.h.
References isConnected().
|
pure virtual |
Check if typing operation is in progress
|
pure virtual |
Check if keyboard is connected and ready to type
Referenced by getStatusText().
|
inlinevirtual |
Enter or leave a discoverable/pairable state so a host can bond. For BLE providers this enables the stack and starts advertising the input-device profile; for USB providers it is a no-op.
| on | true to become discoverable, false to stop |
Definition at line 72 of file IKeyboardProvider.h.
|
pure virtual |
Type a single character
| c | Character to type |
|
pure virtual |
Type a string (UTF-8 encoded)
| text | Text to type (null-terminated) |
| delayMs | Delay between keystrokes in milliseconds (default 50ms) |