BrokerConnection class

Used for connection to a mqtt broker. The homie_dart package does not contain an implementation of this abstract class! Implement the mqtt logic yourselfe or use the homie_dart_on_mqtt package instead (recommended)!

Constructors

BrokerConnection()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

connect(String lastWillTopic, Uint8List lastWillData, bool lastWillRetained, int lastWillQos) Future<Null>
Connects to the mqtt broker. The connection must respect the last will parameters. The connect method of each instance may only be called once. If it is called a second time on the same instance a StateError must be thrown.
disconnect() Future<Null>
Disconnects from the mqtt broker and cancels all subscriptions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
publish(String topic, Uint8List data, bool retained, int qos) Future<Null>
Publishes data to topic with respect to retained. Awaiting the returned future should guarantee the publishing of the message to the broker with respect to the quality of service qos. A qos of 0 does not guarentee anything and might return immediately. If this is called while disconnecting, a DisconnectingError should be thrown
subscribe(String topic, int qos) Future<Stream<Uint8List>>
Subscribes to topic. Awaiting the returned future gives a Stream whichs events are incoming messages on the topic. If this is called while disconnecting, a DisconnectingError should be thrown.
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited