made stub pc client
This commit is contained in:
parent
9b15d4509c
commit
8f2510588f
1 changed files with 522 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ use core::{cell::RefCell, str::from_utf8};
|
|||
use common::{Name, Request};
|
||||
use embassy_net::tcp::TcpSocket;
|
||||
use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex};
|
||||
use embassy_time::Duration;
|
||||
use embedded_io_async::Write;
|
||||
use log::*;
|
||||
use postcard::from_bytes;
|
||||
|
|
@ -21,6 +22,7 @@ pub async fn server_task(stack: embassy_net::Stack<'static>) {
|
|||
|
||||
loop {
|
||||
let mut socket = TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer);
|
||||
socket.set_timeout(Some(Duration::from_secs(3)));
|
||||
info!("Listening on TCP:1234...");
|
||||
if let Err(e) = socket.accept(1234).await {
|
||||
warn!("accept error: {:?}", e);
|
||||
|
|
|
|||
Loading…
Reference in a new issue