fit 0.4.2

A small crate used for reading and decoding FIT files generated by sports devices.
Documentation

Fit

Fit is a small crate used for reading and decoding FIT files generated by various sports devices. Currently it has only been designed specifically to read files produced by Garmin Edges 1000 and 520, and a Wahoo Elemnt. It will probably mostly work out of the box with other file sources, but will probably not work 100% perfectly unless it's a Garmin cycling computer.

It currently does not support FIT files using custom developer fields.

Installation

[dependencies]
fit = "0.4"

Usage

extern crate env_logger;
extern crate fit;

use std::path::PathBuf;
use fit::Message;

fn main() {
    let filepath = PathBuf::from("fits/2913547417.fit");
    let f: Vec<Message> = fit::read(filepath);
}

A typical Message will look something like this:

Message { 
  kind: Record, 
  values: [
    DataField { field_num: 253, value: Time(1480856114) }, 
    DataField { field_num: 0,   value: F32(57.710945)   }, 
    DataField { field_num: 1,   value: F32(11.9945755)  }, 
    DataField { field_num: 5,   value: U32(1151)        }, 
    DataField { field_num: 29,  value: U32(0)           }, 
    DataField { field_num: 2,   value: U16(2394)        }, 
    DataField { field_num: 6,   value: U16(0)           }, 
    DataField { field_num: 7,   value: U16(0)           }, 
    DataField { field_num: 61,  value: U16(2234)        }, 
    DataField { field_num: 66,  value: I16(442)         }, 
    DataField { field_num: 3,   value: U8(113)          }, 
    DataField { field_num: 13,  value: I8(21)           }
  ], 
  dev_values: [] 
}

A Value enum is a simple wrapper around most rust primitive types, such as u16 or i64 or f32.

Some things to watch out for:

  • speed is recorded as m/s, rather than kph.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/richardbrodie/fit-rs.

License

The gem is available as open source under the terms of the MIT License.