Module: PahoMqtt

Extended by:
PahoMqtt
Included in:
PahoMqtt
Defined in:
lib/paho_mqtt/handler.rb,
lib/paho-mqtt.rb,
lib/paho_mqtt/client.rb,
lib/paho_mqtt/packet.rb,
lib/paho_mqtt/version.rb,
lib/paho_mqtt/publisher.rb,
lib/paho_mqtt/ssl_helper.rb,
lib/paho_mqtt/subscriber.rb,
lib/paho_mqtt/packet/base.rb,
lib/paho_mqtt/packet/puback.rb,
lib/paho_mqtt/packet/pubrec.rb,
lib/paho_mqtt/packet/pubrel.rb,
lib/paho_mqtt/packet/suback.rb,
lib/paho_mqtt/packet/connack.rb,
lib/paho_mqtt/packet/connect.rb,
lib/paho_mqtt/packet/pingreq.rb,
lib/paho_mqtt/packet/pubcomp.rb,
lib/paho_mqtt/packet/publish.rb,
lib/paho_mqtt/packet/pingresp.rb,
lib/paho_mqtt/packet/unsuback.rb,
lib/paho_mqtt/packet/subscribe.rb,
lib/paho_mqtt/connection_helper.rb,
lib/paho_mqtt/packet/disconnect.rb,
lib/paho_mqtt/packet/unsubscribe.rb

Overview

Copyright © 2016-2017 Pierre Goudet <[email protected]>

All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 and Eclipse Distribution License v1.0 which accompany this distribution.

The Eclipse Public License is available at

https://eclipse.org/org/documents/epl-v10.php.

and the Eclipse Distribution License is available at

https://eclipse.org/org/documents/edl-v10.php.

Contributors:

Pierre Goudet - initial committer

Defined Under Namespace

Modules: Packet, SSLHelper Classes: Client, ConnectionHelper, Exception, Handler, PacketException, ProtocolViolation, Publisher, ReadingException, Subscriber, WritingException

Constant Summary collapse

DEFAULT_SSL_PORT =

Default connection setup

8883
DEFAULT_PORT =
1883
SELECT_TIMEOUT =
0
LOOP_TEMPO =
0.005
RECONNECT_RETRY_TIME =
3
RECONNECT_RETRY_TEMPO =
5
MAX_READ =

MAX size of queue

10
MAX_PUBACK =
20
MAX_PUBREC =
20
MAX_PUBREL =
20
MAX_PUBCOMP =
20
MAX_WRITING =
MAX_PUBACK + MAX_PUBREC + MAX_PUBREL  + MAX_PUBCOMP
MQTT_CS_NEW =

Connection states values

0
MQTT_CS_CONNECTED =
1
MQTT_CS_DISCONNECT =
2
MQTT_ERR_SUCCESS =

Error values

0
MQTT_ERR_FAIL =
1
PACKET_TYPES =
[
  nil,
  PahoMqtt::Packet::Connect,
  PahoMqtt::Packet::Connack,
  PahoMqtt::Packet::Publish,
  PahoMqtt::Packet::Puback,
  PahoMqtt::Packet::Pubrec,
  PahoMqtt::Packet::Pubrel,
  PahoMqtt::Packet::Pubcomp,
  PahoMqtt::Packet::Subscribe,
  PahoMqtt::Packet::Suback,
  PahoMqtt::Packet::Unsubscribe,
  PahoMqtt::Packet::Unsuback,
  PahoMqtt::Packet::Pingreq,
  PahoMqtt::Packet::Pingresp,
  PahoMqtt::Packet::Disconnect,
  nil
]
CONNACK_ERROR_MESSAGE =
{
  0x02 => "Client Identifier is correct but not allowed by remote server.",
  0x03 => "Connection established but MQTT service unvailable on remote server.",
  0x04 => "User name or user password is malformed.",
  0x05 => "Client is not authorized to connect to the server."
}
CLIENT_ATTR_DEFAULTS =
{
    :host => "",
    :port => nil,
    :mqtt_version => '3.1.1',
    :clean_session => true,
    :persistent => false,
    :blocking => false,
    :client_id => nil,
    :username => nil,
    :password => nil,
    :ssl => false,
    :will_topic => nil,
    :will_payload => nil,
    :will_qos => 0,
    :will_retain => false,
    :keep_alive => 60,
    :ack_timeout => 5,
    :on_connack => nil,
    :on_suback => nil,
    :on_unsuback => nil,
    :on_puback => nil,
    :on_pubrel => nil,
    :on_pubrec => nil,
    :on_pubcomp => nil,
    :on_message => nil,
}
VERSION =
"1.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



23
24
25
# File 'lib/paho-mqtt.rb', line 23

def logger
  @logger
end

Instance Method Details

#logger?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/paho-mqtt.rb', line 116

def logger?
  @logger.is_a?(Logger)
end