meshtastic 0.0.131 → 0.0.132

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: 7d5c8125b93a40c6bf9c026e9772c358780efccd8c726429374f236dde76ee3e
4
- data.tar.gz: dddc89b1ff453d5f1d632c08b829c423ae37d4da2eefbe73e486404abc7ba1bb
3
+ metadata.gz: 55a43435391e779611e5b054b48922b801ede63b8e2a1475ca6231bee6fea0dc
4
+ data.tar.gz: a174043a34c15e67ac5d3633b2f3e7cb4e8043103f1ec772511dfe07ab4e25e1
5
5
  SHA512:
6
- metadata.gz: e5c6a5f73853b09707850e2d3f33bfd9cd93f35dc5db352589f384d5c246640b6bdd377ff054096bd94d5c5896953a47a2fa05ec03e10057ad075cd051d675ce
7
- data.tar.gz: 186455cdf4cefe78b9d4711515675ee06f8664e4cb431e0865103a1ad6a6663484e754aa1358dd8442239e3ce74b9d57e7385b152ed6ef65d15518cd01a2b9ce
6
+ metadata.gz: 56e964f576c853715ba6991d86e4136f40e2c7aca7a33ab51cc0d395c826738bcc97556b05d3556a611b131520d714a016a9a8fe49235dc8dff0c63cdf3cff16
7
+ data.tar.gz: 9ceb1c0ba1b34b56d44cfdc9c382c2cbee879607555f61671ed4d1d21961ccdb2057b1ce702c74223712191b76382414375ff1a54a63688ff54ba2e6af7fe631
data/README.md CHANGED
@@ -30,6 +30,7 @@ At the moment the only module available is `Meshtastic::MQTT`. To view MQTT mes
30
30
  require 'meshtastic'
31
31
  Meshtastic::MQTT.help
32
32
  mqtt_obj = Meshastic::MQTT.connect
33
+ puts mqtt_obj.inspect
33
34
  Meshtastic::MQTT.subscribe(
34
35
  mqtt_obj: mqtt_obj,
35
36
  include: '_APP, LongFast'
@@ -43,6 +44,7 @@ require 'meshtastic'
43
44
  mqtt_obj = Meshastic::MQTT.connect
44
45
  Meshtastic::MQTT.subscribe(
45
46
  mqtt_obj: mqtt_obj,
47
+ root_topic: 'msh',
46
48
  region: 'US',
47
49
  topic: '2/e/LongFast/#',
48
50
  psks: { LongFast: 'AQ==' }
@@ -61,7 +63,9 @@ Meshtastic::MQTT.send_text(
61
63
  mqtt_obj: mqtt_obj,
62
64
  from: client_id,
63
65
  to: '!ffffffff',
64
- topic: "msh/US/2/e/LongFast/#{client_id}",
66
+ root_topic: 'msh',
67
+ region: 'US',
68
+ topic: '2/e/LongFast/#',
65
69
  channel: 93,
66
70
  text: 'Hello, World!',
67
71
  psks: { LongFast: 'AQ==' }
@@ -75,6 +79,7 @@ require 'meshtastic'
75
79
  mqtt_obj = Meshastic::MQTT.connect
76
80
  Meshtastic::MQTT.subscribe(
77
81
  mqtt_obj: mqtt_obj,
82
+ root_topic: 'msh',
78
83
  region: 'US',
79
84
  topic: '2/e/LongFast/#',
80
85
  psks: { LongFast: 'AQ==' },
@@ -255,7 +255,7 @@ module Meshtastic
255
255
  # to: 'optional - Destination ID (Default: "!ffffffff")',
256
256
  # root_topic: 'optional - root topic (default: msh)',
257
257
  # region: 'optional - region e.g. "US/VA", etc (default: US)',
258
- # topic: 'optional - topic to publish to (default: "2/e/LongFast")',
258
+ # topic: 'optional - topic to publish to (default: "2/e/LongFast/#")',
259
259
  # channel: 'optional - channel (Default: 6)',
260
260
  # text: 'optional - Text Message (Default: SYN)',
261
261
  # want_ack: 'optional - Want Acknowledgement (Default: false)',
@@ -270,9 +270,11 @@ module Meshtastic
270
270
  opts[:to] ||= '!ffffffff'
271
271
  opts[:root_topic] ||= 'msh'
272
272
  opts[:region] ||= 'US'
273
- opts[:topic] ||= '2/e/LongFast'
273
+ opts[:topic] ||= '2/e/LongFast/#'
274
+ opts[:topic] = opts[:topic].to_s.gsub('/#', '')
274
275
  opts[:channel] ||= 6
275
276
  absolute_topic = "#{opts[:root_topic]}/#{opts[:region]}/#{opts[:topic]}/#{opts[:from]}"
277
+ opts[:topic] = absolute_topic
276
278
  opts[:via] = :mqtt
277
279
 
278
280
  # TODO: Implement chunked message to deal with large messages
@@ -339,7 +341,7 @@ module Meshtastic
339
341
  to: 'optional - Destination ID (Default: \"!ffffffff\")',
340
342
  root_topic: 'optional - root topic (default: msh)',
341
343
  region: 'optional - region e.g. 'US/VA', etc (default: US)',
342
- topic: 'optional - topic to publish to (default: '2/e/LongFast')',
344
+ topic: 'optional - topic to publish to (default: '2/e/LongFast/#')',
343
345
  channel: 'optional - channel (Default: 6)',
344
346
  text: 'optional - Text Message (Default: SYN)',
345
347
  want_ack: 'optional - Want Acknowledgement (Default: false)',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.131'
4
+ VERSION = '0.0.132'
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.131
4
+ version: 0.0.132
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.