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 +4 -4
- data/lib/meshtastic/mqtt.rb +15 -12
- 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: 1a810ada159c4d2bed444d0ef5e123a2959caec545ade37307ad621b885cb92f
|
|
4
|
+
data.tar.gz: 00c1c0e5aceb9a75c009af4aedd730918f6d5a8c6acca8fc1df589a357df4510
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c01f0484f9b9da94d50c7d2f964eeffb9cb374e9993955337502081bcefab8af2a85a692fcb58ed6a2a2981528effd8189faf9f105eda3cb81b60704a60f492
|
|
7
|
+
data.tar.gz: 940d4174955651ede2eb5938314076a0702ee4ff7eb2c2b56eae491704d7d691ece5c41bbb248cac35ff385d6df48029af3fa8d556c66e11bf09d38db0cb8698
|
data/lib/meshtastic/mqtt.rb
CHANGED
|
@@ -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::
|
|
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
|
-
|
|
157
|
-
#
|
|
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
|
-
|
|
167
|
-
|
|
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(
|
data/lib/meshtastic/version.rb
CHANGED