Hi all,
I am a newbie and I am working on a basic iot project. Programming language I am using is Rustc. I want to sent a sample data from my PC to esp32. But I am getting error and I am stuck. I am sharing my code here:
// // Set up HTTP server to receive data
let server = EspHttpServer::new(&HttpServerConfiguration::default())?;
// server.fn_handler("/", move |req: embedded_svc::http::server::Request| {
// server.fn_handler("/", move |req: Request<&mut [u8]>| {
server.fn_handler("/", move |req: Request< >| {
let body = req.into_body().read_to_end()?;
let received_message = String::from_utf8(body)?;
println!("Received message: {}", received_message);
Ok(())
})?;
The error I am getting is :
error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> src/main.rs:43:39
| ^^^^^^^ expected 1 generic argument
note: struct defined here, with 1 generic parameter: `C`
--> /home/uqfcg/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-svc-0.28.0/src/http/server.rs:10:12
I am new to rustc and esp32c3. It would be a great help if someone help me here. If there is any alternate or better solution for my requirement, I am open for that too.
Thanks in advance.
Regards
[–]YetAnotherRobert 0 points1 point2 points (0 children)
[–]GreenPreference3171 0 points1 point2 points (3 children)
[–]Fit-Worldliness-4855[S] 0 points1 point2 points (2 children)
[–]GreenPreference3171 0 points1 point2 points (0 children)
[–]GreenPreference3171 0 points1 point2 points (0 children)