minimal startup running
This commit is contained in:
@@ -175,7 +175,7 @@ impl Esp<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn wifi_ap(&mut self) -> anyhow::Result<Stack> {
|
||||
pub(crate) async fn wifi_ap(&mut self) -> anyhow::Result<Stack<'static>> {
|
||||
let _ssid = match self.load_config() {
|
||||
Ok(config) => config.network.ap_ssid.clone(),
|
||||
Err(_) => heapless::String::from_str("PlantCtrl Emergency Mode").unwrap(),
|
||||
@@ -207,7 +207,7 @@ impl Esp<'_> {
|
||||
let controller = self.controller.take().unwrap();
|
||||
spawner.spawn(connection(controller)).ok();
|
||||
spawner.spawn(net_task(runner)).ok();
|
||||
spawner.spawn(run_dhcp(stack, gw_ip_addr_str)).ok();
|
||||
spawner.spawn(run_dhcp(stack.clone(), gw_ip_addr_str)).ok();
|
||||
|
||||
loop {
|
||||
if stack.is_link_up() {
|
||||
@@ -699,7 +699,7 @@ impl Esp<'_> {
|
||||
}
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn run_dhcp(stack: &'static Stack<'static>, gw_ip_addr: &'static str) {
|
||||
async fn run_dhcp(stack: Stack<'static>, gw_ip_addr: &'static str) {
|
||||
use core::net::{Ipv4Addr, SocketAddrV4};
|
||||
|
||||
use edge_dhcp::{
|
||||
@@ -716,7 +716,7 @@ async fn run_dhcp(stack: &'static Stack<'static>, gw_ip_addr: &'static str) {
|
||||
let mut gw_buf = [Ipv4Addr::UNSPECIFIED];
|
||||
|
||||
let buffers = UdpBuffers::<3, 1024, 1024, 10>::new();
|
||||
let unbound_socket = Udp::new(*stack, &buffers);
|
||||
let unbound_socket = Udp::new(stack, &buffers);
|
||||
let mut bound_socket = unbound_socket
|
||||
.bind(core::net::SocketAddr::V4(SocketAddrV4::new(
|
||||
Ipv4Addr::UNSPECIFIED,
|
||||
|
||||
Reference in New Issue
Block a user