meshtastic 0.0.45 → 0.0.46
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 +24 -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: 7627b4cf871e12c62a30d8c7a90c9680a9a775d0dcc30fccb49cb0aecd2e3de8
|
4
|
+
data.tar.gz: ca83b3e9916ec33319250ce639801c63ef5b325d7d6a9222e8cf1481b0f2fc2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba16787d5ae6f67bfc6e506526d37ae36efcb93bf2045f6fec161a77b8bb41a3e8ae41bc14dabb3553493de6122215e0d704d0108754782351721623921a0c26
|
7
|
+
data.tar.gz: 2134adcb77a859cac8b381b7e07633c1d3ec577d9122d101e731ff9eda6cfee9f519d38f225a418585bd1fd19cb8dc5d9fccb0be9404152a21dda3990b25a27a
|
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
|
@@ -227,6 +230,8 @@ module Meshtastic
|
|
227
230
|
decoded_payload_hash = decoded_payload.to_h
|
228
231
|
end
|
229
232
|
|
233
|
+
next unless decoded_payload_hash[:packet].is_a?(Hash)
|
234
|
+
|
230
235
|
message = decoded_payload_hash[:packet] if decoded_payload_hash.keys.include?(:packet)
|
231
236
|
message[:topic] = raw_topic
|
232
237
|
message[:node_id_from] = "!#{message[:from].to_i.to_s(16)}"
|
@@ -293,24 +298,26 @@ module Meshtastic
|
|
293
298
|
next
|
294
299
|
ensure
|
295
300
|
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
|
-
|
301
|
+
if message.is_a?(Hash)
|
302
|
+
flat_message = message.values.join(' ')
|
303
|
+
|
304
|
+
disp = true if filter_arr.first == message[:id] ||
|
305
|
+
filter_arr.all? { |filter| flat_message.include?(filter) }
|
306
|
+
|
307
|
+
if disp
|
308
|
+
if block_given?
|
309
|
+
yield decoded_payload_hash
|
310
|
+
else
|
311
|
+
puts "\n"
|
312
|
+
puts '-' * 80
|
313
|
+
puts 'MSG:'
|
314
|
+
puts stdout_message
|
315
|
+
puts '-' * 80
|
316
|
+
puts "\n\n\n"
|
317
|
+
end
|
318
|
+
# else
|
319
|
+
# print '.'
|
311
320
|
end
|
312
|
-
else
|
313
|
-
print '.'
|
314
321
|
end
|
315
322
|
end
|
316
323
|
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.46
|
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
|