fn query<'a, W5500: Udp>(
        &mut self,
        w5500: &'a mut W5500,
    ) -> Result<Query<'a, W5500>, Error<W5500::Error>> {
        w5500.set_sn_dhar(self.sn, &MDNS_HARDWARE_DST)?;
        w5500.set_sn_ttl(self.sn, 255)?;
        w5500.set_sn_cr(self.sn, SocketCommand::Close)?;
        while w5500.sn_sr(self.sn)? != Ok(SocketStatus::Closed) {}
        w5500.set_sn_port(self.sn, self.port)?;
        const MODE: SocketMode = SocketMode::DEFAULT
            .set_protocol(Protocol::Udp)
            .enable_multi();
        w5500.set_sn_mr(self.sn, MODE)?;
        w5500.set_sn_cr(self.sn, SocketCommand::Open)?;
        // This will not hang, the socket status will always change to Udp
        // after a open command with SN_MR set to UDP.
        // (unless you do somthing silly like holding the W5500 in reset)
        while w5500.sn_sr(self.sn)? != Ok(SocketStatus::Udp) {}
        w5500.set_sn_dest(self.sn, &self.server)?;
        const HEADER_SEEK: SeekFrom = SeekFrom::Start(Header::LEN);
        let mut writer: UdpWriter<W5500> = w5500.udp_writer(self.sn)?;
        writer.seek(HEADER_SEEK)?;
        Ok(Query {
            writer,
            header: Header::new_query(0),
        })
    }
/// A simple MDNS query.
///
/// This will only broadcast an MDNS query, it will not wait for a reply.
A simple MDNS query.
This will only broadcast an MDNS query, it will not wait for a reply.
A simple MDNS query . This will only broadcast an MDNS query it will not wait for a reply .
fn query<'a, W5500: Udp>(
        &mut self,
        w5500: &'a mut W5500,
    ) -> Result<Query<'a, W5500>, Error<W5500::Error>> {
        w5500.set_sn_dhar(self.sn, &MDNS_HARDWARE_DST)?;
        w5500.set_sn_ttl(self.sn, 255)?;
        w5500.set_sn_cr(self.sn, SocketCommand::Close)?;
        while w5500.sn_sr(self.sn)? != Ok(SocketStatus::Closed) {}
        w5500.set_sn_port(self.sn, self.port)?;
        const MODE: SocketMode = SocketMode::DEFAULT
            .set_protocol(Protocol::Udp)
            .enable_multi();
        w5500.set_sn_mr(self.sn, MODE)?;
        w5500.set_sn_cr(self.sn, SocketCommand::Open)?;
        // This will not hang, the socket status will always change to Udp
        // after a open command with SN_MR set to UDP.
        // (unless you do somthing silly like holding the W5500 in reset)
        while w5500.sn_sr(self.sn)? != Ok(SocketStatus::Udp) {}
        w5500.set_sn_dest(self.sn, &self.server)?;
        const HEADER_SEEK: SeekFrom = SeekFrom::Start(Header::LEN);
        let mut writer: UdpWriter<W5500> = w5500.udp_writer(self.sn)?;
        writer.seek(HEADER_SEEK)?;
        Ok(Query {
            writer,
            header: Header::new_query(0),
        })
    }
fn query < ' a , W5500 : Udp > ( & mut self , w5500 : & ' a mut W5500 , ) -> Result < Query < ' a , W5500 > , Error < W5500 :: Error > > { w5500 . set_sn_dhar ( self . sn , & MDNS_HARDWARE_DST ) ? ; w5500 . set_sn_ttl ( self . sn , 255 ) ? ; w5500 . set_sn_cr ( self . sn , SocketCommand :: Close ) ? ; while w5500 . sn_sr ( self . sn ) ? != Ok ( SocketStatus :: Closed ) { } w5500 . set_sn_port ( self . sn , self . port ) ? ; const MODE : SocketMode = SocketMode :: DEFAULT . set_protocol ( Protocol :: Udp ) . enable_multi ( ) ; w5500 . set_sn_mr ( self . sn , MODE ) ? ; w5500 . set_sn_cr ( self . sn , SocketCommand :: Open ) ? ; // This will not hang, the socket status will always change to Udp // after a open command with SN_MR set to UDP. // (unless you do somthing silly like holding the W5500 in reset) while w5500 . sn_sr ( self . sn ) ? != Ok ( SocketStatus :: Udp ) { } w5500 . set_sn_dest ( self . sn , & self . server ) ? ; const HEADER_SEEK : SeekFrom = SeekFrom :: Start ( Header :: LEN ) ; let mut writer : UdpWriter < W5500 > = w5500 . udp_writer ( self . sn ) ? ; writer . seek ( HEADER_SEEK ) ? ; Ok ( Query { writer , header : Header :: new_query ( 0 ) , } ) }
A simple MDNS query.
A simple MDNS query .
&mut self
w5500
&'a mut W5500
&mut self
w5500
&'a mut W5500