meshtastic 0.0.30 → 0.0.32

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: 0b134e7c284e1fe0a79c3c49b2079d04c6c9688d2960a6f3101a259a21e93cda
4
- data.tar.gz: cb282a94ffe80115beb6246d967b529a110adb0ab729d656649285eab4b67513
3
+ metadata.gz: 1a810ada159c4d2bed444d0ef5e123a2959caec545ade37307ad621b885cb92f
4
+ data.tar.gz: 00c1c0e5aceb9a75c009af4aedd730918f6d5a8c6acca8fc1df589a357df4510
5
5
  SHA512:
6
- metadata.gz: 0516e43e2568a890adf39af3253e63c32b5e1d8a7357ba40b1c993963894ad94bb6a27a4a8176ff58ab06248810739c18f54eff4cf13e18e7e175ec9a5bf853a
7
- data.tar.gz: 7319688485fadcf5d0085d2d04647d93e0dd062453030478a9df8197222be2c8c463f68da4d09d5c9727cfd1932912b7712e39b1e901abb6c48c5ee5c7c14530
6
+ metadata.gz: 9c01f0484f9b9da94d50c7d2f964eeffb9cb374e9993955337502081bcefab8af2a85a692fcb58ed6a2a2981528effd8189faf9f105eda3cb81b60704a60f492
7
+ data.tar.gz: 940d4174955651ede2eb5938314076a0702ee4ff7eb2c2b56eae491704d7d691ece5c41bbb248cac35ff385d6df48029af3fa8d556c66e11bf09d38db0cb8698
@@ -51,7 +51,8 @@ module Meshtastic
51
51
  # psk: 'optional - channel pre-shared key (default: AQ==)',
52
52
  # qos: 'optional - quality of service (default: 0)',
53
53
  # json: 'optional - JSON output (default: false)',
54
- # filter: 'optional - comma-delimited string(s) to filter on in message (default: nil)'
54
+ # filter: 'optional - comma-delimited string(s) to filter on in message (default: nil)',
55
+ # gps_metadata: 'optional - include GPS metadata in output (default: false)'
55
56
  # )
56
57
 
57
58
  public_class_method def self.subscribe(opts = {})
@@ -63,6 +64,7 @@ module Meshtastic
63
64
  qos = opts[:qos] ||= 0
64
65
  json = opts[:json] ||= false
65
66
  filter = opts[:filter]
67
+ gps_metadata = opts[:gps_metadata] ||= false
66
68
 
67
69
  # TODO: Find JSON URI for this
68
70
  full_topic = "#{root_topic}/#{region}/2/json/#{channel}/#" if json
@@ -146,15 +148,16 @@ module Meshtastic
146
148
  when :NEIGHBORINFO_APP
147
149
  pb_obj = Meshtastic::NeighborInfo.decode(payload)
148
150
  when :NODEINFO_APP
149
- pb_obj = Meshtastic::NodeInfo.decode(payload)
151
+ pb_obj = Meshtastic::User.decode(payload)
150
152
  when :PAXCOUNTER_APP
151
153
  pb_obj = Meshtastic::Paxcount.decode(payload)
152
154
  when :POSITION_APP
153
155
  pb_obj = Meshtastic::Position.decode(payload)
154
156
  # when :PRIVATE_APP
155
157
  # pb_obj = Meshtastic::Private.decode(payload)
156
- # when :RANGE_TEST_APP
157
- # pb_obj = Meshtastic::RangeTest.decode(payload)
158
+ when :RANGE_TEST_APP
159
+ # Unsure if this is the correct protobuf object
160
+ pb_obj = Meshtastic::FromRadio.decode(payload)
158
161
  when :REMOTE_HARDWARE_APP
159
162
  pb_obj = Meshtastic::HardwareMessage.decode(payload)
160
163
  # when :REPLY_APP
@@ -163,22 +166,20 @@ module Meshtastic
163
166
  pb_obj = Meshtastic::Routing.decode(payload)
164
167
  when :SERIAL_APP
165
168
  pb_obj = Meshtastic::SerialConnectionStatus.decode(payload)
166
- # when :SIMULATOR_APP
167
- # pb_obj = Meshtastic::Simulator.decode(payload)
169
+ when :SIMULATOR_APP
170
+ pb_obj = Meshtastic::Compressed.decode(payload)
168
171
  when :STORE_FORWARD_APP
169
172
  pb_obj = Meshtastic::StoreAndForward.decode(payload)
170
173
  when :TEXT_MESSAGE_APP
174
+ # Unsure if this is the correct protobuf object
171
175
  pb_obj = Meshtastic::MqttClientProxyMessage.decode(payload)
172
176
  when :TEXT_MESSAGE_COMPRESSED_APP
177
+ # Unsure if this is the correct protobuf object
173
178
  pb_obj = Meshtastic::Compressed.decode(payload)
174
179
  when :TELEMETRY_APP
175
180
  pb_obj = Meshtastic::Telemetry.decode(payload)
176
181
  when :TRACEROUTE_APP
177
182
  pb_obj = Meshtastic::RouteDiscovery.decode(payload)
178
- # message[:decoded][:payload] = pb_obj.to_h
179
- # pb_obj.to_h[:route].each_with_index do |route, index|
180
- # message[:decoded][:payload][:route][index] = route.to_s(16)
181
- # end
182
183
  # when :UNKNOWN_APP
183
184
  # pb_obj = Meshtastic.Unknown.decode(payload)
184
185
  when :WAYPOINT_APP
@@ -192,7 +193,8 @@ module Meshtastic
192
193
  # message[:decoded][:payload] = pb_obj.to_h unless msg_type == :TRACEROUTE_APP
193
194
  message[:decoded][:payload] = pb_obj.to_h
194
195
  if message[:decoded][:payload].keys.include?(:latitude_i) &&
195
- message[:decoded][:payload].keys.include?(:longitude_i)
196
+ message[:decoded][:payload].keys.include?(:longitude_i) &&
197
+ gps_metadata
196
198
 
197
199
  latitude = pb_obj.to_h[:latitude_i] * 0.0000001
198
200
  longitude = pb_obj.to_h[:longitude_i] * 0.0000001
@@ -301,7 +303,8 @@ module Meshtastic
301
303
  psk: 'optional - channel pre-shared key (default: AQ==)',
302
304
  qos: 'optional - quality of service (default: 0)',
303
305
  json: 'optional - JSON output (default: false)',
304
- filter: 'optional - comma-delimited string(s) to filter on in message (default: nil)'
306
+ filter: 'optional - comma-delimited string(s) to filter on in message (default: nil)',
307
+ gps_metadata: 'optional - include GPS metadata in output (default: false)'
305
308
  )
306
309
 
307
310
  #{self}.gps_search(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.30'
4
+ VERSION = '0.0.32'
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.30
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.