Skip to content

Commit

Permalink
Fix environment variables and a missed FromStr use
Browse files Browse the repository at this point in the history
  • Loading branch information
ssnover committed Nov 26, 2023
1 parent f4cf86d commit 620d9c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@ jobs:
RUSTFLAGS: "${{ matrix.idf-version == 'v5.1.1' && '--cfg espidf_time64 ' || ''}} ${{ '-C default-linker-libraries' }}"
WIFI_SSID: "ssid"
WIFI_PASS: "pass"
ESP_DEVICE_IP: "192.168.1.250"
GATEWAY_IP: "192.168.1.1"
GATEWAY_NETMASK: "24"
run: cargo build --examples --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
4 changes: 3 additions & 1 deletion examples/wifi_static_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use embedded_svc::wifi::{AuthMethod, ClientConfiguration, Configuration as WifiConfiguration};
use std::net::Ipv4Addr;
use std::str::FromStr;

use esp_idf_svc::hal::prelude::Peripherals;
use esp_idf_svc::ipv4::{
Expand Down Expand Up @@ -74,13 +75,14 @@ fn configure_wifi(wifi: &mut EspWifi<'_>) -> anyhow::Result<()> {
ip_configuration: IpConfiguration::Client(IpClientConfiguration::Fixed(IpClientSettings {
ip: static_ip,
subnet: Subnet {
gateway: gateway_ip,
gateway: gateway_addr,
mask: Mask(netmask),
},
// Can also be set to Ipv4Addrs if you need DNS
dns: None,
secondary_dns: None,
})),
route_priority: 0,
stack: NetifStack::Sta,
custom_mac: None,
})?;
Expand Down

0 comments on commit 620d9c3

Please sign in to comment.