Skip to content

Commit

Permalink
Garmin FIT SDK 21.107.00 (#12)
Browse files Browse the repository at this point in the history
Change-Id: Ie685f271d4515051c8191630d4ff0f8399b9c7a5

Co-authored-by: Jenkins <[email protected]>
  • Loading branch information
Lijah99 and Jenkins authored Feb 21, 2023
1 parent e470bb6 commit d3182ef
Show file tree
Hide file tree
Showing 14 changed files with 1,098 additions and 39 deletions.
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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


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.101.0'
__version__ = '21.107.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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


Expand Down
26 changes: 16 additions & 10 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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


Expand Down Expand Up @@ -342,11 +342,17 @@ def __read_message(self, mesg_def):
# Fields with an array of values
elif num_elements > 1:
field_value = []
for i in range(num_elements):
raw_value = raw_values[index + i] if raw_values[index + i] != invalid or not convert_invalids_to_none else None
field_value.append(raw_value)
if self.__is_array_all_none(field_value) is True:
field_value = None

if(base_type_definition['type'] == FIT.BASE_TYPE["BYTE"]):
raw_array = raw_values[index : index + num_elements]
field_value = raw_array if util._only_invalid_values(raw_array, invalid) is False else None
else:
for i in range(num_elements):
raw_value = raw_values[index + i] if raw_values[index + i] != invalid or not convert_invalids_to_none else None
field_value.append(raw_value)

if self.__is_array_all_none(field_value) is True:
field_value = None

# Fields with a single value
else:
Expand Down Expand Up @@ -446,8 +452,8 @@ def __expand_components(self, mesg_num, message, fields, mesg_def):
for i in range(len(field_profile['components'])):
target_field = fields[field_profile['components'][i]]
if target_field['name'] not in mesg:
base_type = FIT.FIELD_TYPE_TO_BASE_TYPE[target_field['type']]
invalid_value = FIT.BASE_TYPE_DEFINITIONS[base_type]['invalid']
base_type = FIT.FIELD_TYPE_TO_BASE_TYPE[target_field['type']] if target_field['type'] in FIT.FIELD_TYPE_TO_BASE_TYPE else target_field['type']
invalid_value = FIT.BASE_TYPE_DEFINITIONS[base_type]['invalid'] if base_type in FIT.BASE_TYPE_DEFINITIONS else 0xFF

mesg[target_field['name']] = {
'field_value': [],
Expand Down Expand Up @@ -670,7 +676,7 @@ class FileHeader(object):
'''A class that holds a .fit File Headers parameters.'''
header_size = self._stream.read_byte()
protocol_version = self._stream.read_byte()
profile_version = self._stream.read_unint_16("big") / 100
profile_version = self._stream.read_unint_16("little")
data_size = self._stream.read_unint_32("little")
data_type = self._stream.read_string(4)
header_crc = 0
Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/fit.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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


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.101Release
# Tag = production/release/21.101.00-0-gceb92d5
# Profile Version = 21.107Release
# Tag = production/release/21.107.00-0-geade151
############################################################################################


Expand Down
Loading

0 comments on commit d3182ef

Please sign in to comment.