Sha256: 6d7421f03439ab4f04e570ee762dc926aac553859a5f79492a3fc88cbe0a3b83

Contents?: true

Size: 880 Bytes

Versions: 5

Compression:

Stored size: 880 Bytes

Contents

=begin
AGPS handler for receiver
=end

module GPS_PVT
class Receiver
  def parse_supl(src, opt = {}, &b)
    $stderr.print "A-GPS (%s) "%[src]
    opt = {
      :interval => 60 * 10, # 10 min.
    }.merge(opt)
    require_relative '../supl'
    src_io = Util::open(src)
    while data = src_io.get_assisted_data
      data.ephemeris.each{|eph|
        target = case eph
        when GPS::Ephemeris; @solver.gps_space_node
        when GPS::Ephemeris_GLONASS; @solver.glonass_space_node
        when GPS::Ephemeris_SBAS; @solver.sbas_space_node
        else nil
        end
        critical{target.register_ephemeris(eph.svid, eph)} if target
      } if data.respond_to?(:ephemeris)
      critical{
        @solver.gps_space_node.update_iono_utc(data.iono_utc)
      } if data.respond_to?(:iono_utc)
      sleep(opt[:interval])
    end
  end
end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gps_pvt-0.10.4 lib/gps_pvt/receiver/agps.rb
gps_pvt-0.10.3 lib/gps_pvt/receiver/agps.rb
gps_pvt-0.10.2 lib/gps_pvt/receiver/agps.rb
gps_pvt-0.10.1 lib/gps_pvt/receiver/agps.rb
gps_pvt-0.10.0 lib/gps_pvt/receiver/agps.rb