meshtastic 0.0.45 → 0.0.47
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 +4 -4
- data/lib/meshtastic/mqtt.rb +25 -17
- data/lib/meshtastic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c8b90d169f041f15fe64d36133a7ed30606c98bb7377c1f783e222c57b805bc
|
4
|
+
data.tar.gz: b8fc0fc381efecc813bf0c622638c73a2d3edd016f124f8636822324329b307a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec4a0d4ecf315388482c71b51edb9213e03ac56ed2fad87a62c7bd715ba8071be85700d207646aa28392a52cbee9b0d431e8911ae7924ae8455ab51481219330
|
7
|
+
data.tar.gz: 17d1662d12d303ff0824b5716fa00829275d3fd8169a86f48d84960e207dc8e80fdd17337f240d4b6d52326cf98e2d2a851013306d7bd60e85bfae479eae35cd
|
data/lib/meshtastic/mqtt.rb
CHANGED
@@ -127,6 +127,9 @@ module Meshtastic
|
|
127
127
|
decoder = Meshtastic::Waypoint
|
128
128
|
# when :ZPS_APP
|
129
129
|
# decoder = Meshtastic::Zps
|
130
|
+
else
|
131
|
+
puts "WARNING: Can't decode\n#{payload}\nw/ portnum: #{msg_type.inspect}"
|
132
|
+
return payload
|
130
133
|
end
|
131
134
|
|
132
135
|
payload = decoder.decode(payload).to_h
|
@@ -205,6 +208,7 @@ module Meshtastic
|
|
205
208
|
|
206
209
|
# NOTE: Use MQTT Explorer for topic discovery
|
207
210
|
full_topic = "#{root_topic}/#{region}/#{channel}"
|
211
|
+
full_topic = "#{root_topic}/#{region}" if region == '#'
|
208
212
|
puts "Subscribing to: #{full_topic}"
|
209
213
|
mqtt_obj.subscribe(full_topic, qos)
|
210
214
|
|
@@ -227,6 +231,8 @@ module Meshtastic
|
|
227
231
|
decoded_payload_hash = decoded_payload.to_h
|
228
232
|
end
|
229
233
|
|
234
|
+
next unless decoded_payload_hash[:packet].is_a?(Hash)
|
235
|
+
|
230
236
|
message = decoded_payload_hash[:packet] if decoded_payload_hash.keys.include?(:packet)
|
231
237
|
message[:topic] = raw_topic
|
232
238
|
message[:node_id_from] = "!#{message[:from].to_i.to_s(16)}"
|
@@ -293,24 +299,26 @@ module Meshtastic
|
|
293
299
|
next
|
294
300
|
ensure
|
295
301
|
filter_arr = [message[:id].to_s] if filter.nil?
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
if
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
302
|
+
if message.is_a?(Hash)
|
303
|
+
flat_message = message.values.join(' ')
|
304
|
+
|
305
|
+
disp = true if filter_arr.first == message[:id] ||
|
306
|
+
filter_arr.all? { |filter| flat_message.include?(filter) }
|
307
|
+
|
308
|
+
if disp
|
309
|
+
if block_given?
|
310
|
+
yield decoded_payload_hash
|
311
|
+
else
|
312
|
+
puts "\n"
|
313
|
+
puts '-' * 80
|
314
|
+
puts 'MSG:'
|
315
|
+
puts stdout_message
|
316
|
+
puts '-' * 80
|
317
|
+
puts "\n\n\n"
|
318
|
+
end
|
319
|
+
# else
|
320
|
+
# print '.'
|
311
321
|
end
|
312
|
-
else
|
313
|
-
print '.'
|
314
322
|
end
|
315
323
|
end
|
316
324
|
end
|
data/lib/meshtastic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meshtastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|