{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
module SwiftNav.SBP.Bootload
( module SwiftNav.SBP.Bootload
) where
import BasicPrelude
import Control.Lens
import Control.Monad.Loops
import Data.Binary
import Data.Binary.Get
import Data.Binary.IEEE754
import Data.Binary.Put
import Data.ByteString.Lazy hiding (ByteString)
import Data.Int
import Data.Word
import SwiftNav.SBP.TH
import SwiftNav.SBP.Types
{-# ANN module ("HLint: ignore Use camelCase"::String) #-}
{-# ANN module ("HLint: ignore Redundant do"::String) #-}
{-# ANN module ("HLint: ignore Use newtype instead of data"::String) #-}
msgBootloaderHandshakeReq :: Word16
msgBootloaderHandshakeReq :: Word16
msgBootloaderHandshakeReq = Word16
0x00B3
data MsgBootloaderHandshakeReq = MsgBootloaderHandshakeReq
deriving ( Int -> MsgBootloaderHandshakeReq -> ShowS
[MsgBootloaderHandshakeReq] -> ShowS
MsgBootloaderHandshakeReq -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgBootloaderHandshakeReq] -> ShowS
$cshowList :: [MsgBootloaderHandshakeReq] -> ShowS
show :: MsgBootloaderHandshakeReq -> String
$cshow :: MsgBootloaderHandshakeReq -> String
showsPrec :: Int -> MsgBootloaderHandshakeReq -> ShowS
$cshowsPrec :: Int -> MsgBootloaderHandshakeReq -> ShowS
Show, ReadPrec [MsgBootloaderHandshakeReq]
ReadPrec MsgBootloaderHandshakeReq
Int -> ReadS MsgBootloaderHandshakeReq
ReadS [MsgBootloaderHandshakeReq]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgBootloaderHandshakeReq]
$creadListPrec :: ReadPrec [MsgBootloaderHandshakeReq]
readPrec :: ReadPrec MsgBootloaderHandshakeReq
$creadPrec :: ReadPrec MsgBootloaderHandshakeReq
readList :: ReadS [MsgBootloaderHandshakeReq]
$creadList :: ReadS [MsgBootloaderHandshakeReq]
readsPrec :: Int -> ReadS MsgBootloaderHandshakeReq
$creadsPrec :: Int -> ReadS MsgBootloaderHandshakeReq
Read, MsgBootloaderHandshakeReq -> MsgBootloaderHandshakeReq -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgBootloaderHandshakeReq -> MsgBootloaderHandshakeReq -> Bool
$c/= :: MsgBootloaderHandshakeReq -> MsgBootloaderHandshakeReq -> Bool
== :: MsgBootloaderHandshakeReq -> MsgBootloaderHandshakeReq -> Bool
$c== :: MsgBootloaderHandshakeReq -> MsgBootloaderHandshakeReq -> Bool
Eq )
instance Binary MsgBootloaderHandshakeReq where
get :: Get MsgBootloaderHandshakeReq
get =
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBootloaderHandshakeReq
MsgBootloaderHandshakeReq
put :: MsgBootloaderHandshakeReq -> Put
put MsgBootloaderHandshakeReq
MsgBootloaderHandshakeReq =
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
$(makeSBP 'msgBootloaderHandshakeReq ''MsgBootloaderHandshakeReq)
$(makeJSON "_msgBootloaderHandshakeReq_" ''MsgBootloaderHandshakeReq)
$(makeLenses ''MsgBootloaderHandshakeReq)
msgBootloaderHandshakeResp :: Word16
msgBootloaderHandshakeResp :: Word16
msgBootloaderHandshakeResp = Word16
0x00B4
data MsgBootloaderHandshakeResp = MsgBootloaderHandshakeResp
{ MsgBootloaderHandshakeResp -> Word32
_msgBootloaderHandshakeResp_flags :: !Word32
, MsgBootloaderHandshakeResp -> Text
_msgBootloaderHandshakeResp_version :: !Text
} deriving ( Int -> MsgBootloaderHandshakeResp -> ShowS
[MsgBootloaderHandshakeResp] -> ShowS
MsgBootloaderHandshakeResp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgBootloaderHandshakeResp] -> ShowS
$cshowList :: [MsgBootloaderHandshakeResp] -> ShowS
show :: MsgBootloaderHandshakeResp -> String
$cshow :: MsgBootloaderHandshakeResp -> String
showsPrec :: Int -> MsgBootloaderHandshakeResp -> ShowS
$cshowsPrec :: Int -> MsgBootloaderHandshakeResp -> ShowS
Show, ReadPrec [MsgBootloaderHandshakeResp]
ReadPrec MsgBootloaderHandshakeResp
Int -> ReadS MsgBootloaderHandshakeResp
ReadS [MsgBootloaderHandshakeResp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgBootloaderHandshakeResp]
$creadListPrec :: ReadPrec [MsgBootloaderHandshakeResp]
readPrec :: ReadPrec MsgBootloaderHandshakeResp
$creadPrec :: ReadPrec MsgBootloaderHandshakeResp
readList :: ReadS [MsgBootloaderHandshakeResp]
$creadList :: ReadS [MsgBootloaderHandshakeResp]
readsPrec :: Int -> ReadS MsgBootloaderHandshakeResp
$creadsPrec :: Int -> ReadS MsgBootloaderHandshakeResp
Read, MsgBootloaderHandshakeResp -> MsgBootloaderHandshakeResp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgBootloaderHandshakeResp -> MsgBootloaderHandshakeResp -> Bool
$c/= :: MsgBootloaderHandshakeResp -> MsgBootloaderHandshakeResp -> Bool
== :: MsgBootloaderHandshakeResp -> MsgBootloaderHandshakeResp -> Bool
$c== :: MsgBootloaderHandshakeResp -> MsgBootloaderHandshakeResp -> Bool
Eq )
instance Binary MsgBootloaderHandshakeResp where
get :: Get MsgBootloaderHandshakeResp
get = do
Word32
_msgBootloaderHandshakeResp_flags <- Get Word32
getWord32le
Text
_msgBootloaderHandshakeResp_version <- ByteString -> Text
decodeUtf8 forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. ByteString -> ByteString
toStrict forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get ByteString
getRemainingLazyByteString
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBootloaderHandshakeResp {Word32
Text
_msgBootloaderHandshakeResp_version :: Text
_msgBootloaderHandshakeResp_flags :: Word32
_msgBootloaderHandshakeResp_version :: Text
_msgBootloaderHandshakeResp_flags :: Word32
..}
put :: MsgBootloaderHandshakeResp -> Put
put MsgBootloaderHandshakeResp {Word32
Text
_msgBootloaderHandshakeResp_version :: Text
_msgBootloaderHandshakeResp_flags :: Word32
_msgBootloaderHandshakeResp_version :: MsgBootloaderHandshakeResp -> Text
_msgBootloaderHandshakeResp_flags :: MsgBootloaderHandshakeResp -> Word32
..} = do
Word32 -> Put
putWord32le Word32
_msgBootloaderHandshakeResp_flags
ByteString -> Put
putByteString forall a b. (a -> b) -> a -> b
$ Text -> ByteString
encodeUtf8 Text
_msgBootloaderHandshakeResp_version
$(makeSBP 'msgBootloaderHandshakeResp ''MsgBootloaderHandshakeResp)
$(makeJSON "_msgBootloaderHandshakeResp_" ''MsgBootloaderHandshakeResp)
$(makeLenses ''MsgBootloaderHandshakeResp)
msgBootloaderJumpToApp :: Word16
msgBootloaderJumpToApp :: Word16
msgBootloaderJumpToApp = Word16
0x00B1
data MsgBootloaderJumpToApp = MsgBootloaderJumpToApp
{ MsgBootloaderJumpToApp -> Word8
_msgBootloaderJumpToApp_jump :: !Word8
} deriving ( Int -> MsgBootloaderJumpToApp -> ShowS
[MsgBootloaderJumpToApp] -> ShowS
MsgBootloaderJumpToApp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgBootloaderJumpToApp] -> ShowS
$cshowList :: [MsgBootloaderJumpToApp] -> ShowS
show :: MsgBootloaderJumpToApp -> String
$cshow :: MsgBootloaderJumpToApp -> String
showsPrec :: Int -> MsgBootloaderJumpToApp -> ShowS
$cshowsPrec :: Int -> MsgBootloaderJumpToApp -> ShowS
Show, ReadPrec [MsgBootloaderJumpToApp]
ReadPrec MsgBootloaderJumpToApp
Int -> ReadS MsgBootloaderJumpToApp
ReadS [MsgBootloaderJumpToApp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgBootloaderJumpToApp]
$creadListPrec :: ReadPrec [MsgBootloaderJumpToApp]
readPrec :: ReadPrec MsgBootloaderJumpToApp
$creadPrec :: ReadPrec MsgBootloaderJumpToApp
readList :: ReadS [MsgBootloaderJumpToApp]
$creadList :: ReadS [MsgBootloaderJumpToApp]
readsPrec :: Int -> ReadS MsgBootloaderJumpToApp
$creadsPrec :: Int -> ReadS MsgBootloaderJumpToApp
Read, MsgBootloaderJumpToApp -> MsgBootloaderJumpToApp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgBootloaderJumpToApp -> MsgBootloaderJumpToApp -> Bool
$c/= :: MsgBootloaderJumpToApp -> MsgBootloaderJumpToApp -> Bool
== :: MsgBootloaderJumpToApp -> MsgBootloaderJumpToApp -> Bool
$c== :: MsgBootloaderJumpToApp -> MsgBootloaderJumpToApp -> Bool
Eq )
instance Binary MsgBootloaderJumpToApp where
get :: Get MsgBootloaderJumpToApp
get = do
Word8
_msgBootloaderJumpToApp_jump <- Get Word8
getWord8
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBootloaderJumpToApp {Word8
_msgBootloaderJumpToApp_jump :: Word8
_msgBootloaderJumpToApp_jump :: Word8
..}
put :: MsgBootloaderJumpToApp -> Put
put MsgBootloaderJumpToApp {Word8
_msgBootloaderJumpToApp_jump :: Word8
_msgBootloaderJumpToApp_jump :: MsgBootloaderJumpToApp -> Word8
..} = do
Word8 -> Put
putWord8 Word8
_msgBootloaderJumpToApp_jump
$(makeSBP 'msgBootloaderJumpToApp ''MsgBootloaderJumpToApp)
$(makeJSON "_msgBootloaderJumpToApp_" ''MsgBootloaderJumpToApp)
$(makeLenses ''MsgBootloaderJumpToApp)
msgNapDeviceDnaReq :: Word16
msgNapDeviceDnaReq :: Word16
msgNapDeviceDnaReq = Word16
0x00DE
data MsgNapDeviceDnaReq = MsgNapDeviceDnaReq
deriving ( Int -> MsgNapDeviceDnaReq -> ShowS
[MsgNapDeviceDnaReq] -> ShowS
MsgNapDeviceDnaReq -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgNapDeviceDnaReq] -> ShowS
$cshowList :: [MsgNapDeviceDnaReq] -> ShowS
show :: MsgNapDeviceDnaReq -> String
$cshow :: MsgNapDeviceDnaReq -> String
showsPrec :: Int -> MsgNapDeviceDnaReq -> ShowS
$cshowsPrec :: Int -> MsgNapDeviceDnaReq -> ShowS
Show, ReadPrec [MsgNapDeviceDnaReq]
ReadPrec MsgNapDeviceDnaReq
Int -> ReadS MsgNapDeviceDnaReq
ReadS [MsgNapDeviceDnaReq]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgNapDeviceDnaReq]
$creadListPrec :: ReadPrec [MsgNapDeviceDnaReq]
readPrec :: ReadPrec MsgNapDeviceDnaReq
$creadPrec :: ReadPrec MsgNapDeviceDnaReq
readList :: ReadS [MsgNapDeviceDnaReq]
$creadList :: ReadS [MsgNapDeviceDnaReq]
readsPrec :: Int -> ReadS MsgNapDeviceDnaReq
$creadsPrec :: Int -> ReadS MsgNapDeviceDnaReq
Read, MsgNapDeviceDnaReq -> MsgNapDeviceDnaReq -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgNapDeviceDnaReq -> MsgNapDeviceDnaReq -> Bool
$c/= :: MsgNapDeviceDnaReq -> MsgNapDeviceDnaReq -> Bool
== :: MsgNapDeviceDnaReq -> MsgNapDeviceDnaReq -> Bool
$c== :: MsgNapDeviceDnaReq -> MsgNapDeviceDnaReq -> Bool
Eq )
instance Binary MsgNapDeviceDnaReq where
get :: Get MsgNapDeviceDnaReq
get =
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgNapDeviceDnaReq
MsgNapDeviceDnaReq
put :: MsgNapDeviceDnaReq -> Put
put MsgNapDeviceDnaReq
MsgNapDeviceDnaReq =
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
$(makeSBP 'msgNapDeviceDnaReq ''MsgNapDeviceDnaReq)
$(makeJSON "_msgNapDeviceDnaReq_" ''MsgNapDeviceDnaReq)
$(makeLenses ''MsgNapDeviceDnaReq)
msgNapDeviceDnaResp :: Word16
msgNapDeviceDnaResp :: Word16
msgNapDeviceDnaResp = Word16
0x00DD
data MsgNapDeviceDnaResp = MsgNapDeviceDnaResp
{ MsgNapDeviceDnaResp -> [Word8]
_msgNapDeviceDnaResp_dna :: ![Word8]
} deriving ( Int -> MsgNapDeviceDnaResp -> ShowS
[MsgNapDeviceDnaResp] -> ShowS
MsgNapDeviceDnaResp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgNapDeviceDnaResp] -> ShowS
$cshowList :: [MsgNapDeviceDnaResp] -> ShowS
show :: MsgNapDeviceDnaResp -> String
$cshow :: MsgNapDeviceDnaResp -> String
showsPrec :: Int -> MsgNapDeviceDnaResp -> ShowS
$cshowsPrec :: Int -> MsgNapDeviceDnaResp -> ShowS
Show, ReadPrec [MsgNapDeviceDnaResp]
ReadPrec MsgNapDeviceDnaResp
Int -> ReadS MsgNapDeviceDnaResp
ReadS [MsgNapDeviceDnaResp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgNapDeviceDnaResp]
$creadListPrec :: ReadPrec [MsgNapDeviceDnaResp]
readPrec :: ReadPrec MsgNapDeviceDnaResp
$creadPrec :: ReadPrec MsgNapDeviceDnaResp
readList :: ReadS [MsgNapDeviceDnaResp]
$creadList :: ReadS [MsgNapDeviceDnaResp]
readsPrec :: Int -> ReadS MsgNapDeviceDnaResp
$creadsPrec :: Int -> ReadS MsgNapDeviceDnaResp
Read, MsgNapDeviceDnaResp -> MsgNapDeviceDnaResp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgNapDeviceDnaResp -> MsgNapDeviceDnaResp -> Bool
$c/= :: MsgNapDeviceDnaResp -> MsgNapDeviceDnaResp -> Bool
== :: MsgNapDeviceDnaResp -> MsgNapDeviceDnaResp -> Bool
$c== :: MsgNapDeviceDnaResp -> MsgNapDeviceDnaResp -> Bool
Eq )
instance Binary MsgNapDeviceDnaResp where
get :: Get MsgNapDeviceDnaResp
get = do
[Word8]
_msgNapDeviceDnaResp_dna <- forall (m :: * -> *) a. Applicative m => Int -> m a -> m [a]
replicateM Int
8 Get Word8
getWord8
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgNapDeviceDnaResp {[Word8]
_msgNapDeviceDnaResp_dna :: [Word8]
_msgNapDeviceDnaResp_dna :: [Word8]
..}
put :: MsgNapDeviceDnaResp -> Put
put MsgNapDeviceDnaResp {[Word8]
_msgNapDeviceDnaResp_dna :: [Word8]
_msgNapDeviceDnaResp_dna :: MsgNapDeviceDnaResp -> [Word8]
..} = do
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Word8 -> Put
putWord8 [Word8]
_msgNapDeviceDnaResp_dna
$(makeSBP 'msgNapDeviceDnaResp ''MsgNapDeviceDnaResp)
$(makeJSON "_msgNapDeviceDnaResp_" ''MsgNapDeviceDnaResp)
$(makeLenses ''MsgNapDeviceDnaResp)
msgBootloaderHandshakeDepA :: Word16
msgBootloaderHandshakeDepA :: Word16
msgBootloaderHandshakeDepA = Word16
0x00B0
data MsgBootloaderHandshakeDepA = MsgBootloaderHandshakeDepA
{ MsgBootloaderHandshakeDepA -> [Word8]
_msgBootloaderHandshakeDepA_handshake :: ![Word8]
} deriving ( Int -> MsgBootloaderHandshakeDepA -> ShowS
[MsgBootloaderHandshakeDepA] -> ShowS
MsgBootloaderHandshakeDepA -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsgBootloaderHandshakeDepA] -> ShowS
$cshowList :: [MsgBootloaderHandshakeDepA] -> ShowS
show :: MsgBootloaderHandshakeDepA -> String
$cshow :: MsgBootloaderHandshakeDepA -> String
showsPrec :: Int -> MsgBootloaderHandshakeDepA -> ShowS
$cshowsPrec :: Int -> MsgBootloaderHandshakeDepA -> ShowS
Show, ReadPrec [MsgBootloaderHandshakeDepA]
ReadPrec MsgBootloaderHandshakeDepA
Int -> ReadS MsgBootloaderHandshakeDepA
ReadS [MsgBootloaderHandshakeDepA]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsgBootloaderHandshakeDepA]
$creadListPrec :: ReadPrec [MsgBootloaderHandshakeDepA]
readPrec :: ReadPrec MsgBootloaderHandshakeDepA
$creadPrec :: ReadPrec MsgBootloaderHandshakeDepA
readList :: ReadS [MsgBootloaderHandshakeDepA]
$creadList :: ReadS [MsgBootloaderHandshakeDepA]
readsPrec :: Int -> ReadS MsgBootloaderHandshakeDepA
$creadsPrec :: Int -> ReadS MsgBootloaderHandshakeDepA
Read, MsgBootloaderHandshakeDepA -> MsgBootloaderHandshakeDepA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsgBootloaderHandshakeDepA -> MsgBootloaderHandshakeDepA -> Bool
$c/= :: MsgBootloaderHandshakeDepA -> MsgBootloaderHandshakeDepA -> Bool
== :: MsgBootloaderHandshakeDepA -> MsgBootloaderHandshakeDepA -> Bool
$c== :: MsgBootloaderHandshakeDepA -> MsgBootloaderHandshakeDepA -> Bool
Eq )
instance Binary MsgBootloaderHandshakeDepA where
get :: Get MsgBootloaderHandshakeDepA
get = do
[Word8]
_msgBootloaderHandshakeDepA_handshake <- forall (m :: * -> *) a. Monad m => m Bool -> m a -> m [a]
whileM (Bool -> Bool
not forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Bool
isEmpty) Get Word8
getWord8
forall (f :: * -> *) a. Applicative f => a -> f a
pure MsgBootloaderHandshakeDepA {[Word8]
_msgBootloaderHandshakeDepA_handshake :: [Word8]
_msgBootloaderHandshakeDepA_handshake :: [Word8]
..}
put :: MsgBootloaderHandshakeDepA -> Put
put MsgBootloaderHandshakeDepA {[Word8]
_msgBootloaderHandshakeDepA_handshake :: [Word8]
_msgBootloaderHandshakeDepA_handshake :: MsgBootloaderHandshakeDepA -> [Word8]
..} = do
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Word8 -> Put
putWord8 [Word8]
_msgBootloaderHandshakeDepA_handshake
$(makeSBP 'msgBootloaderHandshakeDepA ''MsgBootloaderHandshakeDepA)
$(makeJSON "_msgBootloaderHandshakeDepA_" ''MsgBootloaderHandshakeDepA)
$(makeLenses ''MsgBootloaderHandshakeDepA)