diff --git a/esp-wifi/src/wifi/mod.rs b/esp-wifi/src/wifi/mod.rs index fe007a2a..865ee0cc 100644 --- a/esp-wifi/src/wifi/mod.rs +++ b/esp-wifi/src/wifi/mod.rs @@ -842,7 +842,6 @@ pub fn new_with_config<'d>( _ => {} } - // TODO: we'll need two devices for AP-STA mode let mode = WifiMode::try_from(&config)?; Ok(( @@ -871,12 +870,24 @@ pub fn new_with_mode<'d>( ) } -/// Creates a new Wifi device and controller in AP-STA mode. +/// Creates a new Wifi device and controller in AP-STA mode, with a default configuration. /// /// Returns a tuple of `(AP device, STA device, controller)`. pub fn new_ap_sta<'d>( inited: &EspWifiInitialization, device: impl Peripheral
+ 'd, +) -> Result<(WifiDevice<'d>, WifiDevice<'d>, WifiController<'d>), WifiError> { + crate::hal::into_ref!(device); + + new_ap_sta_with_config(inited, device, Default::default(), Default::default()) +} + +/// Creates a new Wifi device and controller in AP-STA mode. +/// +/// Returns a tuple of `(AP device, STA device, controller)`. +pub fn new_ap_sta_with_config<'d>( + inited: &EspWifiInitialization, + device: impl Peripheral
+ 'd, sta_config: embedded_svc::wifi::ClientConfiguration, ap_config: embedded_svc::wifi::AccessPointConfiguration, ) -> Result<(WifiDevice<'d>, WifiDevice<'d>, WifiController<'d>), WifiError> {