How to use the choochoo.fit.decode.Field function in choochoo

To help you get started, we’ve selected a few choochoo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andrewcooke / choochoo / choochoo / fit / decode.py View on Github external
def header_defn(log, types, messages):
    message = messages.number_to_message(HEADER_GLOBAL_TYPE)
    return Definition(log, Identity(message.name, Counter()), LITTLE, message,
                      [Field(log, field[1] * types.profile_to_type(field[2]).size,
                             message.number_to_field(n),
                             types.profile_to_type(field[2]))
                       for n, field in enumerate(HEADER_FIELDS)],
                      (),
                      {'header_size'})  # this needed as reference for optional field logic
github andrewcooke / choochoo / choochoo / fit / decode.py View on Github external
def __dev_field(self, data):
        number, size, developer_index = data
        field = self.__dev_fields[developer_index][number]
        return Field(self.__log, size, field, field.type)
github andrewcooke / choochoo / choochoo / fit / decode.py View on Github external
def __field(self, data, message):
        number, size, base = data
        try:
            field = message.number_to_field(number)
        except KeyError:
            field = None
        base_type = self.__types.base_types[base & 0xf]
        return Field(self.__log, size, field, base_type)