mqtt_client library

Classes

AsciiPayloadConverter
Converts string data to and from the MQTT wire format
AutoReconnect
Auto reconnect event
ConnectAckMessageAvailable
The connect acknowledge message available event raised by the Connection class
DisconnectOnNoMessageSent
Disconnect on sent message failed event
DisconnectOnNoPingResponse
Disconnect on keep alive on no ping response event
IMqttConnectionHandler
The connection handler interface class
IPublishingManager
Interface that defines how the publishing manager publishes messages to the broker and how it passed on messages that are received from the broker.
MessageAvailable
The message available event raised by the Connection class
MessageIdentifierDispenser
Message identifier handling
MessageReceived
Message recieved class for publishing
MqttByteBuffer
Utility class to allow stream like access to a sized byte buffer. This class is in effect a cut-down implementation of the C# NET System.IO class with Mqtt client specific extensions.
MqttCancellableAsyncSleep
Cancellable asynchronous sleep support class
MqttClient
A client class for interacting with MQTT Data Packets. Do not instantiate this class directly, instead instantiate either a MqttClientServer class or an MqttBrowserClient as needed. This class now provides common functionality between server side and web based clients.
MqttClientConnectionStatus
Records the status of the last connection attempt
MqttClientConstants
Library wide constants
MqttClientPayloadBuilder
Utility class to assist with the building of message topic payloads. Implements the builder pattern, i.e. returns itself to allow chaining.
MqttClientTopicFilter
This class allows specific topics to be listened for. It essentially acts as a bandpass filter for the topics you are interested in if you subscribe to more than one topic or use wildcard topics. Simply construct it, and listen to its message stream rather than that of the client. Note this class will only filter valid receive topics so if you filter on wildcard topics for instance, which you should only subscribe to, it will always generate a no match.
MqttConnectAckMessage
Message that indicates a connection acknowledgement.
MqttConnectAckVariableHeader
Implementation of the variable header for an MQTT ConnectAck message.
MqttConnectFlags
Represents the connect flags part of the MQTT Variable Header
MqttConnectionBase<T extends Object>
The MQTT client connection base class
MqttConnectionHandlerBase
This class provides shared connection functionality to serverand browser connection handler implementations.
MqttConnectionKeepAlive
Implements keep alive functionality on the Mqtt Connection, ensuring that the connection remains active according to the keep alive seconds setting. This class implements the keep alive by sending an MqttPingRequest to the broker if a message has not been sent or received within the keep alive period. Optionally a disconnect on no response property can be set to force disconnect the client if the broker does not respond to a ping request for a specified period of time.
MqttConnectMessage
An Mqtt message that is used to initiate a connection to a message broker.
MqttConnectPayload
Class that contains details related to an MQTT Connect messages payload.
MqttConnectVariableHeader
Implementation of the variable header for an MQTT Connect message.
MqttDisconnectMessage
Implementation of an MQTT Disconnect Message.
MqttEncoding
Encoding implementation that can encode and decode strings in the MQTT string format.
MqttHeader
Represents the Fixed Header of an MQTT message.
MqttLogger
Library wide logging class
MqttMessage
Represents an MQTT message that contains a fixed header, variable header and message body.
MqttMessageFactory
Factory for generating instances of MQTT Messages
MqttPayload
Represents the payload (Body) of an MQTT Message.
MqttPingRequestMessage
Implementation of an MQTT ping Request Message.
MqttPingResponseMessage
Implementation of an MQTT ping Request Message.
MqttPublishAckMessage
Implementation of an MQTT Publish Acknowledgement Message, used to ACK a publish message that has it's QOS set to AtLeast or Exactly Once.
MqttPublishAckVariableHeader
Implementation of the variable header for an MQTT Publish Acknowledgement message.
MqttPublishCompleteMessage
Implementation of an MQTT Publish Complete Message.
MqttPublishCompleteVariableHeader
Implementation of the variable header for an MQTT Publish Complete message.
MqttPublishMessage
Implementation of an MQTT Publish Message, used for publishing telemetry data along a live MQTT stream.
MqttPublishPayload
Class that contains details related to an MQTT Connect messages payload
MqttPublishReceivedMessage
Implementation of an MQTT Publish Received Message.
MqttPublishReceivedVariableHeader
Implementation of the variable header for an MQTT Publish Received message.
MqttPublishReleaseMessage
Implementation of an MQTT Publish Release Message.
MqttPublishReleaseVariableHeader
Implementation of the variable header for an MQTT Publish Release message.
MqttPublishVariableHeader
Implementation of the variable header for an MQTT Connect message.
MqttReceivedMessage<T>
Represents a MQTT message that has been received from a broker.
MqttSubscribeAckMessage
Implementation of an MQTT Subscribe Ack Message.
MqttSubscribeAckPayload
Class that contains details related to an MQTT Subscribe Ack messages payload.
MqttSubscribeAckVariableHeader
Implementation of the variable header for an MQTT Subscribe Ack message.
MqttSubscribeMessage
Implementation of an MQTT Subscribe Message.
MqttSubscribePayload
Class that contains details related to an MQTT Subscribe messages payload
MqttSubscribeVariableHeader
Implementation of the variable header for an MQTT Subscribe message.
MqttUnsubscribeAckMessage
Implementation of an MQTT Unsubscribe Ack Message.
MqttUnsubscribeAckVariableHeader
Implementation of the variable header for an MQTT Unsubscribe Ack message.
MqttUnsubscribeMessage
Implementation of an MQTT Unsubscribe Message.
MqttUnsubscribePayload
Class that contains details related to an MQTT Unsubscribe messages payload
MqttUnsubscribeVariableHeader
Implementation of the variable header for an MQTT Unsubscribe message.
MqttUtilities
General library wide utilties
MqttVariableHeader
Represents the base class for the Variable Header portion of some MQTT Messages.
PassthruPayloadConverter
Acts as a pass through for the raw data without doing any conversion.
PayloadConverter<T>
Interface that defines the methods and properties that must be provided by classes that interpret and convert inbound and outbound published message data.
Protocol
Protocol selection helper class, protocol defaults V3.1
PublicationTopic
Implementation of a Publication topic that performs additional validations of messages that are published.
PublishingManager
Handles the logic and workflow surrounding the message publishing and receipt process.
ReadWrapper
State and logic used to read from the underlying network stream.
Resubscribe
Re subscribe event
Subscription
Entity that captures data related to an individual subscription
SubscriptionsManager
A class that can manage the topic subscription process.
SubscriptionTopic
Implementation of a Subscription topic that performs additional validations of topics that are subscribed to.
Topic
Provides the base implementation of an MQTT topic.

Enums

MqttConnectionState
Enumeration that indicates various client connection states
MqttConnectReturnCode
Enumeration of allowable connection request return codes from a broker.
MqttDisconnectionOrigin
Enumeration that indicates the origin of a client disconnection
MqttMessageType
An enumeration of all available MQTT Message Types
MqttQos
Enumeration of available QoS types.
MqttReadWriteFlags
Enumeration used by subclasses to tell the variable header what should be read from the underlying stream.
MqttSubscriptionStatus
Describes the status of a subscription

Typedefs

AutoReconnectCallback = void Function()
The client auto reconnect callback type
AutoReconnectCompleteCallback = void Function()
The client auto reconnect complete callback type
ConnectCallback = void Function()
The client Connect callback type
DisconnectCallback = void Function()
The client disconnect callback type
MessageCallbackFunction = bool Function(MqttMessage? message)
Callback function definitions
PongCallback = void Function()
Ping response received callback
SubscribeCallback = void Function(String topic)
Subscribed and Unsubscribed callback typedefs
SubscribeFailCallback = void Function(String topic)
UnsubscribeCallback = void Function(String? topic)
Validation = void Function(Topic topic)

Exceptions / Errors

ClientIdentifierException
Exception thrown when a client identifier included in a message is too long.
ConnectionException
Exception thrown when the connection state is incorrect.
IncorrectInstantiationException
Exception thrown when a browser or server client is instantiated incorrectly.
InvalidHeaderException
Exception thrown when processing a header that is invalid in some way.
InvalidMessageException
Exception thrown when processing a Message that is invalid in some way.
InvalidPayloadSizeException
Exception that is thrown when the payload of a message is not the correct size.
InvalidTopicException
Exception thrown when the topic of a message is invalid
NoConnectionException
Exception thrown when the client fails to connect