feat: WLAN-Treiber mit Onboarding-AP, Build-Credentials und Befehl net

This commit is contained in:
Michael Sauer
2026-09-11 22:50:43 +02:00
parent 2f7cadaeee
commit 4c2f9e5374
12 changed files with 361 additions and 4 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef NL_WIFI_H
#define NL_WIFI_H
#include <stdbool.h>
#include <stdint.h>
#include "config/nl_settings.h"
typedef struct {
const char *mode; /* "sta" | "ap" | "apsta" */
char ssid[NL_SSID_LEN]; /* configured station SSID */
int rssi; /* dBm, 0 when not connected */
char ip[16]; /* station IP, else the AP IP when the AP is up, else "" */
char sta_ip[16]; /* "" when the station has no IP */
const char *error; /* result of the last onboarding test or NULL */
} nl_wifi_status_t;
/* Starts the network task. An empty ssid starts the onboarding AP. Strings are copied. */
void nl_wifi_start(const char *ssid, const char *pass, const char *ap_pass);
/* Starts an onboarding test with new credentials (from the HTTP task). 0 = queued. */
int nl_wifi_request_onboard(const char *ssid, const char *pass);
/* True while the unconfigured onboarding AP is open (API without token). */
bool nl_wifi_open_access(void);
void nl_wifi_status(nl_wifi_status_t *out);
/* "ninlight-<mac4>", valid after nl_wifi_start(). */
const char *nl_wifi_hostname(void);
void nl_wifi_mac(uint8_t mac[6]);
#endif