Skip to content

Commit

Permalink
Update readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Jun 27, 2024
1 parent c5b0e8d commit 19efdf8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions edge-mdns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ For other protocols, look at the [edge-net](https://github.com/ivmarkov/edge-net
```rust
use core::net::{Ipv4Addr, Ipv6Addr};

use edge_mdns::buf::BufferAccess;
use edge_mdns::buf::{BufferAccess, VecBufAccess};
use edge_mdns::domain::base::Ttl;
use edge_mdns::io::{self, MdnsIoError, DEFAULT_SOCKET};
use edge_mdns::{host::Host, HostAnswersMdnsHandler};
use edge_nal::{UdpBind, UdpSplit};

use embassy_sync::blocking_mutex::raw::NoopRawMutex;

use embassy_sync::mutex::Mutex;
use embassy_sync::signal::Signal;

use log::*;

use rand::{thread_rng, RngCore};
Expand All @@ -42,8 +41,8 @@ fn main() {
let stack = edge_nal_std::Stack::new();

let (recv_buf, send_buf) = (
Mutex::<NoopRawMutex, _>::new([0; 1500]),
Mutex::<NoopRawMutex, _>::new([0; 1500]),
VecBufAccess::<NoopRawMutex, 1500>::new(),
VecBufAccess::<NoopRawMutex, 1500>::new(),
);

futures_lite::future::block_on(run::<edge_nal_std::Stack, _, _>(
Expand All @@ -61,10 +60,8 @@ async fn run<T, RB, SB>(
) -> Result<(), MdnsIoError<T::Error>>
where
T: UdpBind,
RB: BufferAccess,
SB: BufferAccess,
RB::BufferSurface: AsMut<[u8]>,
SB::BufferSurface: AsMut<[u8]>,
RB: BufferAccess<[u8]>,
SB: BufferAccess<[u8]>,
{
info!("About to run an mDNS responder for our PC. It will be addressable using {our_name}.local, so try to `ping {our_name}.local`.");

Expand Down

0 comments on commit 19efdf8

Please sign in to comment.