Function esp_ward::connectivity::mqtt::mqtt_connect_custom
source · pub async fn mqtt_connect_custom<'a>(
stack: &'static Stack<WifiDevice<'static, WifiStaDevice>>,
client_id: &'a str,
rx_buffer_socket: &'a mut [u8],
tx_buffer_socket: &'a mut [u8],
write_buffer_mqtt: &'a mut [u8; 4096],
recv_buffer_mqtt: &'a mut [u8; 4096],
broker_address: &str,
broker_port: u16,
username: Option<&'a str>,
password: Option<&'a str>
) -> MqttClient<'a, TcpSocket<'a>, 5, CountingRng>Expand description
Establishes a custom MQTT connection with the specified parameters.
§Arguments
stack- The networkStackto use for the MQTT connection.client_id- The client ID for the MQTT session.rx_buffer_socket- Receive buffer for the socket connection.tx_buffer_socket- Transmit buffer for the socket connection.write_buffer_mqtt- Write buffer for the MQTT client.recv_buffer_mqtt- Receive buffer for the MQTT client.broker_address- The address of the MQTT broker.broker_port- The port of the MQTT broker.username- Optional username for MQTT broker authentication.password- Optional password for MQTT broker authentication.
§Returns
Returns an MqttClient instance configured for the specified broker and
credentials.