network-provisioning-zephyr
Zephyr port of Espressif's network provisioning protocol (Wi-Fi over BLE / SoftAP / console)
Loading...
Searching...
No Matches
fake_wifi.h
Go to the documentation of this file.
1/*
2 * Test-control API for the fake (simulated) Wi-Fi offload backend
3 * (sim/wifi/fake_wifi.c). Lets a test or a BabbleSim tester program the canned
4 * scan results and the outcome of the next connect attempt, so the full
5 * provisioning manager can run headless on a board with no Wi-Fi hardware
6 * (native_sim / nrf52_bsim) and exercise both the success and failure paths
7 * deterministically.
8 *
9 * Only available when CONFIG_NETWORK_PROV_FAKE_WIFI is enabled; never built
10 * into the real samples.
11 *
12 * SPDX-License-Identifier: Apache-2.0
13 */
14
15#ifndef NETWORK_PROVISIONING_TEST_FAKE_WIFI_H_
16#define NETWORK_PROVISIONING_TEST_FAKE_WIFI_H_
17
18#include <stddef.h>
19#include <stdint.h>
20#include <zephyr/net/wifi.h>
21#include <zephyr/net/wifi_mgmt.h>
22
25 char ssid[WIFI_SSID_MAX_LEN + 1];
26 uint8_t ssid_len;
27 uint8_t bssid[WIFI_MAC_ADDR_LEN];
28 uint8_t channel;
29 int8_t rssi;
30 enum wifi_security_type security;
31};
32
37void fake_wifi_set_scan_aps(const struct fake_wifi_ap *aps, size_t count);
38
45void fake_wifi_set_next_connect_result(enum wifi_conn_status status);
46
53
64void fake_wifi_set_expected_credentials(const char *ssid, const char *pass);
65
67void fake_wifi_reset(void);
68
69#endif /* NETWORK_PROVISIONING_TEST_FAKE_WIFI_H_ */
void fake_wifi_set_scan_aps(const struct fake_wifi_ap *aps, size_t count)
Replace the canned AP list returned by subsequent NET_REQUEST_WIFI_SCAN requests.
void fake_wifi_set_next_connect_sync_error(int errnum)
Make the next NET_REQUEST_WIFI_CONNECT fail synchronously with -errnum (e.g.
void fake_wifi_set_expected_credentials(const char *ssid, const char *pass)
Switch the backend to credential-matching mode: the outcome of each connect is derived from the reque...
void fake_wifi_set_next_connect_result(enum wifi_conn_status status)
Program the conn_status reported for the next NET_REQUEST_WIFI_CONNECT.
void fake_wifi_reset(void)
Reset all programmed state: empty scan list, connect succeeds, no sync error.
A canned access point the fake backend reports from a scan.
Definition fake_wifi.h:24
enum wifi_security_type security
Definition fake_wifi.h:30
char ssid[WIFI_SSID_MAX_LEN+1]
Definition fake_wifi.h:25
int8_t rssi
Definition fake_wifi.h:29
uint8_t channel
Definition fake_wifi.h:28
uint8_t ssid_len
Definition fake_wifi.h:26
uint8_t bssid[WIFI_MAC_ADDR_LEN]
Definition fake_wifi.h:27