MQTT client connection
The client that owns this connection
Open the actual connection to the server (async).
A Promise which completes whether the connection succeeds or fails. If connection fails, the Promise will reject with an exception. If connection succeeds, the Promise will return a boolean that is true for resuming an existing session, or false if the session is new
Forces all written events to be buffered in memory. The buffered data will be flushed when BufferedEventEmitter.uncork is called.
Close the connection (async).
Promise which completes when the connection is closed.
The name of the event
Publish message (async). If the device is offline, the PUBLISH packet will be sent once the connection resumes.
Contents of message
Quality of Service for delivering this message
If true, the server will store the message and its QoS so that it can be delivered to future subscribers whose subscriptions match the topic name
Promise which returns a MqttRequest which will contain the packet id of the PUBLISH packet.
Subscribe to a topic filter (async). The client sends a SUBSCRIBE packet and the server responds with a SUBACK.
subscribe() may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.
callback is invoked each time a message matching
topic is received. It is possible for such messages to arrive before
the SUBACK is received.
Subscribe to this topic filter, which may include wildcards
Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
Optional callback invoked when message received.
Promise which returns a MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.
Flushes all data buffered since BufferedEventEmitter.cork was called.
NOTE: It is HIGHLY recommended that uncorking should always be done via
process.nextTick, not during the
Unsubscribe from a topic filter (async). The client sends an UNSUBSCRIBE packet, and the server responds with an UNSUBACK.
The topic filter to unsubscribe from. May contain wildcards.
Promise wihch returns a MqttRequest which will contain the packet id of the UNSUBSCRIBE packet being acknowledged. Promise is resolved when an UNSUBACK is received from the server or is rejected when an exception occurs.
Generated using TypeDoc