-
Notifications
You must be signed in to change notification settings - Fork 82
API
Sebastian Clausen edited this page Oct 16, 2017
·
5 revisions
-
options
is the client connection options. Defaults:-
hostname
:localhost
-
port
:443
-
protocol
:ws
-
path
:mqtt
-
-
client
is a already created MQTT.js client instance
With this method, you can observe messages for a mqtt topic. The observable will only emit messages matching the filter. The first one subscribing to the resulting observable executes a mqtt subscribe. The last one unsubscribing this filter executes a mqtt unsubscribe.
-
filter
the mqtt filter to subscribe
This method publishes a message for a topic with optional options. The returned observable will complete, if publishing was successfull and will throw an error, if the publication fails
-
topic
the topic to publish the message to -
message
any message to publish -
options
the options to publish with-
qos
the qos level -
retain
set totrue
if message should be retained
-
This static method shall be used to determine whether an MQTT topic matches a given filter. The matching rules are specified in the MQTT standard documenation and in the library test suite.
-
filter
A filter may contain wildcards like '#' and '+'. -
topic
A topic may not contain wildcards.