Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Messages API abtracts over the structure of a FIT file slightly and presents the FIT file as just the sequence of data messages in the file. The Messages API also abstracts over the various FIT base types (for example, signed/unsigned integers of different sizes) to give a simpler set of types to work with.
If you need to know about the very specifics of the FIT file structure, use the Raw API instead. However, for pulling information out of a FIT file this API is much more convenient.
- readMessages :: ByteString -> Either String Messages
- readFileMessages :: FilePath -> IO (Either String Messages)
- parseMessages :: Parser Messages
- newtype Messages = Messages {}
- data Message = Message {}
- data Field = Field {}
- data Value
- data SingletonValue
- data ArrayValue
Documentation
readMessages :: ByteString -> Either String Messages Source
Parse a strict ByteString
containing the FIT data into its Messages
readFileMessages :: FilePath -> IO (Either String Messages) Source
Parse the given FIT file into its Messages
parseMessages :: Parser Messages Source
An Attoparsec parser for Messages
The collection of data messages from the FIT file.
A FIT data message
A single field in a FIT data message
FIT values can either contain a single piece of data or an array. FIT arrays are homogenous
data SingletonValue Source
A singleton value. In the Messages API we abstract over the specific FIT base type of the field. For example, the FIT types uint8, sint8, uint16, etc. are all presented as an IntValue
. FIT strings (ie. character arrays) are presented as singleton TextValue
s. If you need to know the specific base type of a field you can use the Raw API.
data ArrayValue Source
Array values. Like singleton values these ignore the specific FIT base type to present a simpler interface. Byte arrays are presented as strict ByteString
s. There are no character arrays, since the singleton TextValue
handles that case.