class MQTT::Client

Defined in:

mqtt-client.cr
mqtt-client/connection.cr
mqtt-client/message.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(host : String, port : Int32 = 1883, tls : Bool = false, client_id : String = "", clean_session : Bool = true, user : String | Nil = nil, password : String | Nil = nil, will : Message | Nil = nil, keepalive : Int = 60_u16, autoack : Bool = true, sock_opts : MQTT::Client::SocketOptions = SocketOptions.new) #

[View source]

Instance Method Detail

def close #

[View source]
def disconnect #

[View source]
def on_message(&blk : ReceivedMessage -> Nil) #

[View source]
def ping #

[View source]
def publish(topic : String, body, qos : Int = 0_u8, retain = false) #

[View source]
def publish(*messages : Message) #

[View source]
def subscribe(topic : String, qos : Int = 0_u8) #

[View source]
def subscribe(*topics : Tuple(String, Int)) #

[View source]
def unsubscribe(*topics : String) #

[View source]