Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions garmin_fit_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand All @@ -22,4 +22,4 @@
from garmin_fit_sdk.stream import Stream
from garmin_fit_sdk.util import FIT_EPOCH_S, convert_timestamp_to_datetime

__version__ = '21.178.0'
__version__ = '21.188.0'
4 changes: 2 additions & 2 deletions garmin_fit_sdk/accumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/bitstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/crc_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
11 changes: 6 additions & 5 deletions garmin_fit_sdk/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down Expand Up @@ -217,7 +217,7 @@ def __decode_mesg_def(self):
field_definition = {
"field_id": self._stream.read_byte(),
"size": self._stream.read_byte(),
"base_type": self._stream.read_byte(),
"base_type": self._stream.read_byte() & FIT.BASE_TYPE_MASK,
}

if field_definition["base_type"] not in FIT.BASE_TYPE_DEFINITIONS:
Expand Down Expand Up @@ -636,14 +636,15 @@ def __add_field_description_to_profile(self, message):
return

if message["fit_base_type_id"] is not None:
base_type_code = FIT.BASE_TYPE_DEFINITIONS[message["fit_base_type_id"]['raw_field_value']]["type_code"]
masked_base_type = message["fit_base_type_id"]['raw_field_value'] & FIT.BASE_TYPE_MASK
base_type_code = FIT.BASE_TYPE_DEFINITIONS[masked_base_type]["type_code"]
else:
base_type_code = None

self._developer_data_defs[message['developer_data_index']['raw_field_value']]['fields'].append({
'developer_data_index': message['developer_data_index']['raw_field_value'],
'field_definition_number': message['field_definition_number']['raw_field_value'],
'fit_base_type_id': message['fit_base_type_id']['raw_field_value'] if 'fit_base_type_id' in message else None,
'fit_base_type_id': message['fit_base_type_id']['raw_field_value'] & FIT.BASE_TYPE_MASK if 'fit_base_type_id' in message else None,
'base_type_code': base_type_code,
'name': message['name']['raw_field_value'] if 'name' in message else None,
'array': message['array']['raw_field_value'] if 'array' in message else None,
Expand Down
50 changes: 26 additions & 24 deletions garmin_fit_sdk/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


BASE_TYPE = {
"ENUM": 0x00,
"SINT8": 0x01,
"UINT8": 0x02,
"SINT16": 0x83,
"UINT16": 0x84,
"SINT32": 0x85,
"UINT32": 0x86,
"SINT16": 0x03,
"UINT16": 0x04,
"SINT32": 0x05,
"UINT32": 0x06,
"STRING": 0x07,
"FLOAT32": 0x88,
"FLOAT64": 0x89,
"FLOAT32": 0x08,
"FLOAT64": 0x09,
"UINT8Z": 0x0A,
"UINT16Z": 0x8B,
"UINT32Z": 0x8C,
"UINT16Z": 0x0B,
"UINT32Z": 0x0C,
"BYTE": 0x0D,
"SINT64": 0x8E,
"UINT64": 0x8F,
"UINT64Z": 0x90
"SINT64": 0x0E,
"UINT64": 0x0F,
"UINT64Z": 0x10
}

FIELD_TYPE_TO_BASE_TYPE = {
Expand All @@ -55,22 +55,24 @@
0x00: {'size': 1, 'type': BASE_TYPE["ENUM"], 'signed': False, 'type_code': 'B', 'invalid': 0xFF},
0x01: {'size': 1, 'type': BASE_TYPE["SINT8"], 'signed': True, 'type_code': 'b', 'invalid': 0x7F},
0x02: {'size': 1, 'type': BASE_TYPE["UINT8"], 'signed': False, 'type_code': 'B', 'invalid': 0xFF},
0x83: {'size': 2, 'type': BASE_TYPE["SINT16"], 'signed': True, 'type_code': 'h', 'invalid': 0x7FFF},
0x84: {'size': 2, 'type': BASE_TYPE["UINT16"], 'signed': False, 'type_code': 'H', 'invalid': 0xFFFF},
0x85: {'size': 4, 'type': BASE_TYPE["SINT32"], 'signed': True, 'type_code': 'i', 'invalid': 0x7FFFFFFF},
0x86: {'size': 4, 'type': BASE_TYPE["UINT32"], 'signed': False, 'type_code': 'I', 'invalid': 0xFFFFFFFF},
0x03: {'size': 2, 'type': BASE_TYPE["SINT16"], 'signed': True, 'type_code': 'h', 'invalid': 0x7FFF},
0x04: {'size': 2, 'type': BASE_TYPE["UINT16"], 'signed': False, 'type_code': 'H', 'invalid': 0xFFFF},
0x05: {'size': 4, 'type': BASE_TYPE["SINT32"], 'signed': True, 'type_code': 'i', 'invalid': 0x7FFFFFFF},
0x06: {'size': 4, 'type': BASE_TYPE["UINT32"], 'signed': False, 'type_code': 'I', 'invalid': 0xFFFFFFFF},
0x07: {'size': 1, 'type': BASE_TYPE["STRING"], 'signed': False, 'type_code': 's', 'invalid': 0x00},
0x88: {'size': 4, 'type': BASE_TYPE["FLOAT32"], 'signed': True, 'type_code': 'f', 'invalid': 0xFFFFFFFF},
0x89: {'size': 8, 'type': BASE_TYPE["FLOAT64"], 'signed': True, 'type_code': 'd', 'invalid': 0xFFFFFFFFFFFFFFFF},
0x08: {'size': 4, 'type': BASE_TYPE["FLOAT32"], 'signed': True, 'type_code': 'f', 'invalid': 0xFFFFFFFF},
0x09: {'size': 8, 'type': BASE_TYPE["FLOAT64"], 'signed': True, 'type_code': 'd', 'invalid': 0xFFFFFFFFFFFFFFFF},
0x0A: {'size': 1, 'type': BASE_TYPE["UINT8Z"], 'signed': False, 'type_code': 'B', 'invalid': 0x00},
0x8B: {'size': 2, 'type': BASE_TYPE["UINT16Z"], 'signed': False, 'type_code': 'H', 'invalid': 0x0000},
0x8C: {'size': 4, 'type': BASE_TYPE["UINT32Z"], 'signed': False, 'type_code': 'I', 'invalid': 0x00000000},
0x0B: {'size': 2, 'type': BASE_TYPE["UINT16Z"], 'signed': False, 'type_code': 'H', 'invalid': 0x0000},
0x0C: {'size': 4, 'type': BASE_TYPE["UINT32Z"], 'signed': False, 'type_code': 'I', 'invalid': 0x00000000},
0x0D: {'size': 1, 'type': BASE_TYPE["BYTE"], 'signed': False, 'type_code': 'B', 'invalid': 0xFF},
0x8E: {'size': 8, 'type': BASE_TYPE["SINT64"], 'signed': True, 'type_code': 'q', 'invalid': 0x7FFFFFFFFFFFFFFF},
0x8F: {'size': 8, 'type': BASE_TYPE["UINT64"], 'signed': False, 'type_code': 'Q', 'invalid': 0xFFFFFFFFFFFFFFFF},
0x90: {'size': 8, 'type': BASE_TYPE["UINT64Z"], 'signed': False, 'type_code': 'L', 'invalid': 0x0000000000000000},
0x0E: {'size': 8, 'type': BASE_TYPE["SINT64"], 'signed': True, 'type_code': 'q', 'invalid': 0x7FFFFFFFFFFFFFFF},
0x0F: {'size': 8, 'type': BASE_TYPE["UINT64"], 'signed': False, 'type_code': 'Q', 'invalid': 0xFFFFFFFFFFFFFFFF},
0x10: {'size': 8, 'type': BASE_TYPE["UINT64Z"], 'signed': False, 'type_code': 'L', 'invalid': 0x0000000000000000},
}

BASE_TYPE_MASK = 0x1F

NUMERIC_FIELD_TYPES = [
"sint8",
"uint8",
Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/hr_mesg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
22 changes: 16 additions & 6 deletions garmin_fit_sdk/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Profile = {
'version': {
'major': 21,
'minor': 178,
'minor': 188,
'patch': 0,
'type': "Release"
},
Expand Down Expand Up @@ -4473,7 +4473,7 @@
'sub_fields': []
},
253: {
'num': 253, # Sesson end time.
'num': 253,
'name': "timestamp",
'type': "date_time",
'array': "false",
Expand Down Expand Up @@ -6724,7 +6724,7 @@
'sub_fields': []
},
253: {
'num': 253, # Lap end time.
'num': 253,
'name': "timestamp",
'type': "date_time",
'array': "false",
Expand Down Expand Up @@ -14806,7 +14806,7 @@
'sub_fields': []
},
253: {
'num': 253, # Lap end time.
'num': 253,
'name': "timestamp",
'type': "date_time",
'array': "false",
Expand Down Expand Up @@ -23405,6 +23405,7 @@
'4446': 'hrm_fit',
'4472': 'marq_gen2_commander',
'4477': 'lily_athlete', # aka the Lily 2 Active
'4525': 'rally_x10', # Rally 110/210
'4532': 'fenix8_solar',
'4533': 'fenix8_solar_large',
'4534': 'fenix8_small',
Expand All @@ -23420,13 +23421,22 @@
'4603': 'venu_x1',
'4606': 'hrm_200',
'4625': 'vivoactive6',
'4631': 'fenix8_pro',
'4633': 'edge_550',
'4634': 'edge_850',
'4643': 'venu4',
'4644': 'venu4s',
'4647': 'approachS44',
'4655': 'edge_mtb',
'4656': 'approachS50',
'4666': 'fenix_e',
'4745': 'bounce2',
'4759': 'instinct3_solar_50mm',
'4775': 'tactix8_amoled',
'4776': 'tactix8_solar',
'4879': 'd2_mach2',
'4678': 'instinct_crossover_amoled',
'4944': 'd2_air_x15',
'10007': 'sdm4', # SDM4 footpod
'10014': 'edge_remote',
'20533': 'tacx_training_app_win',
Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.178.0Release
# Tag = production/release/21.178.0-0-g3bea629
# Profile Version = 21.188.0Release
# Tag = production/release/21.188.0-0-g55050f8
############################################################################################


Expand Down
41 changes: 35 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
[build-system]
requires = [
"setuptools >= 48",
"setuptools_scm[toml] >= 4, <6",
"setuptools_scm_git_archive",
"wheel >= 0.29.0",
requires = ["setuptools >= 64"]
build-backend = "setuptools.build_meta"

[project]
version = "21.188.0"
name = "garmin-fit-sdk"
description = "Garmin FIT Python SDK"
authors = [{ name = "Garmin International, Inc." }]
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
keywords = ["garmin", "fit sdk", "fit"]
requires-python = ">=3.6"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Operating System :: OS Independent",
]
build-backend = 'setuptools.build_meta'
urls = { "Homepage" = "https://github.com/garmin/fit-python-sdk" }
dependencies = []

[project.optional-dependencies]
dev = ["pytest~=7.0.1", "pytest-cov~=3.0.0", "pytest-mock~=3.6.1"]

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
exclude = [".gitignore", ".vscode*", ".pytest_cache*", ".test.py"]
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

# __init__.py for the fit sdk tests module

__version__ = '21.178.0'
__version__ = '21.188.0'
10 changes: 10 additions & 0 deletions tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ class Data:
0x5C, 0xF2, 0x6D, 0x00, 0x36, 0xEE, 0x80, 0x78, 0x3B
])

fit_file_short_multibyte_dev_data = bytearray([
0x0E, 0x20, 0xB9, 0x52, 0x3F, 0x00, 0x00, 0x00, 0x2E, 0x46, 0x49, 0x54,
0xED, 0x8A, 0x40, 0x00, 0x01, 0x00, 0xCF, 0x01, 0x03, 0x01, 0x02, 0x00,
0x00, 0x40, 0x00, 0x01, 0x00, 0xCE, 0x05, 0x00, 0x01, 0x02, 0x01, 0x01,
0x02, 0x02, 0x01, 0x02, 0x08, 0x07, 0x07, 0x0E, 0x02, 0x84, 0x00, 0x00,
0x00, 0x84, 0x70, 0x6F, 0x69, 0x6E, 0x74, 0x73, 0x00, 0x00, 0x12, 0x60,
0x00, 0x01, 0x00, 0x12, 0x01, 0xFE, 0x02, 0x84, 0x01, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x04, 0xD2, 0x97, 0x59
])

fit_file_monitoring = bytearray([
0x0E, 0x10, 0x28, 0x23, 0x37, 0x00, 0x00, 0x00, 0x2E, 0x46, 0x49, 0x54,
0x2C, 0xC6, 0x41, 0x00, 0x01, 0x00, 0x37, 0x03, 0xFD, 0x04, 0x86, 0x18,
Expand Down
Loading
Loading