sbp 4.0.3 → 4.1.0
raw patch · 3 files changed
+65/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ SwiftNav.SBP: SBPMsgVelCog :: MsgVelCog -> Msg -> SBPMsg
+ SwiftNav.SBP: _SBPMsgVelCog :: Prism' SBPMsg (MsgVelCog, Msg)
+ SwiftNav.SBP.Navigation: MsgVelCog :: !Word32 -> !Word32 -> !Word32 -> !Int32 -> !Word32 -> !Word32 -> !Word32 -> !Word8 -> MsgVelCog
+ SwiftNav.SBP.Navigation: [_msgVelCog_cog] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: [_msgVelCog_cog_accuracy] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: [_msgVelCog_flags] :: MsgVelCog -> !Word8
+ SwiftNav.SBP.Navigation: [_msgVelCog_sog] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: [_msgVelCog_sog_accuracy] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: [_msgVelCog_tow] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: [_msgVelCog_vel_d] :: MsgVelCog -> !Int32
+ SwiftNav.SBP.Navigation: [_msgVelCog_vel_d_accuracy] :: MsgVelCog -> !Word32
+ SwiftNav.SBP.Navigation: data MsgVelCog
+ SwiftNav.SBP.Navigation: instance Data.Aeson.Types.FromJSON.FromJSON SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance Data.Aeson.Types.ToJSON.ToJSON SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance Data.Binary.Class.Binary SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance GHC.Classes.Eq SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance GHC.Read.Read SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance GHC.Show.Show SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: instance SwiftNav.SBP.Types.ToSBP SwiftNav.SBP.Navigation.MsgVelCog
+ SwiftNav.SBP.Navigation: msgVelCog :: Word16
+ SwiftNav.SBP.Navigation: msgVelCog_cog :: Lens' MsgVelCog Word32
+ SwiftNav.SBP.Navigation: msgVelCog_cog_accuracy :: Lens' MsgVelCog Word32
+ SwiftNav.SBP.Navigation: msgVelCog_flags :: Lens' MsgVelCog Word8
+ SwiftNav.SBP.Navigation: msgVelCog_sog :: Lens' MsgVelCog Word32
+ SwiftNav.SBP.Navigation: msgVelCog_sog_accuracy :: Lens' MsgVelCog Word32
+ SwiftNav.SBP.Navigation: msgVelCog_tow :: Lens' MsgVelCog Word32
+ SwiftNav.SBP.Navigation: msgVelCog_vel_d :: Lens' MsgVelCog Int32
+ SwiftNav.SBP.Navigation: msgVelCog_vel_d_accuracy :: Lens' MsgVelCog Word32
- SwiftNav.SBP.Types: class HasMsg c_aeNV
+ SwiftNav.SBP.Types: class HasMsg c_aeVC
- SwiftNav.SBP.Types: msg :: HasMsg c_aeNV => Lens' c_aeNV Msg
+ SwiftNav.SBP.Types: msg :: HasMsg c_aeVC => Lens' c_aeVC Msg
- SwiftNav.SBP.Types: msgSBPCrc :: HasMsg c_aeNV => Lens' c_aeNV Word16
+ SwiftNav.SBP.Types: msgSBPCrc :: HasMsg c_aeVC => Lens' c_aeVC Word16
- SwiftNav.SBP.Types: msgSBPLen :: HasMsg c_aeNV => Lens' c_aeNV Word8
+ SwiftNav.SBP.Types: msgSBPLen :: HasMsg c_aeVC => Lens' c_aeVC Word8
- SwiftNav.SBP.Types: msgSBPPayload :: HasMsg c_aeNV => Lens' c_aeNV Bytes
+ SwiftNav.SBP.Types: msgSBPPayload :: HasMsg c_aeVC => Lens' c_aeVC Bytes
- SwiftNav.SBP.Types: msgSBPSender :: HasMsg c_aeNV => Lens' c_aeNV Word16
+ SwiftNav.SBP.Types: msgSBPSender :: HasMsg c_aeVC => Lens' c_aeVC Word16
- SwiftNav.SBP.Types: msgSBPType :: HasMsg c_aeNV => Lens' c_aeNV Word16
+ SwiftNav.SBP.Types: msgSBPType :: HasMsg c_aeVC => Lens' c_aeVC Word16
Files
- sbp.cabal +1/−1
- src/SwiftNav/SBP/Msg.hs +6/−0
- src/SwiftNav/SBP/Navigation.hs +58/−0
sbp.cabal view
@@ -1,5 +1,5 @@ name: sbp-version: 4.0.3+version: 4.1.0 synopsis: SwiftNav's SBP Library homepage: https://github.com/swift-nav/libsbp license: MIT
@@ -246,6 +246,7 @@ | SBPMsgUtcTime MsgUtcTime Msg | SBPMsgUtcTimeGnss MsgUtcTimeGnss Msg | SBPMsgVelBody MsgVelBody Msg+ | SBPMsgVelCog MsgVelCog Msg | SBPMsgVelEcef MsgVelEcef Msg | SBPMsgVelEcefCov MsgVelEcefCov Msg | SBPMsgVelEcefCovGnss MsgVelEcefCovGnss Msg@@ -461,6 +462,7 @@ | _msgSBPType == msgUtcTime = SBPMsgUtcTime (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgUtcTimeGnss = SBPMsgUtcTimeGnss (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgVelBody = SBPMsgVelBody (decode (fromStrict (unBytes _msgSBPPayload))) m+ | _msgSBPType == msgVelCog = SBPMsgVelCog (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgVelEcef = SBPMsgVelEcef (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgVelEcefCov = SBPMsgVelEcefCov (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgVelEcefCovGnss = SBPMsgVelEcefCovGnss (decode (fromStrict (unBytes _msgSBPPayload))) m@@ -668,6 +670,7 @@ encoder (SBPMsgUtcTime _ m) = put m encoder (SBPMsgUtcTimeGnss _ m) = put m encoder (SBPMsgVelBody _ m) = put m+ encoder (SBPMsgVelCog _ m) = put m encoder (SBPMsgVelEcef _ m) = put m encoder (SBPMsgVelEcefCov _ m) = put m encoder (SBPMsgVelEcefCovGnss _ m) = put m@@ -879,6 +882,7 @@ | msgType == msgUtcTime = SBPMsgUtcTime <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgUtcTimeGnss = SBPMsgUtcTimeGnss <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgVelBody = SBPMsgVelBody <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj+ | msgType == msgVelCog = SBPMsgVelCog <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgVelEcef = SBPMsgVelEcef <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgVelEcefCov = SBPMsgVelEcefCov <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgVelEcefCovGnss = SBPMsgVelEcefCovGnss <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj@@ -1091,6 +1095,7 @@ toJSON (SBPMsgUtcTime n m) = toJSON n <<>> toJSON m toJSON (SBPMsgUtcTimeGnss n m) = toJSON n <<>> toJSON m toJSON (SBPMsgVelBody n m) = toJSON n <<>> toJSON m+ toJSON (SBPMsgVelCog n m) = toJSON n <<>> toJSON m toJSON (SBPMsgVelEcef n m) = toJSON n <<>> toJSON m toJSON (SBPMsgVelEcefCov n m) = toJSON n <<>> toJSON m toJSON (SBPMsgVelEcefCovGnss n m) = toJSON n <<>> toJSON m@@ -1297,6 +1302,7 @@ msg f (SBPMsgUtcTime n m) = SBPMsgUtcTime n <$> f m msg f (SBPMsgUtcTimeGnss n m) = SBPMsgUtcTimeGnss n <$> f m msg f (SBPMsgVelBody n m) = SBPMsgVelBody n <$> f m+ msg f (SBPMsgVelCog n m) = SBPMsgVelCog n <$> f m msg f (SBPMsgVelEcef n m) = SBPMsgVelEcef n <$> f m msg f (SBPMsgVelEcefCov n m) = SBPMsgVelEcefCov n <$> f m msg f (SBPMsgVelEcefCovGnss n m) = SBPMsgVelEcefCovGnss n <$> f m
@@ -1613,6 +1613,64 @@ $(makeJSON "_msgVelBody_" ''MsgVelBody) $(makeLenses ''MsgVelBody) +msgVelCog :: Word16+msgVelCog = 0x021C++-- | SBP class for message MSG_VEL_COG (0x021C).+--+-- This message reports the receiver course over ground (COG) and speed over+-- ground (SOG) based on the horizontal (N-E) components of the NED velocity+-- vector. It also includes the vertical velocity in the form of the+-- D-component of the NED velocity vector. The NED coordinate system is+-- defined as the local WGS84 tangent plane centered at the current position.+-- The full GPS time is given by the preceding MSG_GPS_TIME with the matching+-- time-of-week (tow). Note: course over ground represents the receiver's+-- direction of travel, but not necessarily the device heading.+data MsgVelCog = MsgVelCog+ { _msgVelCog_tow :: !Word32+ -- ^ GPS Time of Week+ , _msgVelCog_cog :: !Word32+ -- ^ Course over ground relative to local north+ , _msgVelCog_sog :: !Word32+ -- ^ Speed over ground+ , _msgVelCog_vel_d :: !Int32+ -- ^ Velocity Down coordinate+ , _msgVelCog_cog_accuracy :: !Word32+ -- ^ Course over ground estimated standard deviation+ , _msgVelCog_sog_accuracy :: !Word32+ -- ^ Speed over ground estimated standard deviation+ , _msgVelCog_vel_d_accuracy :: !Word32+ -- ^ Vertical velocity estimated standard deviation+ , _msgVelCog_flags :: !Word8+ -- ^ Status flags+ } deriving ( Show, Read, Eq )++instance Binary MsgVelCog where+ get = do+ _msgVelCog_tow <- getWord32le+ _msgVelCog_cog <- getWord32le+ _msgVelCog_sog <- getWord32le+ _msgVelCog_vel_d <- (fromIntegral <$> getWord32le)+ _msgVelCog_cog_accuracy <- getWord32le+ _msgVelCog_sog_accuracy <- getWord32le+ _msgVelCog_vel_d_accuracy <- getWord32le+ _msgVelCog_flags <- getWord8+ pure MsgVelCog {..}++ put MsgVelCog {..} = do+ putWord32le _msgVelCog_tow+ putWord32le _msgVelCog_cog+ putWord32le _msgVelCog_sog+ (putWord32le . fromIntegral) _msgVelCog_vel_d+ putWord32le _msgVelCog_cog_accuracy+ putWord32le _msgVelCog_sog_accuracy+ putWord32le _msgVelCog_vel_d_accuracy+ putWord8 _msgVelCog_flags++$(makeSBP 'msgVelCog ''MsgVelCog)+$(makeJSON "_msgVelCog_" ''MsgVelCog)+$(makeLenses ''MsgVelCog)+ msgAgeCorrections :: Word16 msgAgeCorrections = 0x0210