fit-0.5: FIT file decoder

Safe HaskellNone
LanguageHaskell2010

Fit.Messages

Description

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.

Synopsis

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

newtype Messages Source

The collection of data messages from the FIT file.

Constructors

Messages 

Fields

_messages :: Seq Message
 

Instances

data Message Source

A FIT data message

Constructors

Message 

Fields

_mNumber :: !Int

The global message number, as found in the FIT profile

_mFields :: IntMap Field

The fields in the message, mapped from field number to Field

Instances

data Field Source

A single field in a FIT data message

Constructors

Field 

Fields

_fNumber :: !Int

The field number, as found in the FIT profile

_fValue :: Value
 

Instances

data Value Source

FIT values can either contain a single piece of data or an array. FIT arrays are homogenous

Instances

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 TextValues. If you need to know the specific base type of a field you can use the Raw API.

Instances

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 ByteStrings. There are no character arrays, since the singleton TextValue handles that case.

Instances