#ifndef AUTH_H #define AUTH_H #include #include #include #ifdef __cplusplus extern "C" { #endif // Tamanho máximo da tag RFID (incluindo '\0') #define AUTH_TAG_MAX_LEN 20 // Evento enviado ao EVSE Manager após leitura de tag typedef struct { char tag[AUTH_TAG_MAX_LEN]; // Tag lida bool authorized; // true se tag for válida } auth_event_t; /** * @brief Inicializa o sistema de autenticação. * Carrega configuração e inicia o leitor Wiegand (wg26). */ void auth_init(void); /** * @brief Define a fila de eventos que receberá auth_event_t. */ void auth_set_event_queue(QueueHandle_t queue); /** * @brief Ativa ou desativa o módulo de autenticação (RFID). * Essa configuração é salva em NVS. */ void auth_set_enabled(bool value); /** * @brief Verifica se a autenticação está habilitada. */ bool auth_is_enabled(void); /** * @brief Adiciona uma nova tag válida. */ bool auth_add_tag(const char *tag); /** * @brief Remove uma tag previamente cadastrada. */ bool auth_remove_tag(const char *tag); /** * @brief Verifica se uma tag está cadastrada. */ bool auth_tag_exists(const char *tag); /** * @brief Lista as tags registradas (via ESP_LOG). */ void auth_list_tags(void); /** * @brief Processa uma tag lida (usado pelo leitor Wiegand). */ void auth_process_tag(const char *tag); #ifdef __cplusplus } #endif #endif // AUTH_H