my_gpsd_client 0.02.01 → 0.02.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/my_gpsd_client.rb +62 -53
- data/lib/my_gpsd_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97febebcc160956fb040c4facaf04e81fdd9100ec45cfd5dbd47a20dc754e192
|
4
|
+
data.tar.gz: 1705002705b8c247b07d57f1f16a38bfda0a1df2977f9e74badbadaa88ecc1dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d50ea29c9bef3ef88768a33372d5824a3a253526a7f5625ce32b68b88d7262d4abfdbdcc8a0a54ce5d47e3945b97674181d2fad272552c114bd2d0de8c5f8aa2
|
7
|
+
data.tar.gz: 4273baa90163fa5f645c4b3bdec80979e0bef2800192958954885f1641e82990ce02d06ed6a7ef28da21759699ce0195cae5b8707c2d336df0500d844305b80b
|
data/lib/my_gpsd_client.rb
CHANGED
@@ -319,59 +319,68 @@ class MyGpsdClient
|
|
319
319
|
# are used the most as they give info about satellites used and gps locations
|
320
320
|
# @param [JSON] json The object returned by the daemon
|
321
321
|
def parse_socket_json(json:)
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
322
|
+
@json_raw_callback.call(json) if @json_raw_callback
|
323
|
+
|
324
|
+
case json['class']
|
325
|
+
when 'TOFF'
|
326
|
+
@msg_counts[:toff] += 1
|
327
|
+
when 'ATT'
|
328
|
+
@msg_counts[:att] += 1
|
329
|
+
when 'ERR'
|
330
|
+
@msg_counts[:err] += 1
|
331
|
+
when 'GST'
|
332
|
+
@msg_counts[:gst] += 1
|
333
|
+
when 'POL'
|
334
|
+
@msg_counts[:pol] += 1
|
335
|
+
when 'DEVICE'
|
336
|
+
@msg_counts[:dev] += 1
|
337
|
+
when 'DEVICES'
|
338
|
+
# devices that are found, not needed
|
339
|
+
@msg_counts[:devs] += 1
|
340
|
+
when 'WATCH'
|
341
|
+
# gps deamon is ready and will send other packets, not needed yet
|
342
|
+
@msg_counts[:wtch] += 1
|
343
|
+
when 'TPV'
|
344
|
+
# gps position
|
345
|
+
# "tag"=>"RMC", # "device"=>"/dev/ttyS0", # "mode"=>3,
|
346
|
+
# "time"=>"2017-11-28T12:54:54.000Z", # "ept"=>0.005, # "lat"=>52.368576667,
|
347
|
+
# "lon"=>4.901715, # "alt"=>-6.2, # "epx"=>2.738, # "epy"=>3.5,
|
348
|
+
# "epv"=>5.06, # "track"=>198.53, # "speed"=>0.19, # "climb"=>0.0,
|
349
|
+
# "eps"=>7.0, # "epc"=>10.12
|
350
|
+
@msg_counts[:tpv] += 1
|
351
|
+
=begin
|
352
|
+
if json['mode'] > 1
|
353
|
+
#we have a 2d or 3d fix
|
354
|
+
if is_new_measurement(json: json)
|
355
|
+
json['time'] = DateTime.parse(json['time'])
|
356
|
+
my_logger level: 'info', msg: "lat: #{json['lat']}, lng: #{json['lon']}, alt: #{json['alt']}, speed: #{json['speed']} at #{json['time']}, which is #{(Time.now - json['time'].to_time) * 1000}ms old"
|
357
|
+
@json_pos_callback.call(json) if @json_pos_callback
|
358
|
+
end
|
359
|
+
end
|
360
|
+
=end
|
361
|
+
when 'SKY'
|
362
|
+
# report on found satellites
|
363
|
+
@msg_counts[:sky] += 1
|
364
|
+
=begin
|
365
|
+
sats = json['satellites']
|
366
|
+
if satellites_changed(sats: sats)
|
367
|
+
my_logger level: 'info', msg: "found #{sats.length} satellites, of which #{sats.count{|sat| sat['used']}} are used"
|
368
|
+
@json_sat_callback.call(sats) if @json_sat_callback
|
369
|
+
end
|
370
|
+
=end
|
371
|
+
when 'PPS'
|
372
|
+
@msg_counts[:pps] += 1
|
373
|
+
=begin
|
374
|
+
my_logger level: 'info', msg: "found PPS tag: #{json.inspect}"
|
375
|
+
@json_pps_callback.call(json) if @json_pps_callback
|
376
|
+
=end
|
377
|
+
else
|
378
|
+
@msg_counts[:unk] += 1
|
379
|
+
=begin
|
380
|
+
my_logger level: 'info', msg: "found unknown tag: #{json.inspect}"
|
381
|
+
@json_unk_callback.call(json) if @json_unk_callback
|
382
|
+
=end
|
383
|
+
end
|
375
384
|
end
|
376
385
|
|
377
386
|
# checks if the new satellites object return by the deamon is different enough compared
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_gpsd_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.02.
|
4
|
+
version: 0.02.02
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Finnegan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|