This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//use rust-mqtt = { git = "https://github.com/obabec/rust-mqtt.git", rev = "b5ed04efc694c5a0e4f6925b7f90ebaac9f0504f", default-features = false, features = ["log", "tls"] } | |
//tcp | |
let mqtt_broker_addr = stack.dns_query(broker_str, embassy_net::dns::DnsQueryType::A).await.unwrap(); | |
let mqtt_endpoint = IpEndpoint::new(endpoint, 8883); | |
let mut socket = embassy_net::tcp::TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer); | |
socket.connect(mqtt_endpoint).await.unwrap(); | |
//tls | |
let config: TlsConfig<'_> = TlsConfig::new().with_server_name(&broker_str).enable_rsa_signatures(); |