AppMqttClient class
Main application Mqtt class acting as a facade over different Mqtt versions.
Constructors
- AppMqttClient({bool allowPrintLog = false, required String identifier})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onMqttConnected ↔ dynamic Function(bool isReconnect)?
-
getter/setter pair
- onMqttDisconnected ↔ dynamic Function()?
-
getter/setter pair
- onMqttMessage ↔ dynamic Function(String topic, String payload)?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
[String? username, String? password]) → Future< void> -
disconnect(
) → void -
getConnectionState(
) → MqttConnectionState? - Gets the current connection state - Delegate to wrapper
-
initialize(
{required MqttVersion version, String? hostConfig, int? portConfig, bool useWebSocket = true, int keepAlivePeriod = 200, bool autoReconnect = true}) → void - Initializes the Mqtt client based on the specified version and configuration.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
publish(
String topic, String payload, {MqttQos qos = MqttQos.atLeastOnce, bool retain = false}) → void - Publishes a message - Delegate to wrapper
-
subscribeTo(
String channel, {MqttQos mqttQos = MqttQos.atLeastOnce}) → void -
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeTo(
String channel, {bool expectAcknowledge = false}) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited