22 lines
955 B
C
22 lines
955 B
C
/* SPDX-License-Identifier: GPL-3.0-only */
|
|
/* Bounded UART0 input helpers for physical-administration prompts. */
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
/* Hidden input accepts printable ASCII with CR/LF submit, BS/DEL editing and
|
|
* Ctrl-C cancellation. Overflow or any other byte rejects the entire prompt on
|
|
* submit (ESP_ERR_INVALID_SIZE), even after editing; rejected input is wiped.
|
|
* capacity includes the trailing NUL. Visible line editing is unchanged. */
|
|
esp_err_t console_input_read_hidden(const char *prompt,
|
|
uint8_t *output, size_t capacity,
|
|
size_t minimum_length, size_t maximum_length,
|
|
size_t *output_length);
|
|
esp_err_t console_input_read_line(const char *prompt,
|
|
uint8_t *output, size_t capacity,
|
|
size_t *output_length);
|