QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
types_p.h
Go to the documentation of this file.
1 /*
2  Copyright 2021 Paul Colby
3 
4  This file is part of QtFit.
5 
6  QtFit is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  QtFit is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with QtFit. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \file
22  * Internal types used by QtFit classes.
23  */
24 
25 #ifndef QTFIT_TYPES_P_H
26 #define QTFIT_TYPES_P_H
27 
28 #include "types.h"
29 
30 #include <QList>
31 
33 
34 /*!
35  * Architecture Type for FIT Data Messages.
36  *
37  * Currently the FIT format only specified big and little endian byte-ordering, but the architecture
38  * is specified as a unsigned byte, so could, theoretically, support other architectures in future.
39  *
40  * \sa https://developer.garmin.com/fit/protocol/#definitionmessage
41  */
42 enum class Architecture : quint8 {
43  LittleEndian = 0, ///< Big-endian byte ordering.
44  BigEndian = 1, ///< Little-endian byte ordering.
45 };
46 
47 /*!
48  * Custom developer field definition.
49  *
50  * Typically, these definitions are extracted from FIT Definition Messages, then used to interpret
51  * subsequent FIT Data Messages.
52  *
53  * \sa https://developer.garmin.com/fit/protocol/#developerdatafielddescription
54  */
56  quint8 fieldNumber; ///< Maps to the field_definition_number of a field_description Message.
57  quint8 size; ///< Size (in bytes) of the specified FIT message’s field.
58  quint8 devDataIndex; ///< Maps to the developer_data_index of a developer_data_id Message.
59 };
60 
61 /*!
62  * Field Definition for FIT Data Messages.
63  *
64  * Typically, these definitions are extracted from FIT Definition Messages, then used to interpret
65  * subsequent FIT Data Messages.
66  *
67  * \sa https://developer.garmin.com/fit/protocol/#fielddefinition
68  */
70  quint8 number; ///< Unique ID for the FIT field within a given FIT data message.
71  quint8 size; ///< Size (in bytes) of the field.
72  FitBaseType baseType; ///< Base type for interpreting unknown fields.
73 };
74 
75 /*!
76  * Data Message definition.
77  *
78  * Typically, these definitions are extracted from FIT Definition Messages, then used to interpret
79  * subsequent FIT Data Messages.
80  *
81  * \sa https://developer.garmin.com/fit/protocol/#fielddefinition
82  */
84  Architecture architecture; ///< Architecture type for any multi-byte fields.
85  MesgNum globalMessageNumber; ///< FIT Global Message Number the Data Message represents.
86 
87  /// Definitons list of all fields, if any, present in the described Data Message.
88  QList<FieldDefinition> fieldDefinitions;
89 
90  /// Definitions list of all custom fields, if any, present in the described Data Message.
91  QList<DeveloperFieldDefinition> developerFieldDefinitions;
92 
93  /*!
94  * Total size, in byetes, of all fields in the described Data Message.
95  *
96  * This is the combined sum of all sizes in the \c fieldDefinitions and
97  * \c developerFieldDefintions members, which is calculated and stored when then definition is
98  * initially populated (by FitStreamReaderPrivate::parseDefinitionMessage) as an optimisation
99  * for code reading the definitions.
100  */
102 };
103 
105 
106 #endif // QTFIT_TYPES_H
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:78
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:77
Data Message definition.
Definition: types_p.h:83
QList< FieldDefinition > fieldDefinitions
Definitons list of all fields, if any, present in the described Data Message.
Definition: types_p.h:88
QList< DeveloperFieldDefinition > developerFieldDefinitions
Definitions list of all custom fields, if any, present in the described Data Message.
Definition: types_p.h:91
int recordSize
Total size, in byetes, of all fields in the described Data Message.
Definition: types_p.h:101
Architecture architecture
Architecture type for any multi-byte fields.
Definition: types_p.h:84
MesgNum globalMessageNumber
FIT Global Message Number the Data Message represents.
Definition: types_p.h:85
Custom developer field definition.
Definition: types_p.h:55
quint8 fieldNumber
Maps to the field_definition_number of a field_description Message.
Definition: types_p.h:56
quint8 size
Size (in bytes) of the specified FIT message’s field.
Definition: types_p.h:57
quint8 devDataIndex
Maps to the developer_data_index of a developer_data_id Message.
Definition: types_p.h:58
Field Definition for FIT Data Messages.
Definition: types_p.h:69
FitBaseType baseType
Base type for interpreting unknown fields.
Definition: types_p.h:72
quint8 number
Unique ID for the FIT field within a given FIT data message.
Definition: types_p.h:70
quint8 size
Size (in bytes) of the field.
Definition: types_p.h:71
Types defined by the ANT+ FIT SDK.
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
MesgNum
Garmin FIT MesgNum type.
Definition: types.h:91
Architecture
Architecture Type for FIT Data Messages.
Definition: types_p.h:42
@ BigEndian
Little-endian byte ordering.
@ LittleEndian
Big-endian byte ordering.