CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
BlePairingPromptView.h
Go to the documentation of this file.
1#pragma once
2
3#include "cdc_ui/IView.h"
4#include <cstdint>
5
6namespace cdc::ui {
7
20public:
27 void prepare(uint16_t connHandle, uint32_t passkey, uint32_t timeoutMs = 30000);
28
29 // IView
30 void render(bool partial) override;
31 InputResult onKey(char key) override;
32 void onTick(uint32_t nowMs) override;
33 void onEnter(void* context) override;
34 const char* getName() const override { return "BlePairingPromptView"; }
35 const char* getFooterHint() const override { return "[Y] OK [N] Cancel"; }
36
37private:
38 uint16_t connHandle_ = 0xFFFF;
39 uint32_t passkey_ = 0;
40 uint32_t timeoutMs_ = 30000;
41 uint32_t enteredAtMs_ = 0;
42 bool responded_ = false;
43
44 void respond(bool accept);
45};
46
47} // namespace cdc::ui
void onTick(uint32_t nowMs) override
void render(bool partial) override
void onEnter(void *context) override
const char * getName() const override
const char * getFooterHint() const override
void prepare(uint16_t connHandle, uint32_t passkey, uint32_t timeoutMs=30000)
InputResult onKey(char key) override
Centralized key-code constants for cdc_views.
Definition IModule.h:8
InputResult
Definition IView.h:10