change wifi name + handle client bad request
This commit is contained in:
parent
c0402e0dca
commit
937aafb099
@ -123,8 +123,8 @@ async fn main(spawner: Spawner) {
|
|||||||
unwrap(spawner.spawn(net_task(runner))).await;
|
unwrap(spawner.spawn(net_task(runner))).await;
|
||||||
|
|
||||||
#[cfg(not(feature = "wifi-connect"))]
|
#[cfg(not(feature = "wifi-connect"))]
|
||||||
//control.start_ap_open("cyw43", 5).await;
|
control.start_ap_open("TicTacToe", 5).await;
|
||||||
control.start_ap_wpa2("cyw43", "password", 5).await;
|
// control.start_ap_wpa2("TicTacToe", "password", 5).await;
|
||||||
|
|
||||||
#[cfg(feature = "wifi-connect")]
|
#[cfg(feature = "wifi-connect")]
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@ use embassy_time::{Duration, Timer};
|
|||||||
use embedded_io_async::Write as _;
|
use embedded_io_async::Write as _;
|
||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use pico_website::unwrap;
|
|
||||||
|
|
||||||
use crate::game::{GameClient, Team};
|
use crate::game::{GameClient, Team};
|
||||||
|
|
||||||
@ -77,7 +76,17 @@ pub async fn listen_task(stack: embassy_net::Stack<'static>, team: Team, port: u
|
|||||||
Some(b"GET") => HttpRequestType::Get,
|
Some(b"GET") => HttpRequestType::Get,
|
||||||
Some(b"POST") => HttpRequestType::Post,
|
Some(b"POST") => HttpRequestType::Post,
|
||||||
Some(t) => {
|
Some(t) => {
|
||||||
warn!("Unknown request type : {}", unwrap(from_utf8(t)).await);
|
match from_utf8(t) {
|
||||||
|
Ok(t) => {
|
||||||
|
warn!("Unknown request type : {}", t);
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
warn!(
|
||||||
|
"Error while parsing request type : {}\nRaw type : {:?}",
|
||||||
|
e, t
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@ -86,7 +95,16 @@ pub async fn listen_task(stack: embassy_net::Stack<'static>, team: Team, port: u
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
match l1.next() {
|
match l1.next() {
|
||||||
Some(path) => unwrap(from_utf8(path)).await,
|
Some(path) => match from_utf8(path) {
|
||||||
|
Ok(p) => p,
|
||||||
|
Err(e) => {
|
||||||
|
warn!(
|
||||||
|
"Error while parsing requested path : {}\nRaw path : {:?}",
|
||||||
|
e, path
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
None => {
|
None => {
|
||||||
warn!("No path");
|
warn!("No path");
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user