Custom scope

This commit is contained in:
Ondrej Babec 2022-02-25 16:49:48 +01:00
parent 5729feef15
commit a862637a77
No known key found for this signature in database
GPG Key ID: 13E577E3769B2079
2 changed files with 9 additions and 7 deletions

View File

@ -34,16 +34,18 @@ where
self.network_driver.send(self.buffer, len).await ?; self.network_driver.send(self.buffer, len).await ?;
//connack //connack
let connack = { {
self.receive().await ?; self.receive().await ?;
let mut packet = ConnackPacket::new(); let mut packet = ConnackPacket::<5>::new();
packet.decode(&mut BuffReader::new(self.buffer)); packet.decode(&mut BuffReader::new(self.buffer));
packet
if packet.connect_reason_code != 0x00 {
todo!();
}
}; };
if connack.connect_reason_code != 0x00 {
todo!();
}
// publish // publish

View File

@ -7,7 +7,7 @@ use rust_mqtt::packet::subscription_packet::SubscriptionPacket;
use rust_mqtt::tokio_network::TokioNetwork; use rust_mqtt::tokio_network::TokioNetwork;
#[tokio::main] #[tokio::main]
fn main() { async fn main() {
env_logger::builder() env_logger::builder()
.filter_level(log::LevelFilter::Info) .filter_level(log::LevelFilter::Info)
.format_timestamp_nanos() .format_timestamp_nanos()