use the same API call used by `status` as in `shellchat`.
this should also fix the status bar reflecting the correct state.

code fixed but not explicitly tested; if I got this wrong
please re-open!
This commit is contained in:
bunnie 2023-05-28 18:01:46 +08:00
parent a1bf554f89
commit 1b29ea0421

View file

@ -45,10 +45,10 @@ impl<'a> ShellCmdApi<'a> for Wlan {
Ok(_) => write!(ret, "wlan on"),
Err(e) => write!(ret, "Error: {:?}", e),
};
env.netmgr.connection_manager_run().unwrap();
env.netmgr.connection_manager_wifi_on_and_run().unwrap();
}
"off" => {
env.netmgr.connection_manager_stop().unwrap();
env.netmgr.connection_manager_wifi_off_and_stop().unwrap();
let _ = match env.com.wlan_set_off() {
Ok(_) => write!(ret, "wlan off"),
Err(e) => write!(ret, "Error: {:?}", e),