meshtastic 0.0.28 → 0.0.30

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: b80ae9abe5cb5bdb83e479b4a3ce480bbd7cbd9bc51435ab1142f5a2c1f4ddcd
4
- data.tar.gz: 819a011c9a9e9e595eb7ba98e7ee823b22d325a9c569f37d2b9f0302ac9b344c
3
+ metadata.gz: 0b134e7c284e1fe0a79c3c49b2079d04c6c9688d2960a6f3101a259a21e93cda
4
+ data.tar.gz: cb282a94ffe80115beb6246d967b529a110adb0ab729d656649285eab4b67513
5
5
  SHA512:
6
- metadata.gz: d588c49bd385c6e910b36b066f8baf8120a765232171f8306b65bc2a534df45a8c274833754d6b575bb3788209b7bb6e9e9eb1e211297171915b6439d5da1c43
7
- data.tar.gz: 42b85500508e2f1a93c2bb486ccb592e4372a5dcea1d09d401a16ee776ecb0b17a57fd6aca8b65315f4b70c46d227378545c4d03f42888a6ea817020c419e353
6
+ metadata.gz: 0516e43e2568a890adf39af3253e63c32b5e1d8a7357ba40b1c993963894ad94bb6a27a4a8176ff58ab06248810739c18f54eff4cf13e18e7e175ec9a5bf853a
7
+ data.tar.gz: 7319688485fadcf5d0085d2d04647d93e0dd062453030478a9df8197222be2c8c463f68da4d09d5c9727cfd1932912b7712e39b1e901abb6c48c5ee5c7c14530
@@ -135,8 +135,8 @@ module Meshtastic
135
135
  pb_obj = Meshtastic::TAKPacket.decode(payload)
136
136
  # when :AUDIO_APP
137
137
  # pb_obj = Meshtastic::Audio.decode(payload)
138
- # when :DETECTION_SENSOR_APP
139
- # pb_obj = Meshtastic::DetectionSensor.decode(payload)
138
+ when :DETECTION_SENSOR_APP
139
+ pb_obj = Meshtastic::DeviceState.decode(payload)
140
140
  # when :IP_TUNNEL_APP
141
141
  # pb_obj = Meshtastic::IpTunnel.decode(payload)
142
142
  when :MAP_REPORT_APP
@@ -167,14 +167,18 @@ module Meshtastic
167
167
  # pb_obj = Meshtastic::Simulator.decode(payload)
168
168
  when :STORE_FORWARD_APP
169
169
  pb_obj = Meshtastic::StoreAndForward.decode(payload)
170
- # when :TEXT_MESSAGE_APP
171
- # pb_obj = Meshtastic::TextMessage.decode(payload)
170
+ when :TEXT_MESSAGE_APP
171
+ pb_obj = Meshtastic::MqttClientProxyMessage.decode(payload)
172
172
  when :TEXT_MESSAGE_COMPRESSED_APP
173
173
  pb_obj = Meshtastic::Compressed.decode(payload)
174
174
  when :TELEMETRY_APP
175
175
  pb_obj = Meshtastic::Telemetry.decode(payload)
176
- # when :TRACEROUTE_APP
177
- # pb_obj = Meshtastic::Traceroute.decode(payload)
176
+ when :TRACEROUTE_APP
177
+ 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
178
182
  # when :UNKNOWN_APP
179
183
  # pb_obj = Meshtastic.Unknown.decode(payload)
180
184
  when :WAYPOINT_APP
@@ -185,7 +189,18 @@ module Meshtastic
185
189
  puts "WARNING: Unknown message type: #{msg_type}"
186
190
  end
187
191
  # Overwrite the payload with the decoded protobuf object
192
+ # message[:decoded][:payload] = pb_obj.to_h unless msg_type == :TRACEROUTE_APP
188
193
  message[:decoded][:payload] = pb_obj.to_h
194
+ if message[:decoded][:payload].keys.include?(:latitude_i) &&
195
+ message[:decoded][:payload].keys.include?(:longitude_i)
196
+
197
+ latitude = pb_obj.to_h[:latitude_i] * 0.0000001
198
+ longitude = pb_obj.to_h[:longitude_i] * 0.0000001
199
+ message[:decoded][:payload][:gps_metadata] = gps_search(
200
+ lat: latitude,
201
+ lon: longitude
202
+ ).first.data
203
+ end
189
204
  # puts pb_obj.public_methods
190
205
  # message[:decoded][:pb_obj] = pb_obj
191
206
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meshtastic
4
- VERSION = '0.0.28'
4
+ VERSION = '0.0.30'
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.28
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.