Library
Module
Module type
Parameter
Class
Class type
A value
is part of a data record. The interpretation of the value depends on the record and there is no obvious interpretation for a value by itself
A record
holds a set of values. The purpose of the record is implied by its msg
member. Each field
in a record has a value and an int
position. The combination of msg
and position conveys the interpretation of that value and it is defined by the FIT protocol. At this level, no interpretation is provided
A FIT file has a header and a list of records (in reversed order)
val parse : string -> (t, string) Stdlib.result
parse fit
parses the binary content fit
, typically loaded from a file
val header : string -> (header, string) Stdlib.result
header fit
parse just the header of a fit
stream
read_file path
reads a file into a string. The file must not exceed max_size
val read : ?max_size:int -> string -> (t, string) Stdlib.result
read path
reads a FIT file from path
in the file system. The input file must not exceed max_size
(100kb by default) to protect against attacks when reading user-provided files
val to_json : t -> Yojson.t
represent FIT file as JSON. This includes decoding some common fields in "record" messages.
module Decode : sig ... end
value
s reported as part of a record
are often encoded or scaled. This module provides typical decoders. How values are decoded depends on the field and the information is not part of the FIT file per se but is part of the format definition.
module Record : sig ... end
decode "record" messages