upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/unit/stubs/esp_wifi.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-17 01:31:49 +0530
committerYour Name <you@example.com>2026-05-17 01:31:49 +0530
commit347d29658959c7e4b368a15134c183f4ce7a25bc (patch)
tree362b3e40273e3c1435bdd0745de61006041bb803 /tests/unit/stubs/esp_wifi.h
parent4c47ae188b288e7d24bd9566ab3e6a6805d9484f (diff)
Testing infrastructure: AGENTS.md rules + unit test framework + geohash tests (11/11 pass)
- Add AGENTS.md: full project context + mandatory testing rules for AI sessions - Add tests/unit/ with host-compiled C unit test infrastructure - Clean stubs approach: ESP-IDF type stubs in tests/unit/stubs/, no source modifications - Fix geohash.c bit extraction bug (3-byte span) found by unit tests - test_geohash: 11/11 passing with reference vectors (Munich, NYC, origin, boundaries)
Diffstat (limited to 'tests/unit/stubs/esp_wifi.h')
-rw-r--r--tests/unit/stubs/esp_wifi.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/unit/stubs/esp_wifi.h b/tests/unit/stubs/esp_wifi.h
new file mode 100644
index 0000000..6aa5787
--- /dev/null
+++ b/tests/unit/stubs/esp_wifi.h
@@ -0,0 +1,40 @@
1#ifndef STUBS_ESP_WIFI_H
2#define STUBS_ESP_WIFI_H
3
4#include <stdint.h>
5#include <string.h>
6#include "esp_err.h"
7
8#define WIFI_IF_STA 0
9#define WIFI_IF_AP 1
10
11#define WIFI_AUTH_WPA2_PSK 3
12#define WIFI_AUTH_OPEN 0
13
14#define WIFI_MODE_APSTA 3
15
16typedef struct {
17 struct {
18 uint8_t ssid[32];
19 uint8_t password[64];
20 uint8_t channel;
21 uint8_t max_connection;
22 uint8_t ssid_hidden;
23 int authmode;
24 } ap;
25 struct {
26 uint8_t ssid[32];
27 uint8_t password[64];
28 int threshold;
29 struct {
30 int authmode;
31 } sta;
32 } sta;
33} wifi_config_t;
34
35static inline esp_err_t esp_wifi_set_mac(int ifx, const uint8_t *mac) { (void)ifx; (void)mac; return ESP_OK; }
36static inline esp_err_t esp_wifi_set_config(int ifx, const wifi_config_t *cfg) { (void)ifx; (void)cfg; return ESP_OK; }
37static inline esp_err_t esp_wifi_set_mode(uint8_t mode) { (void)mode; return ESP_OK; }
38static inline esp_err_t esp_wifi_start(void) { return ESP_OK; }
39
40#endif