package fit

  1. Overview
  2. Docs
A parser for Garmin FIT data files

Install

Dune Dependency

Authors

Maintainers

Sources

fit-1.1.0.tbz
sha256=604f0017399b1164113b099847927927527231220b9cfe58317c1384ccbd667e
sha512=226915ad724febe85ca2d86c482c49776a0beed01e3a6861479de86bd19eb2aedf05f54fb5aa18eea84d5739062f1f907ba5b0d3359ada6113ea9d177fbc88f3

doc/fit/Fit/index.html

Module FitSource

Sourcetype header = {
  1. protocol : int;
  2. profile : int;
  3. length : int;
    (*

    size of data blocks in file

    *)
}
Sourcetype value =
  1. | Enum of int
  2. | String of string
  3. | Int of int
  4. | Float of float
  5. | Unknown

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

Sourcetype record = {
  1. msg : int;
  2. fields : (int * value) list;
}

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

Sourcetype t = {
  1. header : header;
  2. records : record list;
}

A FIT file has a header and a list of records (in reversed order)

Sourceval parse : string -> (t, string) result

parse fit parses the binary content fit, typically loaded from a file

Sourceval read : ?max_size:int -> string -> (t, string) 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

Sourceval to_json : t -> Ezjsonm.t

represent FIT file as JSON. This includes decoding some common fields in "record" messages.

Sourcemodule Record : sig ... end

decode "record" messages

Sourceval records : t -> Record.t list

Extract and decode common fields

OCaml

Innovation. Community. Security.