-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Kayak .kcd parsing library. -- -- Parse Kayak .kcd files. Kcd files list CAN messages details, their -- signal's and signal details, e.g. the signal offset in the CAN data -- frame or the signal type. @package kcd @version 0.1.0.0 -- |
--   import qualified Kcd.Parser as KCD
--   main = do
--     kcd <- KCD.parseKcdFile "example.kcd"
--     print kcd
--   
module Kcd.Parser parseKcdFile :: String -> IO NetworkDefinition parseNetworkDefinition :: MonadThrow m => ConduitM Event o m (Maybe NetworkDefinition) data BasicLabelTypeValue TypeValue :: BasicLabelTypeValue TypeInvalid :: BasicLabelTypeValue TypeError :: BasicLabelTypeValue -- | network transport system that transfers the data between several -- nodes. data Bus Bus :: [Message] -> Text -> Int -> Bus [_busMessages] :: Bus -> [Message] -- | Human-readable name of the bus network (e.g. Comfort). [_busName] :: Bus -> Text -- | Nominal data transfer rate in baud (e.g. 500000, 125000, 100000 or -- 83333). [_busBaudrate] :: Bus -> Int -- | Network node that is a user/receiver of the assigned signal. data Consumer Consumer :: [NodeRef] -> Consumer [_consumerNodeRef] :: Consumer -> [NodeRef] -- | Describes the scope of application e.g. the target vehicle or -- controlled device. data Document Document :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Text -> Document -- | The name of the network definition document. [_documentName] :: Document -> Maybe Text -- | The version of the network definition document. [_documentVersion] :: Document -> Maybe Text -- | The owner or author of the network definition document. [_documentAuthor] :: Document -> Maybe Text -- | The owner company of the network definition document. [_documentCompany] :: Document -> Maybe Text -- | The release date of this version of the network definition document. [_documentDate] :: Document -> Maybe Text [_documentContent] :: Document -> Text data Endianess LittleEndian :: Endianess BigEndian :: Endianess -- | Descriptive name for a single value e.g. to describe an enumeration, -- mark special,invalid or error values. data Label Label :: Int -> Text -> BasicLabelTypeValue -> Label -- | Signal raw value that is described here. [_labelValue] :: Label -> Int -- | Human readable name of the signal [_labelName] :: Label -> Text [_labelType] :: Label -> BasicLabelTypeValue data LabelGroup LabelGroup :: Text -> Text -> Text -> BasicLabelTypeValue -> LabelGroup -- | Signal raw value the label group is starting with. [_labelGroupFrom] :: LabelGroup -> Text -- | Signal raw value the label group is ending with. [_labelGroupTo] :: LabelGroup -> Text -- | Human-readable name for this value. [_labelGroupName] :: LabelGroup -> Text -- | Type of value :: "value", "invalid" or "error" [_labelGroupType] :: LabelGroup -> BasicLabelTypeValue data LabelSet LabelSet :: [Label] -> [LabelGroup] -> LabelSet [_labelSetLabel] :: LabelSet -> [Label] [_labelSetLabelGroup] :: LabelSet -> [LabelGroup] data Message Message :: Maybe Notes -> Maybe Producer -> Maybe Multiplex -> [Signal] -> MessageId -> Text -> MessageLength -> Int -> Bool -> Text -> Bool -> Message [_messageNotes] :: Message -> Maybe Notes [_messageProducer] :: Message -> Maybe Producer [_messageMultiplex] :: Message -> Maybe Multiplex [_messageSignals] :: Message -> [Signal] [_messageId] :: Message -> MessageId [_messageName] :: Message -> Text [_messageLength] :: Message -> MessageLength -- | Repetition interval of a cyclic network message in milliseconds [_messageInterval] :: Message -> Int -- | Sending behavior of the network message. True, if message is triggered -- by signal changes. [_messageTriggered] :: Message -> Bool -- | Frame format of the network message. [_messageFormat] :: Message -> Text -- | True, if message is a remote frame [_messageRemote] :: Message -> Bool newtype MessageId MessageId :: Int -> MessageId [_unMessageId] :: MessageId -> Int data MessageLength Auto :: MessageLength LengthValue :: Int -> MessageLength -- | A looping counter to make a group of signals (MuxGroup) alternately -- active at a time. data Multiplex Multiplex :: [MuxGroup] -> Maybe Notes -> Maybe Consumer -> Maybe Value -> [Label] -> Endianess -> Int -> Text -> Int -> Multiplex [_multiplexMuxGroup] :: Multiplex -> [MuxGroup] [_multiplexNotes] :: Multiplex -> Maybe Notes [_multiplexConsumer] :: Multiplex -> Maybe Consumer [_multiplexValue] :: Multiplex -> Maybe Value [_multiplexLabels] :: Multiplex -> [Label] [_multiplexEndianess] :: Multiplex -> Endianess -- | Bit length of the signal. [_multiplexLength] :: Multiplex -> Int -- | Human readable name of the signal [_multiplexName] :: Multiplex -> Text -- | Least significant bit offset of the signal relative to the least -- significant bit of the messages data payload [_multiplexOffset] :: Multiplex -> Int -- | A group of signals that is just valid when the count value of the -- group matches with the looping | counter (Multiplex). data MuxGroup MuxGroup :: [Signal] -> Int -> MuxGroup [_muxGroupSignals] :: MuxGroup -> [Signal] -- | count value of the Multiplex when the signals of this group become -- valid. [_muxGroupCount] :: MuxGroup -> Int -- | Definition of one or more CAN bus networks in one file. data NetworkDefinition NetworkDefinition :: Document -> [Node] -> [Bus] -> NetworkDefinition [_networkDefinitionDocument] :: NetworkDefinition -> Document [_networkDefinitionNodes] :: NetworkDefinition -> [Node] [_networkDefinitionBuses] :: NetworkDefinition -> [Bus] -- | An endpoint connected to the network (e.g. an electronic control unit) -- that is able to | send messages to or receive messages from other -- endpoints. data Node Node :: Text -> Maybe Text -> [Var] -> Node -- | Unique identifier of the network node. [_nodeId] :: Node -> Text -- | Human-readable name of the network node (e.g. Brake). [_nodeName] :: Node -> Maybe Text [_nodeVars] :: Node -> [Var] -- | An endpoint connected to the network that is able to send messages to -- or receive messages from other endpoints. data NodeRef NodeRef :: Text -> NodeRef -- | Referencing a network node by its unique identifier. [_nodeRefId] :: NodeRef -> Text -- | Describes the purpose of the signalvariable andor comments on -- its usage. newtype Notes Notes :: Text -> Notes -- | Origin network node that is the sender of the assigned message. data Producer Producer :: [NodeRef] -> Producer [_producerNodeRef] :: Producer -> [NodeRef] -- | A discrete part of information contained in the payload of a message. data Signal Signal :: Maybe Notes -> Maybe Consumer -> Maybe Value -> [LabelSet] -> Endianess -> Int -> Text -> Int -> Signal -- | Describes the purpose of the signalvariable andor comments on -- its usage. [_signalNotes] :: Signal -> Maybe Notes [_signalConsumer] :: Signal -> Maybe Consumer [_signalValue] :: Signal -> Maybe Value -- | A set of label and label groups. Each label describes the meaning of a -- single raw value by an alias name. | A single value can only belong to -- a one label or label group. [_signalLabelSet] :: Signal -> [LabelSet] -- | Determines if Byteorder is big-endian (Motorola), little-endian -- (Intel) otherwise. [_signalEndianess] :: Signal -> Endianess -- | Bit length of the signal. [_signalLength] :: Signal -> Int -- | Human readable name of the signal [_signalName] :: Signal -> Text -- | Least significant bit offset of the signal relative to the least -- significant bit of the messages data payload [_signalOffset] :: Signal -> Int -- | Details of how the raw value of the signal/variable shall be -- interpreted. data Value Value :: Double -> Double -> Double -> Double -> Text -> ValueType -> Value -- | Lower validity limit of the interpreted value after using the -- slope/intercept equation. [_valueMin] :: Value -> Double -- | Upper validity limit of the interpreted value after using the -- slope/intercept equation. [_valueMax] :: Value -> Double -- | The slope "m" of a linear equation y = mx + b. [_valueSlope] :: Value -> Double -- | The y-axis intercept "b" of a linear equation y = mx + b. [_valueIntercept] :: Value -> Double -- | Physical unit of the value written as unit term as described in "The -- Unified Code for Units of Measure" | (http -- ::/unitsofmeasure.orgucum.html) [_valueUnit] :: Value -> Text -- | Datatype of the value e.g. "unsigned","signed" or IEE754 "single", -- "double". [_valueType] :: Value -> ValueType data ValueType ValueTypeUnsigned :: ValueType ValueTypeSigned :: ValueType ValueTypeSingle :: ValueType ValueTypeDouble :: ValueType -- | A variable, a symbolic name associated to a chunk of information (e.g. -- a string or a value). data Var Var :: Value -> Maybe Notes -> Text -> Var [_varValue] :: Var -> Value [_varNotes] :: Var -> Maybe Notes -- | Unique name of the variable. [_varName] :: Var -> Text instance GHC.Classes.Eq Kcd.Parser.NetworkDefinition instance GHC.Show.Show Kcd.Parser.NetworkDefinition instance GHC.Classes.Eq Kcd.Parser.Node instance GHC.Show.Show Kcd.Parser.Node instance GHC.Classes.Eq Kcd.Parser.Var instance GHC.Show.Show Kcd.Parser.Var instance GHC.Classes.Eq Kcd.Parser.Bus instance GHC.Show.Show Kcd.Parser.Bus instance GHC.Classes.Eq Kcd.Parser.Message instance GHC.Show.Show Kcd.Parser.Message instance GHC.Classes.Eq Kcd.Parser.Multiplex instance GHC.Show.Show Kcd.Parser.Multiplex instance GHC.Classes.Eq Kcd.Parser.MuxGroup instance GHC.Show.Show Kcd.Parser.MuxGroup instance GHC.Classes.Eq Kcd.Parser.Signal instance GHC.Show.Show Kcd.Parser.Signal instance GHC.Classes.Eq Kcd.Parser.Notes instance GHC.Show.Show Kcd.Parser.Notes instance GHC.Classes.Eq Kcd.Parser.Endianess instance GHC.Show.Show Kcd.Parser.Endianess instance GHC.Classes.Eq Kcd.Parser.LabelSet instance GHC.Show.Show Kcd.Parser.LabelSet instance GHC.Classes.Eq Kcd.Parser.Label instance GHC.Show.Show Kcd.Parser.Label instance GHC.Classes.Eq Kcd.Parser.LabelGroup instance GHC.Show.Show Kcd.Parser.LabelGroup instance GHC.Classes.Eq Kcd.Parser.BasicLabelTypeValue instance GHC.Show.Show Kcd.Parser.BasicLabelTypeValue instance GHC.Classes.Eq Kcd.Parser.Consumer instance GHC.Show.Show Kcd.Parser.Consumer instance GHC.Classes.Eq Kcd.Parser.Producer instance GHC.Show.Show Kcd.Parser.Producer instance GHC.Classes.Eq Kcd.Parser.NodeRef instance GHC.Show.Show Kcd.Parser.NodeRef instance GHC.Classes.Eq Kcd.Parser.Value instance GHC.Show.Show Kcd.Parser.Value instance GHC.Classes.Eq Kcd.Parser.ValueType instance GHC.Show.Show Kcd.Parser.ValueType instance GHC.Classes.Eq Kcd.Parser.MessageLength instance GHC.Show.Show Kcd.Parser.MessageLength instance GHC.Classes.Ord Kcd.Parser.MessageId instance GHC.Show.Show Kcd.Parser.MessageId instance GHC.Classes.Eq Kcd.Parser.MessageId instance GHC.Classes.Eq Kcd.Parser.Document instance GHC.Show.Show Kcd.Parser.Document module Kcd