exmqttc v0.3.0 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 to MQTT server

Publish a message to MQTT

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

Subscribe to the given topics while blocking until the subscribtion has been confirmed by the server

Link to this section Types

Link to this type pidlike()
pidlike() :: pid | port | atom | {atom, node}

A PID like type

Link to this type qos()
qos() :: :qos0 | :qos1 | :qos2

A QoS level

Link to this type topics()
topics() :: String.t | [String.t] | [{String.t, qos}]

A single topic, a list of topics or a list of tuples of topic and QoS level

Link to this section Functions

Link to this function disconnect(pid)
disconnect(pid) :: :ok

Disconnect socket to MQTT server

Link to this function publish(pid, topic, payload, opts \\ [])
publish(pid, binary, binary, list) :: :ok

Publish a message to MQTT

Link to this function start_link(callback_module, opts \\ [], mqtt_opts \\ [])

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.

Link to this function subscribe(pid, topics, qos \\ :qos0)
subscribe(pidlike, topics, qos) :: :ok

Subscribe to the given topic(s) given as topics with a given qos.

Link to this function sync_publish(pid, topic, payload, opts \\ [])
sync_publish(pid, binary, binary, list) :: :ok

Publish a message to MQTT synchronously

Link to this function sync_subscribe(pid, topics)
sync_subscribe(pid, topics) :: :ok

Subscribe to the given topics while blocking until the subscribtion has been confirmed by the server.