meshtastic 0.0.95 → 0.0.97

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: 97d144971ff7a74ca7623e32e95afca4d2436bb40dc8fec7c9d31d4570627752
4
- data.tar.gz: a00eeb6ed18164c2c3f2da207d01dd5e7dc76515b6e314fc38914e8b4e847748
3
+ metadata.gz: 380975d39b9d6eaf059284f0ecf7fa4cc8a9364c52484fd1953a0549d8cd0753
4
+ data.tar.gz: 6df8e45efd4bff03d8f5ff95c5fe09f3d20d1c21b0c636633ff19d05e720a1c4
5
5
  SHA512:
6
- metadata.gz: a66fc870f5878bdc0e4602cedaae60de5692c131dcfbc3460c462c6907bfe11f099c84799d8f25957db6ba8a285b95c154ab5548c9195f2dcfd002cbd1f98ae1
7
- data.tar.gz: 1d3523d5f2ba4af1fefc6a5818cc3db7b8110dfa7de352b44581d88aac688162a72440793b2e97977ac634bc35585b783350ac88c3836521516f8100de43c0ca
6
+ metadata.gz: 04b5b6da18e7289b2233b7513a85b6db2f5c173dd9e700b0ce416bd172547780f4ac200d98dce321a34078c18f0b10254f8107134543f170736e069263fd299b
7
+ data.tar.gz: b851700c5301a58b61530632a0f9b2bd7ace232f2155bfd7be40e64641fd420da6fc01352f01f73f794980952601c08632adadfee8808fa2ae10f1ef728f47f5
data/README.md CHANGED
@@ -44,7 +44,7 @@ mqtt_obj = Meshastic::MQTT.connect
44
44
  Meshtastic::MQTT.subscribe(
45
45
  mqtt_obj: mqtt_obj,
46
46
  region: 'US',
47
- channel_id_path: '2/e/LongFast/#',
47
+ channel_topic: '2/e/LongFast/#',
48
48
  psks: { LongFast: 'AQ==' }
49
49
  ) do |message|
50
50
  puts message.inspect
@@ -76,7 +76,7 @@ mqtt_obj = Meshastic::MQTT.connect
76
76
  Meshtastic::MQTT.subscribe(
77
77
  mqtt_obj: mqtt_obj,
78
78
  region: 'US',
79
- channel_id_path: '2/e/LongFast/#',
79
+ channel_topic: '2/e/LongFast/#',
80
80
  psks: { LongFast: 'AQ==' },
81
81
  filter: '!YOUR_CLIENT_ID'
82
82
  ) do |message|
@@ -30,6 +30,7 @@ module Meshtastic
30
30
  username = opts[:username] ||= 'meshdev'
31
31
  password = opts[:password] ||= 'large4cats'
32
32
  client_id = opts[:client_id] ||= SecureRandom.random_bytes(4).unpack1('H*').to_s
33
+ client_id = format("0.8x", client_id) if client_id.is_a?(Integer)
33
34
  client_id = client_id.delete('!') if client_id.include?('!')
34
35
 
35
36
  MQTTClient.connect(
@@ -48,7 +49,7 @@ module Meshtastic
48
49
  # mqtt_obj: 'required - mqtt_obj returned from #connect method'
49
50
  # root_topic: 'optional - root topic (default: msh)',
50
51
  # region: 'optional - region e.g. 'US/VA', etc (default: US)',
51
- # channel_id_path: 'optional - channel ID path e.g. "2/stat/#" (default: "2/e/LongFast/#")',
52
+ # channel_topic: 'optional - channel ID path e.g. "2/stat/#" (default: "2/e/LongFast/#")',
52
53
  # psks: 'optional - hash of :channel_id => psk key value pairs (default: { LongFast: "AQ==" })',
53
54
  # qos: 'optional - quality of service (default: 0)',
54
55
  # filter: 'optional - comma-delimited string(s) to filter on in message (default: nil)',
@@ -60,7 +61,7 @@ module Meshtastic
60
61
  mqtt_obj = opts[:mqtt_obj]
61
62
  root_topic = opts[:root_topic] ||= 'msh'
62
63
  region = opts[:region] ||= 'US'
63
- channel_id_path = opts[:channel_id_path] ||= '2/e/LongFast/#'
64
+ channel_topic = opts[:channel_topic] ||= '2/e/LongFast/#'
64
65
  # TODO: Support Array of PSKs and attempt each until decrypted
65
66
 
66
67
  public_psk = '1PG7OiApB1nwvP+rz05pAQ=='
@@ -77,7 +78,7 @@ module Meshtastic
77
78
  include_raw = opts[:include_raw] ||= false
78
79
 
79
80
  # NOTE: Use MQTT Explorer for topic discovery
80
- full_topic = "#{root_topic}/#{region}/#{channel_id_path}"
81
+ full_topic = "#{root_topic}/#{region}/#{channel_topic}"
81
82
  full_topic = "#{root_topic}/#{region}" if region == '#'
82
83
  puts "Subscribing to: #{full_topic}"
83
84
  mqtt_obj.subscribe(full_topic, qos)
@@ -276,7 +277,7 @@ module Meshtastic
276
277
  mqtt_obj: 'required - mqtt_obj object returned from #connect method',
277
278
  root_topic: 'optional - root topic (default: msh)',
278
279
  region: 'optional - region e.g. 'US/VA', etc (default: US)',
279
- channel_id_path: 'optional - channel ID path e.g. '2/stat/#' (default: '2/e/LongFast/#')',
280
+ channel_topic: 'optional - channel ID path e.g. '2/stat/#' (default: '2/e/LongFast/#')',
280
281
  psks: 'optional - hash of :channel_id => psk key value pairs (default: { LongFast: 'AQ==' })',
281
282
  qos: 'optional - quality of service (default: 0)',
282
283
  json: 'optional - JSON output (default: false)',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.95'
4
+ VERSION = '0.0.97'
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.95
4
+ version: 0.0.97
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.