meshtastic 0.0.101 → 0.0.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdcbcc8b0f330af38add7b4509f97f511a950959078291e701650c4903f94df5
4
- data.tar.gz: f9bcd8889a56c0fc951f02f8a94aec848d55fd008b7adcde4f8dc0373038762b
3
+ metadata.gz: 4c3b82fb9dc1953f506b3ef9cebbaa3d9c605d08c5e05d71f92bb8a19764d926
4
+ data.tar.gz: cb155d903eeed821718c2ac2efe7f2b823b86898d9cc1042fd7d15e10894faca
5
5
  SHA512:
6
- metadata.gz: a0b0e9112e4374fc935824554e302f2b3dc9c8d96da52371adff1634c79f172c1d83c3136e0beb0b49c9ca9d0b9989d308879f4cebedc813a7190eebefba8ff2
7
- data.tar.gz: 1b12ca3bbad17cc2ad2a1428a3bda34654c0cabb96f977c549363a493a93d7b3b421cb7accf5f432c368c599b8ff901e02a51f71630ce1b35a357027be2cd381
6
+ metadata.gz: c7ab96c2458e868b09b10030796a6211c0dc46c1cff2f36ed49bc70d0667b4001661a9d89050f247b8e266dd96ebd82ac48dfa4b64c8f38259ea41035746884e
7
+ data.tar.gz: dbf5a3ba45928cecc42cc408fb238bf159898dd9b34f3a4e242e25ee2cf576087fdc2dcd0bdeff2618df64b536cd58b5d6be74e5f0835238f88e93ce867a4e74
@@ -21,7 +21,8 @@ module Meshtastic
21
21
  # username: 'optional - mqtt username (default: meshdev)',
22
22
  # password: 'optional - (default: large4cats)',
23
23
  # client_id: 'optional - client ID (default: random 4-byte hex string)',
24
- # keep_alive: 'optional - keep alive interval (default: 21)'
24
+ # keep_alive: 'optional - keep alive interval (default: 0)',
25
+ # ack_timeout: 'optional - acknowledgement timeout (default: 30)'
25
26
  # )
26
27
 
27
28
  public_class_method def self.connect(opts = {})
@@ -33,7 +34,8 @@ module Meshtastic
33
34
  client_id = opts[:client_id] ||= SecureRandom.random_bytes(4).unpack1('H*').to_s
34
35
  client_id = format("%0.8x", client_id) if client_id.is_a?(Integer)
35
36
  client_id = client_id.delete('!') if client_id.include?('!')
36
- keep_alive = opts[:keep_alive] ||= 21
37
+ keep_alive = opts[:keep_alive] ||= 0
38
+ ack_timeout = opts[:ack_timeout] ||= 30
37
39
 
38
40
  mqtt_obj = MQTTClient.connect(
39
41
  host: host,
@@ -42,7 +44,11 @@ module Meshtastic
42
44
  password: password,
43
45
  client_id: client_id
44
46
  )
47
+
45
48
  mqtt_obj.keep_alive = keep_alive
49
+ mqtt_obj.ack_timeout = ack_timeout
50
+ mqtt_obj.last_ping_request = 0
51
+ mqtt_obj.last_ping_response = 0
46
52
 
47
53
  mqtt_obj
48
54
  rescue StandardError => e
@@ -278,7 +284,8 @@ module Meshtastic
278
284
  username: 'optional - mqtt username (default: meshdev)',
279
285
  password: 'optional - (default: large4cats)',
280
286
  client_id: 'optional - client ID (default: random 4-byte hex string)',
281
- keep_alive: 'optional - keep alive interval (default: 21)'
287
+ keep_alive: 'optional - keep alive interval (default: 0)',
288
+ ack_timeout: 'optional - acknowledgement timeout (default: 30)'
282
289
  )
283
290
 
284
291
  #{self}.subscribe(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.101'
4
+ VERSION = '0.0.102'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meshtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.101
4
+ version: 0.0.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.