54 void init(
const char* title, uint8_t maxPinLength = 6, uint8_t maxAttempts = 3);
84 const char*
getPin()
const {
return buffer_; }
118 void onEnter(
void* context)
override;
119 void onTick(uint32_t nowMs)
override;
120 void render(
bool partial)
override;
122 const char*
getName()
const override {
return "PinEntryView"; }
126 const char*
title_ =
nullptr;
129 uint8_t maxLength_ = 6;
130 uint8_t minLength_ = 4;
131 uint8_t attempts_ = 0;
132 uint8_t maxAttempts_ = 3;
133 bool lockedOut_ =
false;
134 uint32_t lockoutStartMs_ = 0;
140 bool showMessages_ =
true;
142 void addDigit(
char digit);
171 uint8_t maxLength = 6,
172 uint8_t minLength = 4,
173 uint8_t maxAttempts = 3);
uint8_t getAttempts() const
void setShowMessages(bool enabled)
void init(const char *title, uint8_t maxPinLength=6, uint8_t maxAttempts=3)
Initializes PIN entry configuration and clears current input.
void setOnFailure(FailureCallback callback)
static constexpr uint8_t MAX_PIN_LENGTH
const char * getName() const override
void setOnVerify(VerifyCallback callback)
void(*)(bool lockedOut) FailureCallback
InputResult onKey(char key) override
Handles key input for PIN entry and actions.
void onEnter(void *context) override
Resets entry state when the view is entered.
void(*)() SuccessCallback
void setMinLength(uint8_t minLen)
void setOnSuccess(SuccessCallback callback)
void setOnCancel(CancelCallback callback)
void onTick(uint32_t nowMs) override
Updates lockout state and periodic countdown refresh.
static constexpr uint32_t LOCKOUT_DURATION_MS
const char * getPin() const
const char * getFooterHint() const override
Returns localized footer hint text.
void clear()
Clears the internal PIN buffer.
uint32_t getLockoutRemaining() const
Returns remaining lockout time.
bool(*)(const char *pin) VerifyCallback
Centralized key-code constants for cdc_views.
PinEntryView * showPinEntry(const char *title, PinEntryView::VerifyCallback onVerify, PinEntryView::SuccessCallback onSuccess, uint8_t maxLength=6, uint8_t minLength=4, uint8_t maxAttempts=3)
Shows a shared PIN entry view instance.