lib/qubitro-mqtt/client.rb in qubitro-mqtt-0.0.7 vs lib/qubitro-mqtt/client.rb in qubitro-mqtt-0.0.8
- old
+ new
@@ -34,14 +34,14 @@
# Number of seconds to wait for acknowledgement packets (default is 5 seconds)
attr_accessor :ack_timeout
# Device ID to authenticate to the server with
- attr_accessor :deviceId
+ attr_accessor :device_id
# Device Token to authenticate to the server with
- attr_accessor :deviceToken
+ attr_accessor :device_token
# The topic that the Will message is published to
attr_accessor :will_topic
# Contents of message that is sent by server when client disconnect
@@ -66,12 +66,12 @@
:version => '3.1.1',
:keep_alive => 15,
:clean_session => true,
:client_id => nil,
:ack_timeout => 5,
- :deviceId => nil,
- :deviceToken => nil,
+ :device_id => nil,
+ :device_token => nil,
:will_topic => nil,
:will_payload => nil,
:will_qos => 0,
:will_retain => false,
:ssl => false
@@ -250,12 +250,12 @@
packet = MQTT::Packet::Connect.new(
:version => @version,
:clean_session => @clean_session,
:keep_alive => @keep_alive,
:client_id => @client_id,
- :deviceId => @deviceId,
- :deviceToken => @deviceToken,
+ :device_id => @device_id,
+ :device_token => @device_token,
:will_topic => @will_topic,
:will_payload => @will_payload,
:will_qos => @will_qos,
:will_retain => @will_retain
)
@@ -577,11 +577,11 @@
end
{
:host => uri.host,
:port => uri.port || nil,
- :deviceId => uri.user ? URI.unescape(uri.user) : nil,
- :deviceToken => uri.password ? URI.unescape(uri.password) : nil,
+ :device_id => uri.device_id ? URI.unescape(uri.device_id) : nil,
+ :device_token => uri.device_token ? URI.unescape(uri.device_token) : nil,
:ssl => ssl
}
end
def next_packet_id