meshtastic 0.0.34 → 0.0.35

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: 8bc079b846550e65c15013b3926d0680fbbb77e393484b2c001cd9ad95777f00
4
- data.tar.gz: 47cde9a565ac4815bbeccf179269e1be1c982c107774b2790b3a7a2bd4cf883c
3
+ metadata.gz: bca28989f9cdb4c958571d59ea70d035154bb4c796017bbd948dea5987dfbc8d
4
+ data.tar.gz: 4dd3be1a0ccde5cab5711fe2e31c8d9dd869a4f4f204b2af5916ee6b731b47aa
5
5
  SHA512:
6
- metadata.gz: 1b864230b6ab3db1c78955be811421ae7910cdbfeb962483a2b9c1afa7e9a7ec170e0eb1aae5f05c5f94049c7b122cfe9e8f719deb1c98d6b308d5b8ad3568a7
7
- data.tar.gz: 8b5ab00dab82fdd351c9c7634765a121c316dfd1f0fb9dc319ab451073986d8c1a822cc95f421accd36db42a6e0c2ced4610f49a305692e667061ecc8b43f15e
6
+ metadata.gz: 34639b023c2ae75cb76f627fb0af84c08703f112a4da326fd14ef2103a8667dc376260617ba905275f047a78e3086e6d62586f65b84848caa92b816951dcca8d
7
+ data.tar.gz: 83b59c484395c04983c6ca4c20624e14101369345c5ae09db8e2d7879410556e21615aadeb2865959c37bf851b147424c3970e71ff6ea29d690dfae006b260c8
@@ -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
- stdout_message = JSON.pretty_generate(message) unless block_given?
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
- stdout_message = message.inspect unless block_given?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.34'
4
+ VERSION = '0.0.35'
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.34
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.