exmqttc v0.4.1 Exmqttc
Exmqttc
provides a connection to a MQTT server based on emqttc
Link to this section Summary
Types
A PID like type
A QoS level
A single topic, a list of topics or a list of tuples of topic and QoS level
Functions
Disconnect socket from MQTT server
Publish a message to MQTT.
opts
is a keywordlist and supports :retain
with a boolean and :qos
with an integer from 1 to 3
Start the Exmqttc client. callback_module
is used for callbacks and should implement the Exmqttc.Callback
behaviour.
opts
are passed directly to GenServer.
mqtt_opts
are reformatted so all options can be passed in as a Keyworld list
Subscribe to the given topic(s) given as topics
with a given qos
Publish a message to MQTT synchronously.
opts
is a keywordlist and supports :retain
with a boolean and :qos
with an integer from 1 to 3
Subscribe to the given topics while blocking until the subscribtion has been confirmed by the server
Link to this section Types
A PID like type
A QoS level
A single topic, a list of topics or a list of tuples of topic and QoS level
Link to this section Functions
Disconnect socket from MQTT server
publish(pid, binary, binary, list) :: :ok
Publish a message to MQTT.
opts
is a keywordlist and supports :retain
with a boolean and :qos
with an integer from 1 to 3
Start the Exmqttc client. callback_module
is used for callbacks and should implement the Exmqttc.Callback
behaviour.
opts
are passed directly to GenServer.
mqtt_opts
are reformatted so all options can be passed in as a Keyworld list.
mqtt_opts
supports the following options:
host
: Connection host, charlist, default:'localhost'
port
: Connection port, integer, default 1883client_id
: Binary ID for client, automatically set to UUID if not specifiedclean_sess
: MQTT cleanSession flag.true
disables persistent sessions on the serverkeepalive
: Keepalive timer, integerusername
: Login username, binarypassword
: Login password, binarywill
: Last will, keywordlist, sample:[qos: 1, retain: false, topic: "WillTopic", payload: "I died"]
connack_timeout
: Timeout for connack package, integer, default 60puback_timeout
: Timeout for puback package, integer, default 8suback_timeout
: Timeout for suback package, integer, default 4ssl
: List of ssl optionsauto_resub
: Automatically resubscribe to topics, boolean, default:false
reconnect
: Automatically reconnect on lost connection, integer (), defaultfalse
Subscribe to the given topic(s) given as topics
with a given qos
.
sync_publish(pid, binary, binary, list) :: :ok
Publish a message to MQTT synchronously.
opts
is a keywordlist and supports :retain
with a boolean and :qos
with an integer from 1 to 3
Subscribe to the given topics while blocking until the subscribtion has been confirmed by the server.