Files
ruvnet--RuView/firmware/esp32-csi-node/main/c6_softap_he.h
T
ruv 948768bdda feat(firmware): v0.6.7-esp32 — real LP-core program + C6 soft-AP HE/TWT helper
ADR-110 P9 — software-only unblocks for the WITNESS-LOG-110 §B
hardware-blocked items. Two new modules, both default-off so v0.6.6 fleets
see no behavior change.

LP-core (B4 path):
- New firmware/esp32-csi-node/main/lp_core/main.c: real RISC-V LP-core
  motion-gate program with debounce + monotonic motion_count counter.
- c6_lp_core.c rewritten to load + run the LP binary via ulp_lp_core_run
  when CONFIG_C6_LP_CORE_ENABLE=y; falls back to the v0.6.6 ext1 GPIO-wake
  path otherwise (keeps regression surface small).
- ulp_embed_binary() wired in main/CMakeLists.txt, gated on the Kconfig.
- New Kconfig knobs: C6_LP_POLL_PERIOD_US (default 10 ms),
  C6_LP_DEBOUNCE_SAMPLES (default 3).
- Exposes c6_lp_core_motion_count() / c6_lp_core_poll_count() for the
  witness harness — once an INA/Joulescope is on the bench, B4 is one
  capture away from a measured number.

Soft-AP HE (B1/B2 unblock):
- New c6_softap_he.{h,c}: brings up the C6 in AP+STA mode with WPA2-PSK
  + HE advertisement, so a second C6 in STA mode can negotiate real
  iTWT against a known-cooperative AP without buying an 11ax router.
- main.c calls c6_softap_he_start() right before esp_wifi_start() when
  CONFIG_C6_SOFTAP_HE_ENABLE=y.
- New Kconfig knobs: C6_SOFTAP_HE_{SSID,PSK,CHANNEL} with NVS overrides
  via softap_ssid / softap_psk / softap_chan in the ruview namespace.

Build artifacts (IDF v5.4, both green, RC=0):
- S3 8 MB: 1093 KB (47% partition slack)
- C6 4 MB: 1019 KB (45% partition slack)
- SHA-256 sums in dist/firmware-v0.6.7/SHA256SUMS.txt

Doc updates: CHANGELOG wave-3 entry, ADR-110 phase table gets P5
upgrade note + new P9 row, WITNESS-LOG-110 gets new A0 section
recording the v0.6.7 build evidence.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-23 11:10:34 -04:00

67 lines
1.9 KiB
C

/**
* @file c6_softap_he.h
* @brief ESP32-C6 soft-AP with Wi-Fi 6 (HE) capability + TWT Responder.
*
* ADR-110 §B1/B2 cheap-unblock: turn one C6 board into the iTWT-capable
* AP that the C6-DevKit-on-the-shelf-only bench is missing. A second C6
* board in STA mode can then negotiate a real iTWT agreement against
* this AP and measure deterministic CSI cadence — without buying an
* 11ax router.
*
* Build-gated by CONFIG_C6_SOFTAP_HE_ENABLE (default n). When disabled,
* all functions become no-ops so non-AP firmwares pay zero overhead.
*
* NVS overrides (read at boot if present, fall back to Kconfig defaults):
* softap_ssid (string, up to 32 chars)
* softap_psk (string, 8..63 chars)
* softap_chan (u8, 1..13)
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
#include <stdint.h>
#include <stdbool.h>
#if defined(CONFIG_IDF_TARGET_ESP32C6) && defined(CONFIG_C6_SOFTAP_HE_ENABLE)
/**
* Bring up the soft-AP in AP+STA mode with HE (Wi-Fi 6) advertised and
* TWT Responder=1 if the IDF build supports it. Idempotent — safe to
* call once during boot after `esp_wifi_init()`. Returns the channel
* the AP is actually running on (may differ from Kconfig if the IDF
* scanner picks a clearer channel).
*/
esp_err_t c6_softap_he_start(uint8_t *out_channel);
/**
* True after the IDF reports the AP has started successfully.
*/
bool c6_softap_he_is_up(void);
/**
* Number of currently associated stations (read-only, refreshed on the
* WIFI_EVENT_AP_STACONNECTED/DISCONNECTED events).
*/
uint8_t c6_softap_he_sta_count(void);
#else /* disabled — no-op stubs */
static inline esp_err_t c6_softap_he_start(uint8_t *out_channel)
{
if (out_channel) *out_channel = 0;
return ESP_OK;
}
static inline bool c6_softap_he_is_up(void) { return false; }
static inline uint8_t c6_softap_he_sta_count(void) { return 0; }
#endif
#ifdef __cplusplus
}
#endif