class MQTT::V3::Client

Overview

https://test.mosquitto.org/

Defined in:

mqtt/v3/client.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(transport : Transport) #

[View source]

Class Method Detail

def self.topic_matches(filter : String, topic : String) #

Based on https://github.com/ralphtheninja/mqtt-match/blob/master/index.js


[View source]

Instance Method Detail

def closed? #

[View source]
def connect(username : String | Nil = nil, password : String | Nil = nil, keep_alive : Int32 = 60, client_id : String = MQTT.generate_client_id, clean_start : Bool = true, will_flag : Bool = false, will_qos : Int32 | QoS = 0, will_retain : Bool = false, will_topic : String | Nil = nil, will_payload : String | Nil = nil) #

[View source]
def disconnect(send_msg = true) : Nil #

[View source]
def last_ping_response : Time | Nil #

[View source]
def parse_message(io) #

[View source]
def ping : Nil #

[View source]
def publish(topic : String, payload = "", retain : Bool = false, qos : QoS = QoS::FireAndForget) #

[View source]
def publish_received(pub) #

[View source]
def subscribe(topics : Hash(String, Tuple(QoS, Proc(String, Bytes, Nil)))) #

http://www.steves-internet-guide.com/understanding-mqtt-topics/


[View source]
def subscribe(*topics, qos : QoS = QoS::FireAndForget, &callback : Proc(String, Bytes, Nil)) #

[View source]
def unsubscribe(topic : String, callback : Proc(String, Bytes, Nil)) #

[View source]
def unsubscribe(*topics) #

[View source]
def wait_close : Nil #

Returns once the MQTT connection has terminated


[View source]