Expand description
MQTT v5 client for the Wiznet W5500 SPI internet offload chip.
§Limitations
This is very basic at the moment, and will be expanded in the future.
- Does not support password protected MQTT servers.
- Only supports QoS 0: At most once delivery.
§Example
use w5500_mqtt::{
ll::{
net::{Ipv4Addr, SocketAddrV4},
Sn,
},
Client, ClientId, Event, DST_PORT, SRC_PORT,
};
let mut client: Client = Client::new(
Sn::Sn2,
SRC_PORT,
SocketAddrV4::new(Ipv4Addr::new(192, 168, 5, 6), DST_PORT),
);
// wait for a connection or die trying
while !matches!(client.process(&mut w5500, monotonic_secs())?, Event::None) {}
// publish to "duck" with a payload "quack"
client.publish(&mut w5500, "duck", b"quack")?;
// subscribe to "cow"
client.subscribe(&mut w5500, "cow")?;
§Relevant Specifications
§Feature Flags
All features are disabled by default.
Re-exports§
Modules§
- tls
w5500-tls
- MQTT over TLS
Structs§
- Client
- W5500 MQTT client.
- Client
Id - MQTT client identifier
- Publish
Reader - Reader for a published message on a subscribed topic.
- SubAck
SUBSCRIBE
acknowledgment.- UnSub
Ack UNSUBSCRIBE
acknowledgment.
Enums§
- Connect
Reason Code - Connect Reason Codes
- Error
- MQTT client errors.
- Event
- MQTT events.
- State
- Internal MQTT client state.
- SubAck
Reason Code - Subscribe acknowledgment codes.
- UnSub
AckReason Code - Unsubscribe acknowledgment codes.