Skip to content

Commit

Permalink
Garmin FIT SDK 21.158.0
Browse files Browse the repository at this point in the history
Change-Id: I4018104c82a4d9eb6c635a215b93dab1d23b36de
  • Loading branch information
Jenkins committed Dec 16, 2024
1 parent 6367b59 commit 90a8c52
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 99 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.141.0Release
# Tag = production/release/21.141.0-0-g2aa27e1
# Profile Version = 21.158.0Release
# Tag = production/release/21.158.0-0-gc9428aa
############################################################################################


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.141.0'
__version__ = '21.158.0'
24 changes: 16 additions & 8 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.141.0Release
# Tag = production/release/21.141.0-0-g2aa27e1
# Profile Version = 21.158.0Release
# Tag = production/release/21.158.0-0-gc9428aa
############################################################################################


Expand Down Expand Up @@ -39,17 +39,25 @@ class Accumulator:
def __init__(self):
self._messages = {}

def add(self, mesg_num, field_num, value):
'''Adds a message and field which will be accumulated.'''
def createAccumulatedField(self, mesg_num, field_num, value):
'''Creates an accumulated field and stores its initial value in the accumulator'''
accumulatedField = AccumulatedField(value)

if mesg_num not in self._messages:
self._messages[mesg_num] = {}

self._messages[mesg_num][field_num] = AccumulatedField(value)
self._messages[mesg_num][field_num] = accumulatedField

return accumulatedField

def accumulate(self, mesg_num, field_num, value, bits):
'''Accumulates the given field value if present in the accumulator.'''
'''Accumulates the given field value if present in the accumulator. If it is not, the accumulated field is added to the Accumulator.'''
accumulatedField = None

if mesg_num in self._messages and field_num in self._messages[mesg_num]:
return self._messages[mesg_num][field_num].accumulate(value, bits)
accumulatedField = self._messages[mesg_num][field_num]
else:
return value
accumulatedField = self.createAccumulatedField(mesg_num, field_num, value)

return accumulatedField.accumulate(value, bits)

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.141.0Release
# Tag = production/release/21.141.0-0-g2aa27e1
# Profile Version = 21.158.0Release
# Tag = production/release/21.158.0-0-gc9428aa
############################################################################################


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.141.0Release
# Tag = production/release/21.141.0-0-g2aa27e1
# Profile Version = 21.158.0Release
# Tag = production/release/21.158.0-0-gc9428aa
############################################################################################


Expand Down
Loading

0 comments on commit 90a8c52

Please sign in to comment.