+
Skip to content

Offset and scale are not fixed values #87

Open
@jovandeginste

Description

@jovandeginste

I'm running into issues decoding fit-files downloaded from Garmin Connect. Specifically, the elevations are wrong. I believe the documentation says the elevation (like any numeric value) may have a scale and offset (those may be 1 and 0 respectively), and those are specified in the record message. In the code, I see those are fixed values.

Could you check my logic here?

The snippet from the documentation:

Scale/Offset

The FIT SDK supports applying a scale or offset to binary fields. This allows efficient representation of values within a particular range and provides a convenient method for representing floating point values in integer systems. A scale or offset may be specified in the FIT profile for binary fields (sint/uint etc.) only. When specified, the binary quantity is divided by the scale factor and then the offset is subtracted, yielding a floating point quantity. The field access functions within the SDK automatically handle this conversion. If no scale and offset are specified, the field is interpreted as the underlying type and no extra conversion is necessary.

...

Scale and offset must be specified for all components even if these are 1 and 0. However, scale and offset will not be applied to destination fields with types of string or enum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载