1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-FileCopyrightText: 2026 Roman Valls Guimera <brainstorm@nopcode.org>
// SPDX-FileCopyrightText: 2026 Julio Beltran Ortega <jubeormk1@gmail.com>
// SPDX-FileCopyrightText: 2026 Angus Gratton <gus@projectgus.com>
// SPDX-FileCopyrightText: 2026 Sergio Gasquez <sergio.gasquez@gmail.com>
// SPDX-FileCopyrightText: 2026 pancake <pancake@nopcode.org>
// SPDX-FileCopyrightText: 2026 Gabriel Ku Wei Bin <gabriel.ku@fsfe.org>
// SPDX-FileCopyrightText: 2026 Anthony Tambasco <anthony.tambasco@fastmail.com>
//
// SPDX-License-Identifier: GPL-3.0-or-later
//! `WiFi` hardware abstraction trait.
use crate::;
/// `WiFi`-specific extension of [`NetworkProviderHal`].
///
/// Platforms with a `WiFi` radio implement this in addition to
/// [`NetworkProviderHal`]. Consumers configure the access point (or, in
/// the future, station) parameters with [`Self::configure_ap`], then call
/// [`NetworkProviderHal::bring_up`] to start the stack.
///
/// Currently only access-point mode is defined. Station mode will be added
/// when client connectivity to existing networks is needed.
///
/// # Example
///
/// ```ignore
/// async fn start_ap<W: WifiHal>(wifi: &mut W) -> Result<(), HalError> {
/// let config = WifiApConfigStatic {
/// ssid: heapless::String::from("MyDevice"),
/// password: Some(heapless::String::from("secretpass")),
/// channel: 6,
/// mac: [0x02, 0x03, 0x04, 0x05, 0x06, 0x07],
/// };
/// wifi.configure_ap(config)?;
/// let _stack = wifi.bring_up().await?;
/// Ok(())
/// }
/// ```