Brings the led_strip example into the cpp app, targeting the ESP32-C3: - Access point led-XXXXXX (open) plus a Wi-Fi client configured from the web Settings tab, with credentials stored in NVS and reconnect backoff - mDNS as led.local with an HTTP service on port 80 - HTTP server with an embedded web UI and a JSON API for patterns and Wi-Fi - Pattern runner for solid, rainbow, chase, breathe, blink, pulse, transition and circle on a 119-LED WS2812 strip (GPIO 10) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
27 lines
801 B
C++
27 lines
801 B
C++
/*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
#include "esp_err.h"
|
|
#include "esp_wifi_types.h"
|
|
#include "settings.h"
|
|
|
|
/** @brief Start Wi-Fi (AP `led-XXXXXX` plus an optional client), and mDNS as led.local. Needs NVS. */
|
|
esp_err_t net_start(void);
|
|
|
|
/** @brief Fill buf with the AP SSID, e.g. "led-A1B2C3". */
|
|
void net_ap_ssid(char *buf, size_t len);
|
|
|
|
/** @brief Client link state and its IPv4 address ("" if not connected). */
|
|
bool net_sta_status(char *ip, size_t ip_len);
|
|
|
|
/** @brief Save credentials, then connect the client with them. */
|
|
esp_err_t net_sta_connect(const wifi_creds_t *c);
|
|
|
|
/** @brief Scan for networks. On entry *count is the array size; on exit, the number found. */
|
|
esp_err_t net_scan(wifi_ap_record_t *recs, uint16_t *count);
|