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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2d188ac05f244ce12a4825659a327bb883a51cb601875e5c21e8b45b4528741
4
- data.tar.gz: 535ab977c36d067eb9c6a2a3be242b96efa1e3ed0864e2e4d3517970c806d870
3
+ metadata.gz: 7627b4cf871e12c62a30d8c7a90c9680a9a775d0dcc30fccb49cb0aecd2e3de8
4
+ data.tar.gz: ca83b3e9916ec33319250ce639801c63ef5b325d7d6a9222e8cf1481b0f2fc2c
5
5
  SHA512:
6
- metadata.gz: c46cdbb49616cc18ddf12a06f11e2dcd981581455146923571601a16ca417a7ddf18b3d769a6182b874ae01aafb526ed6d967c453dfedb30142ed995b398728c
7
- data.tar.gz: df15c9aa4b5084734e3db4122647242ed16d89ddc45d8a54bc163602b86ca5cf93a110ca064d90052698f726dc01910023ac8506bbc1b88ce50609dd825f0abc
6
+ metadata.gz: ba16787d5ae6f67bfc6e506526d37ae36efcb93bf2045f6fec161a77b8bb41a3e8ae41bc14dabb3553493de6122215e0d704d0108754782351721623921a0c26
7
+ data.tar.gz: 2134adcb77a859cac8b381b7e07633c1d3ec577d9122d101e731ff9eda6cfee9f519d38f225a418585bd1fd19cb8dc5d9fccb0be9404152a21dda3990b25a27a
@@ -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
- flat_message = message.values.join(' ')
297
-
298
- disp = true if filter_arr.first == message[:id] ||
299
- filter_arr.all? { |filter| flat_message.include?(filter) }
300
-
301
- if disp
302
- if block_given?
303
- yield decoded_payload_hash
304
- else
305
- puts "\n"
306
- puts '-' * 80
307
- puts 'MSG:'
308
- puts stdout_message
309
- puts '-' * 80
310
- puts "\n\n\n"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.45'
4
+ VERSION = '0.0.46'
5
5
  end
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.45
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-07 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler