From f4ee37df56be0b315ff692de25c2cae6acff15fe Mon Sep 17 00:00:00 2001 From: Nicholas Shindler Date: Tue, 19 Mar 2024 13:49:18 +0100 Subject: [PATCH] update nmea types --- src/NMEAParser.jl | 6 +- src/parse.jl | 27 +++++-- src/types.jl | 176 +++++++++++++++++++++++++++++----------------- src/utils.jl | 53 +++++++++----- test/runtests.jl | 22 +++--- test/testdata.txt | 3 +- 6 files changed, 182 insertions(+), 105 deletions(-) diff --git a/src/NMEAParser.jl b/src/NMEAParser.jl index e4970d2..e2bd458 100644 --- a/src/NMEAParser.jl +++ b/src/NMEAParser.jl @@ -3,11 +3,7 @@ module NMEAParser export NMEAData, parse_msg!, is_string_supported, update, nmea_parse export NMEAString export GGA, GSA, ZDA, GBS, GLL, GSV, RMC, VTG, DTM -export PASHR, PTWPOS, PTWHPR, PTWVCT, PTWPLS, PTWWHE, PTWHPR, PTACC, PTGYR - -import Base.pop! -import Base.parse - +export PASHR, WPOS, WHPR, WVCT, WPLS, WWHE, WHPR, ACC, GYR include("utils.jl") include("types.jl") diff --git a/src/parse.jl b/src/parse.jl index f34c95e..819c632 100644 --- a/src/parse.jl +++ b/src/parse.jl @@ -5,17 +5,18 @@ const NMEA_TYPES = [ (r"GBS$", GBS), (r"GLL$", GLL), (r"GSV$", GSV), + (r"GST$", GST), (r"RMC$", RMC), (r"VTG$", VTG), (r"ZDA$", ZDA), (r"PASHR$", PASHR), - (r"PTWPOS$", PTWPOS), - (r"PTWVCT$", PTWVCT), - (r"PTWPLS$", PTWPLS), - (r"PTWWHE$", PTWWHE), - (r"PTWHPR$", PTWHPR), - (r"PTACC$", PTACC), - (r"PTGYR$", PTGYR), + (r"WPOS$", WPOS), + (r"WVCT$", WVCT), + (r"WPLS$", WPLS), + (r"WWHE$", WWHE), + (r"HPR$", WHPR), + (r"ACC$", ACC), + (r"GYR$", GYR), ] @@ -58,6 +59,7 @@ function nmea_parse(nmea_string::AbstractString; validate_checksum = true) throw(ArgumentError("NMEA string ($header) not supported")) end +parse(nmea_string::AbstractString; validate_checksum = true) = nmea_parse(nmea_string, validate_checksum=validate_checksum) """ NMEAData() @@ -69,6 +71,7 @@ A mutable struct that stores the last parsed NMEA messages of different types. - `last_RMC::Union{Nothing, RMC}`: the last RMC message parsed, or nothing if none - `last_GSA::Union{Nothing, GSA}`: the last GSA message parsed, or nothing if none - `last_GSV::Union{Nothing, GSV}`: the last GSV message parsed, or nothing if none +- `last_GST::Union{Nothing, GST}`: the last GST message parsed, or nothing if none - `last_GBS::Union{Nothing, GBS}`: the last GBS message parsed, or nothing if none - `last_VTG::Union{Nothing, VTG}`: the last VTG message parsed, or nothing if none - `last_GLL::Union{Nothing, GLL}`: the last GLL message parsed, or nothing if none @@ -80,6 +83,7 @@ mutable struct NMEAData last_RMC::Union{Nothing,RMC} last_GSA::Union{Nothing,GSA} last_GSV::Union{Nothing,GSV} + last_GST::Union{Nothing,GST} last_GBS::Union{Nothing,GBS} last_VTG::Union{Nothing,VTG} last_GLL::Union{Nothing,GLL} @@ -105,6 +109,7 @@ update!(s::NMEAData, msg::GGA) = s.last_GGA = msg update!(s::NMEAData, msg::RMC) = s.last_RMC = msg update!(s::NMEAData, msg::GSA) = s.last_GSA = msg update!(s::NMEAData, msg::GSV) = s.last_GSV = msg +update!(s::NMEAData, msg::GST) = s.last_GST = msg update!(s::NMEAData, msg::GBS) = s.last_GBS = msg update!(s::NMEAData, msg::VTG) = s.last_VTG = msg update!(s::NMEAData, msg::GLL) = s.last_GLL = msg @@ -121,6 +126,7 @@ update(msg::GGA, s::NMEAData) = (s.last_GGA = msg; s) update(msg::RMC, s::NMEAData) = (s.last_RMC = msg; s) update(msg::GSA, s::NMEAData) = (s.last_GSA = msg; s) update(msg::GSV, s::NMEAData) = (s.last_GSV = msg; s) +update(msg::GST, s::NMEAData) = (s.last_GST = msg; s) update(msg::GBS, s::NMEAData) = (s.last_GBS = msg; s) update(msg::VTG, s::NMEAData) = (s.last_VTG = msg; s) update(msg::GLL, s::NMEAData) = (s.last_GLL = msg; s) @@ -162,6 +168,13 @@ function pop!(nmea_data::NMEAData, ::Type{GSV}) nmea_data.last_GSV = nothing return last end +function pop!(nmea_data::NMEAData, ::Type{GST}) + last = + isnothing(nmea_data.last_GST) ? throw(UndefVarError("last_GST not defined")) : + nmea_data.last_GST + nmea_data.last_GST = nothing + return last +end function pop!(nmea_data::NMEAData, ::Type{GBS}) last = isnothing(nmea_data.last_GBS) ? throw(UndefVarError("last_GBS not defined")) : diff --git a/src/types.jl b/src/types.jl index 018cacd..b6cce75 100644 --- a/src/types.jl +++ b/src/types.jl @@ -276,6 +276,56 @@ struct GBS <: NMEAString end # constructor GBS end # type GBS +""" + struct GST <: NMEAString + +Position error statistics. + +# Fields +- `system::String`: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined). +- `time::Float64`: Time in seconds. +- `rms::Float64`: RMS value of the pseudorange residuals; includes carrier phase residuals during periods of RTK (float) and RTK (fixed) processing +- `semi_major_error::Float64`: Error ellipse semi-major axis 1-sigma error, in meters +- `semi_minor_error::Float64`: Error ellipse semi-minor axis 1-sigma error, in meters +- `orientation_error::Float64`: Error ellipse orientation, degrees from true north +- `latitude_error::Float64`: Latitude 1-sigma error, in meters +- `longitude_error::Float64`: Longitude 1-sigma error, in meters +- `height_error::Float64`: Height 1-sigma error, in meters +- `valid::Bool`: Flag indicating the validity of the data. + +Example String: \$GPGST,172814.0,0.006,0.023,0.020,273.6,0.023,0.020,0.031*6A +""" +struct GST <: NMEAString + system::String + time::Float64 + rms::Float64 + semi_major_error::Float64 + semi_minor_error::Float64 + orientation_error::Float64 + latitude_error::Float64 + longitude_error::Float64 + height_error::Float64 + valid::Bool + + function GST( + items::Array{D}; + system::AbstractString = "UNKNOWN", + valid = true, + ) where {D<:SubString} + new( + system, + _hms_to_secs(items[2]), + something(tryparse(Float64, items[3]), 0.0), + something(tryparse(Float64, items[4]), 0.0), + something(tryparse(Float64, items[5]), 0.0), + something(tryparse(Float64, items[6]), 0.0), + something(tryparse(Float64, items[7]), 0.0), + something(tryparse(Float64, items[8]), 0.0), + something(tryparse(Float64, items[9]), 0.0), + ) + end # constructor GST +end # type GST + """ struct GLL <: NMEAString @@ -658,9 +708,9 @@ struct PASHR <: NMEAString end # type PASHR """ - struct PTWPOS <: NMEAString + struct WPOS <: NMEAString -Position (PTWPOS) +Position (WPOS) This NMEA data type represents position information. @@ -677,18 +727,18 @@ This NMEA data type represents position information. # Constructor ```julia -PTWPOS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +WPOS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTWPOS(["PTWPOS", "123456", "45.678", "M", "123.456", "M", "789.012", "M", "456.789", "M", "5.0", "K", "F"]) +data = WPOS(["WPOS", "123456", "45.678", "M", "123.456", "M", "789.012", "M", "456.789", "M", "5.0", "K", "F"]) ``` """ -struct PTWPOS <: NMEAString +struct WPOS <: NMEAString # Position - # $PTWPOS,TIME,X,X_UNIT[Meters],Y,Y_UNIT[Meters],Z,Z_UNIT[Meters],DISTANCE,D_UNIT[Meters],SPEED,S_UNIT[Kilometers per hour],DIRECTION[Forward/Backward]*CHECKSUM + # $WPOS,TIME,X,X_UNIT[Meters],Y,Y_UNIT[Meters],Z,Z_UNIT[Meters],DISTANCE,D_UNIT[Meters],SPEED,S_UNIT[Kilometers per hour],DIRECTION[Forward/Backward]*CHECKSUM system::String time::Float64 xpose::Float64 @@ -699,7 +749,7 @@ struct PTWPOS <: NMEAString direction::Char valid::Bool - function PTWPOS( + function WPOS( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -715,14 +765,14 @@ struct PTWPOS <: NMEAString Char(only(items[13])), valid, ) - end # constructor PTWPOS -end # type PTWPOS + end # constructor WPOS +end # type WPOS """ - struct PTWVCT <: NMEAString + struct WVCT <: NMEAString -Movement Vector (PTWVCT) +Movement Vector (WVCT) This NMEA data type represents movement vector information. @@ -737,18 +787,18 @@ This NMEA data type represents movement vector information. # Constructor ```julia -PTWVCT(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +WVCT(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTWVCT(["PTWVCT", "123456", "2.0", "M", "1.5708", "R", "5.0", "M"]) +data = WVCT(["WVCT", "123456", "2.0", "M", "1.5708", "R", "5.0", "M"]) ``` """ -struct PTWVCT <: NMEAString +struct WVCT <: NMEAString # Movement Vector - # $PTWVCT,TIME,DISTANCE_DERIVATIVE,DD_UNIT[Meters],HEADING,H_UNIT[Radians],DISTANCE,D_UNIT[Meters],SPEED, S_UNIT[Meters Per Second]*CHECKSUM + # $WVCT,TIME,DISTANCE_DERIVATIVE,DD_UNIT[Meters],HEADING,H_UNIT[Radians],DISTANCE,D_UNIT[Meters],SPEED, S_UNIT[Meters Per Second]*CHECKSUM system::String time::Float64 distance_derivative::Float64 @@ -757,7 +807,7 @@ struct PTWVCT <: NMEAString speed::Float64 valid::Bool - function PTWVCT( + function WVCT( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -774,14 +824,14 @@ struct PTWVCT <: NMEAString vel_convert(only(items[10]), something(tryparse(Float64, items[9]), 0.0)), valid, ) - end # constructor PTWVCT -end # type PTWVCT + end # constructor WVCT +end # type WVCT """ - struct PTWPLS <: NMEAString + struct WPLS <: NMEAString -Position in Pulses (PTWPLS) +Position in Pulses (WPLS) This NMEA data type represents position information in pulses. @@ -795,18 +845,18 @@ This NMEA data type represents position information in pulses. # Constructor ```julia -PTWPLS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +WPLS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTWPLS(["PTWPLS", "123456", "500", "P", "750", "P", "90.0", "D"]) +data = WPLS(["WPLS", "123456", "500", "P", "750", "P", "90.0", "D"]) ``` """ -struct PTWPLS <: NMEAString +struct WPLS <: NMEAString # Position in pulses - # $PTWPLS,TIME,X,X_UNIT[Pulses],Y,Y_UNIT[Pulses],HEADING,H_UNIT[Degrees]*CHECKSUM + # $WPLS,TIME,X,X_UNIT[Pulses],Y,Y_UNIT[Pulses],HEADING,H_UNIT[Degrees]*CHECKSUM system::String time::Float64 x::Float64 @@ -814,7 +864,7 @@ struct PTWPLS <: NMEAString heading::Float64 valid::Bool - function PTWPLS( + function WPLS( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -830,13 +880,13 @@ struct PTWPLS <: NMEAString ), valid, ) - end # constructor PTWPLS -end # type PTWPLS + end # constructor WPLS +end # type WPLS """ - struct PTWWHE <: NMEAString + struct WWHE <: NMEAString -Wheels Information (PTWWHE) +Wheels Information (WWHE) This NMEA data type represents wheels information. @@ -854,18 +904,18 @@ This NMEA data type represents wheels information. # Constructor ```julia -PTWWHE(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +WWHE(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTWWHE(["PTWWHE", "123456", "500", "100.0", "M", "F", "750", "150.0", "M", "B", "90.0"]) +data = WWHE(["WWHE", "123456", "500", "100.0", "M", "F", "750", "150.0", "M", "B", "90.0"]) ``` """ -struct PTWWHE <: NMEAString +struct WWHE <: NMEAString # Wheels information - # $PTWWHE,TIME,LEFT_WHEEL_PULSES,LW_DISTANCE,LWD_UNIT[Meters],LW_DIRECTION[Forward/Backward],RIGHT_WHEEL_PULSES,RW_DISTANCE,RWD_UNIT[Meters],RW_DIRECTION[Forward/Backward],HEADING*CHECKSUM + # $WWHE,TIME,LEFT_WHEEL_PULSES,LW_DISTANCE,LWD_UNIT[Meters],LW_DIRECTION[Forward/Backward],RIGHT_WHEEL_PULSES,RW_DISTANCE,RWD_UNIT[Meters],RW_DIRECTION[Forward/Backward],HEADING*CHECKSUM system::String time::Float64 lw_pulses::Float64 @@ -877,7 +927,7 @@ struct PTWWHE <: NMEAString heading::Float64 valid::Bool - function PTWWHE( + function WWHE( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -894,13 +944,13 @@ struct PTWWHE <: NMEAString something(tryparse(Float64, items[11]), 0.0), valid, ) - end # constructor PTWWHE -end # type PTWWHE + end # constructor WWHE +end # type WWHE """ - struct PTWHPR <: NMEAString + struct WHPR <: NMEAString -IMU Heading Pitch Roll (PTWHPR) +IMU Heading Pitch Roll (WHPR) This NMEA data type represents inertial measurement unit (IMU) information, including heading, pitch, and roll. @@ -914,18 +964,18 @@ This NMEA data type represents inertial measurement unit (IMU) information, incl # Constructor ```julia -PTWHPR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +WHPR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTWHPR(["PTWHPR", "123456", "90.0", "30.0", "-45.0"]) +data = WHPR(["WHPR", "123456", "90.0", "30.0", "-45.0"]) ``` """ -struct PTWHPR <: NMEAString +struct WHPR <: NMEAString # IMU heading pitch roll - # $PTWHPR,HEADING,PITCH,ROLL*CHECKSUM + # $WHPR,HEADING,PITCH,ROLL*CHECKSUM system::String time::Float64 heading::Float64 @@ -933,7 +983,7 @@ struct PTWHPR <: NMEAString roll::Float64 valid::Bool - function PTWHPR( + function WHPR( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -946,14 +996,14 @@ struct PTWHPR <: NMEAString something(tryparse(Float64, items[5]), 0.0), valid, ) - end # constructor PTWHPR -end # type PTWHPR + end # constructor WHPR +end # type WHPR """ - struct PTACC <: NMEAString + struct ACC <: NMEAString -IMU Accelerometer (PTACC) +IMU Accelerometer (ACC) This NMEA data type represents inertial measurement unit (IMU) accelerometer information. @@ -967,18 +1017,18 @@ This NMEA data type represents inertial measurement unit (IMU) accelerometer inf # Constructor ```julia -PTACC(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +ACC(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTACC(["PTACC", "123456", "0.5", "1.0", "-0.2"]) +data = ACC(["ACC", "123456", "0.5", "1.0", "-0.2"]) ``` """ -struct PTACC <: NMEAString +struct ACC <: NMEAString # IMU accelerometer - # $PTACC,ACC_X,ACC_Y,ACC_Z*CHECKSUM + # $ACC,ACC_X,ACC_Y,ACC_Z*CHECKSUM system::String time::Float64 x::Float64 @@ -986,7 +1036,7 @@ struct PTACC <: NMEAString z::Float64 valid::Bool - function PTACC( + function ACC( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -999,14 +1049,14 @@ struct PTACC <: NMEAString something(tryparse(Float64, items[5]), 0.0), valid, ) - end # constructor PTACC -end # type PTACC + end # constructor ACC +end # type ACC """ - struct PTGYR <: NMEAString + struct GYR <: NMEAString -IMU Gyroscope (PTGYR) +IMU Gyroscope (GYR) This NMEA data type represents inertial measurement unit (IMU) gyroscope information. @@ -1020,18 +1070,18 @@ This NMEA data type represents inertial measurement unit (IMU) gyroscope informa # Constructor ```julia -PTGYR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString +GYR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString ``` # Examples ```julia -data = PTGYR(["PTGYR", "123456", "0.1", "-0.2", "0.5"]) +data = GYR(["GYR", "123456", "0.1", "-0.2", "0.5"]) ``` """ -struct PTGYR <: NMEAString +struct GYR <: NMEAString # IMU gyroscope - # $PTGYR,GYR_X,GYR_Y,GYR_Z*CHECKSUM + # $GYR,GYR_X,GYR_Y,GYR_Z*CHECKSUM system::String time::Float64 x::Float64 @@ -1039,7 +1089,7 @@ struct PTGYR <: NMEAString z::Float64 valid::Bool - function PTGYR( + function GYR( items::Array{D}; system::AbstractString = "UNKNOWN", valid = true, @@ -1052,5 +1102,5 @@ struct PTGYR <: NMEAString something(tryparse(Float64, items[5]), 0.0), valid, ) - end # constructor PTGYR -end # type PTGYR + end # constructor GYR +end # type GYR diff --git a/src/utils.jl b/src/utils.jl index ece5f31..087a393 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -99,23 +99,27 @@ function get_system(mtype::SubString) if (occursin(r"^\$GP", mtype)) system = "GPS" - # GLONASS + # GLONASS elseif (occursin(r"^\$GL", mtype)) system = "GLONASS" - # GALILEO + # GALILEO elseif (occursin(r"^\$GA", mtype)) system = "GALILEO" - # BeiDou + # BeiDou elseif (occursin(r"^\$GB", mtype) || occursin(r"^\$BD", mtype)) system = "BEIDOU" - # Combined + # Combined elseif (occursin(r"^\$GN", mtype)) system = "COMBINED" - # Proprietary (non-NMEA standard) message + # Proprietary (non-NMEA standard) message + elseif (occursin(r"^\$P[A,T]", mtype)) + system = "PROPRIETARY" + + # TODO: support more system types message else system = "UNKNOWN" end @@ -151,16 +155,19 @@ function is_string_supported(nmea_string::AbstractString) occursin(r"GGA$", header) || occursin(r"GLL$", header) || occursin(r"GSA$", header) || + occursin(r"GST$", header) || occursin(r"GSV$", header) || occursin(r"RMC$", header) || occursin(r"VTG$", header) || occursin(r"ZDA$", header) || occursin(r"PASHR$", header) || - occursin(r"TWVCT$", header) || - occursin(r"TWPOS$", header) || - occursin(r"TWPLS$", header) || - occursin(r"TWWHE$", header) || - occursin(r"TWHPR$", header) + occursin(r"WPOS$", header) || + occursin(r"WVCT$", header) || + occursin(r"WPLS$", header) || + occursin(r"WWHE$", header) || + occursin(r"WHPR$", header) || + occursin(r"ACC$", header) || + occursin(r"GYR$", header) ) return true else @@ -175,13 +182,13 @@ function is_string_proprietary(nmea_string::AbstractString) if ( occursin(r"PASHR$", header) || - occursin(r"PTWPOS$", header) || - occursin(r"PTWVCT$", header) || - occursin(r"PTWPLS$", header) || - occursin(r"PTWWHE$", header) || - occursin(r"PTWHPR$", header) || - occursin(r"PTACC$", header) || - occursin(r"PTGYR$", header) + occursin(r"WPOS$", header) || + occursin(r"WVCT$", header) || + occursin(r"WPLS$", header) || + occursin(r"WWHE$", header) || + occursin(r"WHPR$", header) || + occursin(r"ACC$", header) || + occursin(r"GYR$", header) ) return true else @@ -208,12 +215,19 @@ hemi = "N" dec_degrees = _dms_to_dd(dms, hemi) ``` """ -function _dms_to_dd(dms::SubString, hemi::SubString)::Float64 +function _dms_to_dd(dms::SubString, hemi::SubString)::Union{Float64, Nothing} + if dms == "" || hemi == "" + throw(ArgumentError("Empty string cannot be parsed")) + end + if (dms[1:1] == "0") dms = dms[2:end] end decimalindex = findfirst('.', dms) + if isnothing(decimalindex) + throw(ArgumentError("Missing decimal index")) + end degrees = Base.parse(Float64, dms[1:decimalindex-3]) minutes = Base.parse(Float64, dms[decimalindex-2:end]) dec_degrees = degrees + (minutes / 60) @@ -243,6 +257,9 @@ seconds = _hms_to_secs(hms) ``` """ function _hms_to_secs(hms::SubString)::Float64 + if length(hms) < 6 + throw(ArgumentError("Not enough characters to be a time value")) + end hours = Base.parse(Float64, hms[1:2]) minutes = Base.parse(Float64, hms[3:4]) seconds = Base.parse(Float64, hms[5:end]) diff --git a/test/runtests.jl b/test/runtests.jl index 5165f0f..9b6ffb9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -40,7 +40,7 @@ Aqua.test_stale_deps(NMEAParser; ignore = [:Aqua]) end end -@testset "Test with Data File: `update` & `pop!`" begin +@testset "Test with Data File: `update` & `NMEAParser.pop!`" begin nmeas = NMEAData() open("$(@__DIR__())/testdata.txt", "r") do f while !eof(f) @@ -54,39 +54,39 @@ end mtype = typeof(nmea_data) if (mtype == GGA) @test !isnothing(nmeas.last_GGA) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_GGA) elseif (mtype == RMC) @test !isnothing(nmeas.last_RMC) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_RMC) elseif (mtype == GSA) @test !isnothing(nmeas.last_GSA) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_GSA) elseif (mtype == GSV) @test !isnothing(nmeas.last_GSV) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_GSV) elseif (mtype == GBS) @test !isnothing(nmeas.last_GBS) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_GBS) elseif (mtype == VTG) @test !isnothing(nmeas.last_VTG) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_VTG) elseif (mtype == GLL) @test !isnothing(nmeas.last_GLL) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_GLL) elseif (mtype == ZDA) @test !isnothing(nmeas.last_ZDA) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_ZDA) elseif (mtype == DTM) @test !isnothing(nmeas.last_DTM) - @test nmea_data == pop!(nmeas, mtype) + @test nmea_data == NMEAParser.pop!(nmeas, mtype) @test isnothing(nmeas.last_DTM) else continue @@ -319,7 +319,7 @@ end raw"$PTWHPR,161540.45,12.456,78.901,2.34,79.912,0.12*2C", validate_checksum = false, ) - @test example_default.system === "UNKNOWN" + @test example_default.system === "PROPRIETARY" @test example_default.valid === true end @testset "PTACC" begin diff --git a/test/testdata.txt b/test/testdata.txt index 835e69c..5517abd 100644 --- a/test/testdata.txt +++ b/test/testdata.txt @@ -2884,4 +2884,5 @@ $GPGGA,123519.00,4807.038,N,01131.000,E,6,08,0.9,545.4,M,-164.0,M,,,,*7b $GPGGA,123519.00,4807.038,N,01131.000,E,7,08,0.9,545.4,M,-164.0,M,,,,*7a $GPGGA,123519.00,4807.038,N,01131.000,E,8,08,0.9,545.4,M,-164.0,M,,,,*75 $GPGGA,123519.00,4807.038,N,01131.000,E,0,08,0.9,545.4,M,-164.0,M,,,,*7d -$GAGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*21 \ No newline at end of file +$GAGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*21 +$GPGST,172814.0,0.006,0.023,0.020,273.6,0.023,0.020,0.031*6A \ No newline at end of file