feat: implement the open fallback access point and captive portal

This commit is contained in:
2026-09-01 21:41:23 +03:00
parent fd978f323d
commit 50ed341474
13 changed files with 349 additions and 29 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifndef NETWORK_CONFIGURATION_H
#define NETWORK_CONFIGURATION_H
#include <stdbool.h>
#include <stdint.h>
#include "network_state.h"
enum { kNetworkValidationWindowMs = 30000U, kNetworkSuccessNoticeMs = 15000U };
typedef enum { NETWORK_CONFIGURATION_IDLE, NETWORK_CONFIGURATION_VALIDATING, NETWORK_CONFIGURATION_SUCCESS, NETWORK_CONFIGURATION_FAILED } network_configuration_state_t;
typedef struct {
network_configuration_state_t state;
network_profile_t previous_profile;
bool had_previous_profile;
uint32_t validation_deadline_ms;
uint32_t success_deadline_ms;
} network_configuration_t;
void network_configuration_init(network_configuration_t *configuration);
bool network_configuration_begin(network_configuration_t *configuration, network_manager_t *manager, const network_profile_t *candidate, uint32_t now_ms);
bool network_configuration_validation_timed_out(const network_configuration_t *configuration, uint32_t now_ms);
network_action_t network_configuration_finish(network_configuration_t *configuration, network_manager_t *manager, bool success, uint32_t now_ms);
bool network_configuration_success_notice_expired(const network_configuration_t *configuration, uint32_t now_ms);
bool network_configuration_busy(const network_configuration_t *configuration);
#endif