Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Nov 5, 2024
1 parent 1587dec commit 727ec80
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions esp-wifi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ heapless = { version = "0.8.0", default-features = false, features = [
num-derive = { version = "0.4.2" }
num-traits = { version = "0.2.19", default-features = false }
esp-wifi-sys = { version = "0.6.0", git = "https://github.com/esp-rs/esp-wifi-sys.git", rev = "a3e2ed64e9095f120bbcebe6287ddf62760774db"}
embassy-sync = { version = "0.6.0" }
embassy-net-driver = { version = "0.2.0" }
embassy-sync = { version = "0.6.0", optional = true }
embassy-net-driver = { version = "0.2.0", optional = true }
libm = "0.2.8"
cfg-if = "1.0.0"
portable-atomic = { version = "1.9.0", default-features = false }
Expand Down Expand Up @@ -114,16 +114,16 @@ defmt = ["dep:defmt", "smoltcp?/defmt", "esp-hal/defmt", "bt-hci?/defmt", "esp-w
log = ["dep:log", "esp-hal/log", "esp-wifi-sys/log"]

## Enable WiFi support
wifi = ["dep:enumset"]
wifi = ["dep:enumset", "dep:embassy-net-driver", "dep:embassy-sync"]

## Enable esp-now support
esp-now = ["wifi"]

## Enable sniffer mode support
sniffer = ["wifi"]

## Enable BLE support
ble = ["esp-hal/bluetooth"]

## Enable esp-now support
esp-now = ["wifi"]
ble = ["esp-hal/bluetooth", "dep:bt-hci", "dep:embassy-sync"]

## Provide implementations of smoltcp traits
smoltcp = ["dep:smoltcp"]
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/wifi_embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! Because of the huge task-arena size configured this won't work on ESP32-S2
//!
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% CHIPS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6

#![no_std]
Expand Down Expand Up @@ -220,7 +220,7 @@ async fn connection(mut controller: WifiController<'static>) {
});
controller.set_configuration(&client_config).unwrap();
println!("Starting wifi");
controller.start().await.unwrap();
controller.start_async().await.unwrap();
println!("Wifi started!");
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/wifi_embassy_access_point_with_sta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! Because of the huge task-arena size configured this won't work on ESP32-S2
//!
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% CHIPS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6

#![no_std]
Expand Down Expand Up @@ -315,15 +315,15 @@ async fn connection(mut controller: WifiController<'static>) {
println!("Device capabilities: {:?}", controller.get_capabilities());

println!("Starting wifi");
controller.start().await.unwrap();
controller.start_async().await.unwrap();
println!("Wifi started!");

loop {
match esp_wifi::wifi::get_ap_state() {
WifiState::ApStarted => {
println!("About to connect...");

match controller.connect().await {
match controller.connect_async().await {
Ok(_) => {
// wait until we're no longer connected
controller.wait_for_event(WifiEvent::StaDisconnected).await;
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/wifi_embassy_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! Because of the huge task-arena size configured this won't work on ESP32-S2 and ESP32-C2
//!
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% CHIPS: esp32 esp32s2 esp32s3 esp32c3 esp32c6

#![allow(static_mut_refs)]
Expand Down Expand Up @@ -193,12 +193,12 @@ async fn connection(mut controller: WifiController<'static>) {
});
controller.set_configuration(&client_config).unwrap();
println!("Starting wifi");
controller.start().await.unwrap();
controller.start_async().await.unwrap();
println!("Wifi started!");
}
println!("About to connect...");

match controller.connect().await {
match controller.connect_async().await {
Ok(_) => println!("Wifi connected!"),
Err(e) => {
println!("Failed to connect to wifi: {e:?}");
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/wifi_embassy_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! - offers one service with three characteristics (one is read/write, one is write only, one is read/write/notify)
//! - pressing the boot-button on a dev-board will send a notification if it is subscribed
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/ble
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/ble
//% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2

#![no_std]
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/wifi_embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! Because of the huge task-arena size configured this won't work on ESP32-S2
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils
//% CHIPS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6

#![no_std]
Expand Down Expand Up @@ -185,12 +185,12 @@ async fn connection(mut controller: WifiController<'static>) {
});
controller.set_configuration(&client_config).unwrap();
println!("Starting wifi");
controller.start().await.unwrap();
controller.start_async().await.unwrap();
println!("Wifi started!");
}
println!("About to connect...");

match controller.connect().await {
match controller.connect_async().await {
Ok(_) => println!("Wifi connected!"),
Err(e) => {
println!("Failed to connect to wifi: {e:?}");
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/wifi_embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Because of the huge task-arena size configured this won't work on ESP32-S2
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now
//% CHIPS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6

#![no_std]
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/wifi_embassy_esp_now_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Because of the huge task-arena size configured this won't work on ESP32-S2
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/embassy-net esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/wifi-default esp-wifi/wifi esp-wifi/utils esp-wifi/esp-now
//% CHIPS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6

#![no_std]
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/wifi_embassy_trouble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! - automatically notifies subscribers every second
//!
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/async esp-wifi/ble
//% FEATURES: embassy embassy-generic-timers esp-wifi esp-wifi/ble
//% CHIPS: esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2

#![no_std]
Expand Down

0 comments on commit 727ec80

Please sign in to comment.