Struct minimq::Minimq [−][src]
pub struct Minimq<TcpStack, Clock, const MSG_SIZE: usize, const MSG_COUNT: usize> where
TcpStack: TcpClientStack,
Clock: Clock, {
pub client: MqttClient<TcpStack, Clock, MSG_SIZE, MSG_COUNT>,
// some fields omitted
}
Expand description
The general structure for managing MQTT via Minimq.
Fields
client: MqttClient<TcpStack, Clock, MSG_SIZE, MSG_COUNT>
Implementations
Construct a new MQTT interface.
Args
broker
- The IP address of the broker to connect to.client_id
The client ID to use for communicating with the broker. If empty, rely on the broker to automatically assign a client ID.network_stack
- The network stack to use for communication.clock
- The clock to use for managing MQTT state timing.
Returns
A Minimq
object that can be used for publishing messages, subscribing to topics, and
managing the MQTT state.
Check the MQTT interface for available messages.
Args
f
- A closure to process any received messages. The closure should accept the client, topic, message, and list of proprties (in that order).