meshtastic 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/meshtastic/mqtt.rb +17 -9
- data/lib/meshtastic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca28989f9cdb4c958571d59ea70d035154bb4c796017bbd948dea5987dfbc8d
|
4
|
+
data.tar.gz: 4dd3be1a0ccde5cab5711fe2e31c8d9dd869a4f4f204b2af5916ee6b731b47aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34639b023c2ae75cb76f627fb0af84c08703f112a4da326fd14ef2103a8667dc376260617ba905275f047a78e3086e6d62586f65b84848caa92b816951dcca8d
|
7
|
+
data.tar.gz: 83b59c484395c04983c6ca4c20624e14101369345c5ae09db8e2d7879410556e21615aadeb2865959c37bf851b147424c3970e71ff6ea29d690dfae006b260c8
|
data/lib/meshtastic/mqtt.rb
CHANGED
@@ -175,7 +175,8 @@ module Meshtastic
|
|
175
175
|
pb_obj = Meshtastic::StoreAndForward.decode(payload)
|
176
176
|
when :TEXT_MESSAGE_APP
|
177
177
|
# Unsure if this is the correct protobuf object
|
178
|
-
pb_obj = Meshtastic::MqttClientProxyMessage.decode(payload)
|
178
|
+
# pb_obj = Meshtastic::MqttClientProxyMessage.decode(payload)
|
179
|
+
pb_obj = Meshtastic::Data.decode(payload)
|
179
180
|
when :TELEMETRY_APP
|
180
181
|
pb_obj = Meshtastic::Telemetry.decode(payload)
|
181
182
|
when :TRACEROUTE_APP
|
@@ -214,20 +215,27 @@ module Meshtastic
|
|
214
215
|
# message[:decoded][:pb_obj] = pb_obj
|
215
216
|
end
|
216
217
|
|
217
|
-
filter_arr = [message[:id].to_s] if filter.nil?
|
218
|
-
flat_message = message.values.join(' ')
|
219
|
-
|
220
|
-
disp = true if filter_arr.first == message[:id] ||
|
221
|
-
filter_arr.all? { |filter| flat_message.include?(filter) }
|
222
|
-
|
223
218
|
message[:raw_packet] = raw_packet if block_given?
|
224
|
-
|
219
|
+
unless block_given?
|
220
|
+
message[:stdout] = 'pretty'
|
221
|
+
stdout_message = JSON.pretty_generate(message)
|
222
|
+
end
|
225
223
|
rescue Google::Protobuf::ParseError,
|
226
224
|
JSON::GeneratorError
|
227
225
|
|
228
|
-
|
226
|
+
unless block_given?
|
227
|
+
message[:stdout] = 'inspect'
|
228
|
+
stdout_message = message.inspect
|
229
|
+
end
|
230
|
+
|
229
231
|
next
|
230
232
|
ensure
|
233
|
+
filter_arr = [message[:id].to_s] if filter.nil?
|
234
|
+
flat_message = message.values.join(' ')
|
235
|
+
|
236
|
+
disp = true if filter_arr.first == message[:id] ||
|
237
|
+
filter_arr.all? { |filter| flat_message.include?(filter) }
|
238
|
+
|
231
239
|
if disp
|
232
240
|
if block_given?
|
233
241
|
yield message
|
data/lib/meshtastic/version.rb
CHANGED