├── .gitignore ├── examples ├── commute.rda └── mt_beauty.fit ├── NAMESPACE ├── figure ├── unnamed-chunk-10.png ├── unnamed-chunk-5.png ├── unnamed-chunk-6.png ├── unnamed-chunk-7.png ├── unnamed-chunk-8.png └── unnamed-chunk-9.png ├── .Rbuildignore ├── R ├── RcppExports.R └── fit.R ├── fit.Rproj ├── man ├── read_fit.Rd └── fit-package.Rd ├── DESCRIPTION ├── src ├── RcppExports.cpp ├── fit_buffered_record_mesg.hpp ├── fit_factory.hpp ├── fit_mesg_listener.hpp ├── fit_crc.hpp ├── fit_hrv_mesg_listener.hpp ├── fit_lap_mesg_listener.hpp ├── fit_pad_mesg_listener.hpp ├── fit_goal_mesg_listener.hpp ├── fit_event_mesg_listener.hpp ├── fit_sport_mesg_listener.hpp ├── fit_course_mesg_listener.hpp ├── fit_length_mesg_listener.hpp ├── fit_record_mesg_listener.hpp ├── fit_totals_mesg_listener.hpp ├── fit_file_id_mesg_listener.hpp ├── fit_hr_zone_mesg_listener.hpp ├── fit_session_mesg_listener.hpp ├── fit_workout_mesg_listener.hpp ├── fit_activity_mesg_listener.hpp ├── fit_met_zone_mesg_listener.hpp ├── fit_schedule_mesg_listener.hpp ├── fit_software_mesg_listener.hpp ├── fit_memo_glob_mesg_listener.hpp ├── fit_pad_mesg.hpp ├── fit_mesg_with_event_listener.hpp ├── fit_monitoring_mesg_listener.hpp ├── fit_power_zone_mesg_listener.hpp ├── fit_speed_zone_mesg_listener.hpp ├── fit_device_info_mesg_listener.hpp ├── fit_hrm_profile_mesg_listener.hpp ├── fit_sdm_profile_mesg_listener.hpp ├── fit_mesg_definition_listener.hpp ├── fit_bike_profile_mesg_listener.hpp ├── fit_cadence_zone_mesg_listener.hpp ├── fit_course_point_mesg_listener.hpp ├── fit_file_creator_mesg_listener.hpp ├── fit_slave_device_mesg_listener.hpp ├── fit_user_profile_mesg_listener.hpp ├── fit_weight_scale_mesg_listener.hpp ├── fit_workout_step_mesg_listener.hpp ├── fit_zones_target_mesg_listener.hpp ├── fit_capabilities_mesg_listener.hpp ├── fit_runtime_exception.hpp ├── fit_training_file_mesg_listener.hpp ├── fit_blood_pressure_mesg_listener.hpp ├── fit_buffered_record_mesg_listener.hpp ├── fit_device_settings_mesg_listener.hpp ├── fit_monitoring_info_mesg_listener.hpp ├── fit_file_capabilities_mesg_listener.hpp ├── fit_mesg_capabilities_mesg_listener.hpp ├── fit_field_capabilities_mesg_listener.hpp ├── fit_config.hpp ├── fit_accumulator.hpp ├── fit_buffered_record_mesg_broadcaster.cpp ├── fit_accumulated_field.cpp ├── fit_accumulator.cpp ├── fit_accumulated_field.hpp ├── fit_mesg_with_event.hpp ├── fit_buffered_record_mesg_broadcaster.hpp ├── fit_mesg_with_event_broadcaster.hpp ├── fit_field_definition.hpp ├── fit_encode.hpp ├── fit_buffer_encode.hpp ├── fit_unicode.hpp ├── fit_crc.cpp ├── fit_mesg_definition.hpp ├── fit_hrv_mesg.hpp ├── fit_file_creator_mesg.hpp ├── fit_field_definition.cpp ├── fit_sport_mesg.hpp ├── fit_course_mesg.hpp ├── fit.cpp ├── fit_hr_zone_mesg.hpp ├── fit_software_mesg.hpp ├── fit_power_zone_mesg.hpp ├── fit_speed_zone_mesg.hpp ├── fit_cadence_zone_mesg.hpp ├── fit_encode.cpp ├── fit_slave_device_mesg.hpp ├── fit_buffer_encode.cpp ├── fit_workout_mesg.hpp ├── fit_met_zone_mesg.hpp ├── fit_device_settings_mesg.hpp ├── fit_field_capabilities_mesg.hpp ├── fit_hrm_profile_mesg.hpp ├── fit_memo_glob_mesg.hpp ├── fit_zones_target_mesg.hpp ├── fit_capabilities_mesg.hpp ├── fit_mesg_with_event_broadcaster.cpp ├── fit_mesg_definition.cpp └── fit_file_capabilities_mesg.hpp ├── MIT_LICENSE.txt └── ANT+_LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/.gitignore -------------------------------------------------------------------------------- /examples/commute.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/examples/commute.rda -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | useDynLib(fit) 2 | exportPattern("^[[:alpha:]]+") 3 | importFrom(Rcpp, evalCpp) 4 | -------------------------------------------------------------------------------- /examples/mt_beauty.fit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/examples/mt_beauty.fit -------------------------------------------------------------------------------- /figure/unnamed-chunk-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-10.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-5.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-6.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-7.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-8.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuperov/fit/HEAD/figure/unnamed-chunk-9.png -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^examples$ 4 | ^README 5 | ^figure$ 6 | ^ggmapTemp.png$ 7 | ^.Rhistory$ 8 | ^.gitignore$ 9 | ^.Rproj.user$ 10 | ^.git$ 11 | ^src\symbols.rds$ 12 | .DS_Store$ 13 | -------------------------------------------------------------------------------- /R/RcppExports.R: -------------------------------------------------------------------------------- 1 | # This file was generated by Rcpp::compileAttributes 2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | decode_fit_file <- function(f1) { 5 | .Call('fit_decode_fit_file', PACKAGE = 'fit', f1) 6 | } 7 | 8 | -------------------------------------------------------------------------------- /fit.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageInstallArgs: --no-multiarch --with-keep.source 17 | -------------------------------------------------------------------------------- /man/read_fit.Rd: -------------------------------------------------------------------------------- 1 | \name{read.fit} 2 | \alias{read.fit} 3 | \docType{package} 4 | \title{ 5 | Read a FIT file into R 6 | } 7 | \description{ 8 | Decodes a FIT file, producing a single table for each message type. 9 | } 10 | \usage{ 11 | fit <- read.fit(filename) 12 | } 13 | \examples{ 14 | \dontrun{ 15 | gps <- read.fit('workout.fit')$record 16 | plot(density(gps$heart_rate), main="Heart rate density") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: fit 2 | Type: Package 3 | Title: Import GPS data from FIT files 4 | Version: 0.1 5 | Date: 2014-10-04 6 | Author: Alex Cooper 7 | Maintainer: Alex Cooper 8 | Description: The FIT protocol is used to transmit and store data for a range of GPS and fitness devices. This package was written to download data from a Garmin Edge 500, although it may work with a wider range of devices. 9 | License: The majority of the code included in this package is provided under the ANT+ Shared Source License. The remainder is provided under the MIT license. See individual source files for details. 10 | Imports: Rcpp (>= 0.11.2) 11 | LinkingTo: Rcpp 12 | -------------------------------------------------------------------------------- /src/RcppExports.cpp: -------------------------------------------------------------------------------- 1 | // This file was generated by Rcpp::compileAttributes 2 | // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | #include 5 | 6 | using namespace Rcpp; 7 | 8 | // decode_fit_file 9 | Rcpp::List decode_fit_file(SEXP f1); 10 | RcppExport SEXP fit_decode_fit_file(SEXP f1SEXP) { 11 | BEGIN_RCPP 12 | SEXP __sexp_result; 13 | { 14 | Rcpp::RNGScope __rngScope; 15 | Rcpp::traits::input_parameter< SEXP >::type f1(f1SEXP ); 16 | Rcpp::List __result = decode_fit_file(f1); 17 | PROTECT(__sexp_result = Rcpp::wrap(__result)); 18 | } 19 | UNPROTECT(1); 20 | return __sexp_result; 21 | END_RCPP 22 | } 23 | -------------------------------------------------------------------------------- /R/fit.R: -------------------------------------------------------------------------------- 1 | 2 | read.fit <- function(filename) { 3 | fit_message_tables <- decode_fit_file(filename); 4 | for (table in names(fit_message_tables)) { 5 | unitattr <- attr(fit_message_tables[[table]], 'units') 6 | tbl <- as.data.frame(fit_message_tables[[table]]) 7 | if (!is.null(unitattr)) { 8 | # HACK - incantation to convert 'semicircles' to degrees 9 | # this should be done in C++ when the data type is available 10 | sc_cols = which(unitattr == 'semicircles') 11 | tbl[,sc_cols] <- (tbl[,sc_cols] * 180 / 2^31 + 180) %% 360 - 180 12 | unitattr[sc_cols] <- 'degrees' 13 | attr(tbl, 'units') <- unitattr 14 | } 15 | fit_message_tables[[table]] <- tbl 16 | } 17 | fit_message_tables 18 | } 19 | -------------------------------------------------------------------------------- /man/fit-package.Rd: -------------------------------------------------------------------------------- 1 | \name{fit-package} 2 | \alias{fit-package} 3 | \alias{fit} 4 | \docType{package} 5 | \title{ 6 | What the package does (short line) 7 | } 8 | \description{ 9 | More about what it does (maybe more than one line) 10 | ~~ A concise (1-5 lines) description of the package ~~ 11 | } 12 | \details{ 13 | \tabular{ll}{ 14 | Package: \tab fit\cr 15 | Type: \tab Package\cr 16 | Version: \tab 1.0\cr 17 | Date: \tab 2014-10-04\cr 18 | License: \tab What Licence is it under ?\cr 19 | } 20 | ~~ An overview of how to use the package, including the most important functions ~~ 21 | } 22 | \author{ 23 | Who wrote it 24 | 25 | Maintainer: Who to complain to 26 | } 27 | \references{ 28 | ~~ Literature or other references for background information ~~ 29 | } 30 | ~~ Optionally other standard keywords, one per line, from file KEYWORDS in the R ~~ 31 | ~~ documentation directory ~~ 32 | \keyword{ package } 33 | \seealso{ 34 | ~~ Optional links to other man pages, e.g. ~~ 35 | ~~ \code{\link[:-package]{}} ~~ 36 | } 37 | \examples{ 38 | %% ~~ simple examples of the most important functions ~~ 39 | } 40 | -------------------------------------------------------------------------------- /MIT_LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alex Cooper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/fit_buffered_record_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BUFFERED_RECORD_MESG_HPP) 19 | #define FIT_BUFFERED_RECORD_MESG_HPP 20 | 21 | #include "fit_record_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class BufferedRecordMesg : public RecordMesg 27 | { 28 | }; 29 | 30 | } // namespace fit 31 | 32 | #endif // !defined(FIT_BUFFERED_RECORD_MESG_HPP) 33 | -------------------------------------------------------------------------------- /src/fit_factory.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FACTORY_HPP) 19 | #define FIT_FACTORY_HPP 20 | 21 | #include 22 | #include "fit_mesg.hpp" 23 | 24 | namespace fit 25 | { 26 | 27 | class Factory 28 | { 29 | public: 30 | static Mesg CreateMesg(Mesg mesg); 31 | private: 32 | 33 | 34 | }; 35 | 36 | } // namespace fit 37 | 38 | #endif // !defined(FIT_FACTORY_HPP) 39 | -------------------------------------------------------------------------------- /src/fit_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_LISTENER_HPP) 19 | #define FIT_MESG_LISTENER_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MesgListener { 27 | public: 28 | virtual ~MesgListener() {} 29 | virtual void OnMesg(Mesg& mesg) = 0; 30 | }; 31 | 32 | } // namespace fit 33 | 34 | #endif // !defined(FIT_MESG_LISTENER_HPP) 35 | -------------------------------------------------------------------------------- /src/fit_crc.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_CRC_HPP) 19 | #define FIT_CRC_HPP 20 | 21 | #include "fit.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CRC 27 | { 28 | public: 29 | static FIT_UINT16 Get16(FIT_UINT16 crc, FIT_UINT8 byte); 30 | static FIT_UINT16 Calc16(const volatile void *data, FIT_UINT8 size); 31 | }; 32 | 33 | 34 | } // namespace fit 35 | 36 | #endif // !defined(FIT_CRC_HPP) 37 | -------------------------------------------------------------------------------- /src/fit_hrv_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HRV_MESG_LISTENER_HPP) 19 | #define FIT_HRV_MESG_LISTENER_HPP 20 | 21 | #include "fit_hrv_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrvMesgListener 27 | { 28 | public: 29 | virtual ~HrvMesgListener() {} 30 | virtual void OnMesg(HrvMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_HRV_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_lap_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_LAP_MESG_LISTENER_HPP) 19 | #define FIT_LAP_MESG_LISTENER_HPP 20 | 21 | #include "fit_lap_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class LapMesgListener 27 | { 28 | public: 29 | virtual ~LapMesgListener() {} 30 | virtual void OnMesg(LapMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_LAP_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_pad_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_PAD_MESG_LISTENER_HPP) 19 | #define FIT_PAD_MESG_LISTENER_HPP 20 | 21 | #include "fit_pad_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class PadMesgListener 27 | { 28 | public: 29 | virtual ~PadMesgListener() {} 30 | virtual void OnMesg(PadMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_PAD_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_goal_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_GOAL_MESG_LISTENER_HPP) 19 | #define FIT_GOAL_MESG_LISTENER_HPP 20 | 21 | #include "fit_goal_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class GoalMesgListener 27 | { 28 | public: 29 | virtual ~GoalMesgListener() {} 30 | virtual void OnMesg(GoalMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_GOAL_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_event_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_EVENT_MESG_LISTENER_HPP) 19 | #define FIT_EVENT_MESG_LISTENER_HPP 20 | 21 | #include "fit_event_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class EventMesgListener 27 | { 28 | public: 29 | virtual ~EventMesgListener() {} 30 | virtual void OnMesg(EventMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_EVENT_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_sport_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SPORT_MESG_LISTENER_HPP) 19 | #define FIT_SPORT_MESG_LISTENER_HPP 20 | 21 | #include "fit_sport_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SportMesgListener 27 | { 28 | public: 29 | virtual ~SportMesgListener() {} 30 | virtual void OnMesg(SportMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SPORT_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_course_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_COURSE_MESG_LISTENER_HPP) 19 | #define FIT_COURSE_MESG_LISTENER_HPP 20 | 21 | #include "fit_course_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CourseMesgListener 27 | { 28 | public: 29 | virtual ~CourseMesgListener() {} 30 | virtual void OnMesg(CourseMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_COURSE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_length_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_LENGTH_MESG_LISTENER_HPP) 19 | #define FIT_LENGTH_MESG_LISTENER_HPP 20 | 21 | #include "fit_length_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class LengthMesgListener 27 | { 28 | public: 29 | virtual ~LengthMesgListener() {} 30 | virtual void OnMesg(LengthMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_LENGTH_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_record_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_RECORD_MESG_LISTENER_HPP) 19 | #define FIT_RECORD_MESG_LISTENER_HPP 20 | 21 | #include "fit_record_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class RecordMesgListener 27 | { 28 | public: 29 | virtual ~RecordMesgListener() {} 30 | virtual void OnMesg(RecordMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_RECORD_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_totals_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_TOTALS_MESG_LISTENER_HPP) 19 | #define FIT_TOTALS_MESG_LISTENER_HPP 20 | 21 | #include "fit_totals_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class TotalsMesgListener 27 | { 28 | public: 29 | virtual ~TotalsMesgListener() {} 30 | virtual void OnMesg(TotalsMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_TOTALS_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_file_id_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FILE_ID_MESG_LISTENER_HPP) 19 | #define FIT_FILE_ID_MESG_LISTENER_HPP 20 | 21 | #include "fit_file_id_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FileIdMesgListener 27 | { 28 | public: 29 | virtual ~FileIdMesgListener() {} 30 | virtual void OnMesg(FileIdMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_FILE_ID_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_hr_zone_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HR_ZONE_MESG_LISTENER_HPP) 19 | #define FIT_HR_ZONE_MESG_LISTENER_HPP 20 | 21 | #include "fit_hr_zone_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrZoneMesgListener 27 | { 28 | public: 29 | virtual ~HrZoneMesgListener() {} 30 | virtual void OnMesg(HrZoneMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_HR_ZONE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_session_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SESSION_MESG_LISTENER_HPP) 19 | #define FIT_SESSION_MESG_LISTENER_HPP 20 | 21 | #include "fit_session_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SessionMesgListener 27 | { 28 | public: 29 | virtual ~SessionMesgListener() {} 30 | virtual void OnMesg(SessionMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SESSION_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_workout_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_WORKOUT_MESG_LISTENER_HPP) 19 | #define FIT_WORKOUT_MESG_LISTENER_HPP 20 | 21 | #include "fit_workout_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class WorkoutMesgListener 27 | { 28 | public: 29 | virtual ~WorkoutMesgListener() {} 30 | virtual void OnMesg(WorkoutMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_WORKOUT_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_activity_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ACTIVITY_MESG_LISTENER_HPP) 19 | #define FIT_ACTIVITY_MESG_LISTENER_HPP 20 | 21 | #include "fit_activity_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class ActivityMesgListener 27 | { 28 | public: 29 | virtual ~ActivityMesgListener() {} 30 | virtual void OnMesg(ActivityMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_ACTIVITY_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_met_zone_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MET_ZONE_MESG_LISTENER_HPP) 19 | #define FIT_MET_ZONE_MESG_LISTENER_HPP 20 | 21 | #include "fit_met_zone_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MetZoneMesgListener 27 | { 28 | public: 29 | virtual ~MetZoneMesgListener() {} 30 | virtual void OnMesg(MetZoneMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MET_ZONE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_schedule_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SCHEDULE_MESG_LISTENER_HPP) 19 | #define FIT_SCHEDULE_MESG_LISTENER_HPP 20 | 21 | #include "fit_schedule_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class ScheduleMesgListener 27 | { 28 | public: 29 | virtual ~ScheduleMesgListener() {} 30 | virtual void OnMesg(ScheduleMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SCHEDULE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_software_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SOFTWARE_MESG_LISTENER_HPP) 19 | #define FIT_SOFTWARE_MESG_LISTENER_HPP 20 | 21 | #include "fit_software_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SoftwareMesgListener 27 | { 28 | public: 29 | virtual ~SoftwareMesgListener() {} 30 | virtual void OnMesg(SoftwareMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SOFTWARE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_memo_glob_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MEMO_GLOB_MESG_LISTENER_HPP) 19 | #define FIT_MEMO_GLOB_MESG_LISTENER_HPP 20 | 21 | #include "fit_memo_glob_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MemoGlobMesgListener 27 | { 28 | public: 29 | virtual ~MemoGlobMesgListener() {} 30 | virtual void OnMesg(MemoGlobMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MEMO_GLOB_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_pad_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_PAD_MESG_HPP) 19 | #define FIT_PAD_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class PadMesg : public Mesg 27 | { 28 | public: 29 | PadMesg(void) : Mesg(Profile::MESG_PAD) 30 | { 31 | } 32 | 33 | PadMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | }; 38 | 39 | } // namespace fit 40 | 41 | #endif // !defined(FIT_PAD_MESG_HPP) 42 | -------------------------------------------------------------------------------- /src/fit_mesg_with_event_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_WITH_EVENT_LISTENER_HPP) 19 | #define FIT_MESG_WITH_EVENT_LISTENER_HPP 20 | 21 | #include "fit_mesg_with_event.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MesgWithEventListener 27 | { 28 | public: 29 | virtual ~MesgWithEventListener() {} 30 | virtual void OnMesg(MesgWithEvent& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MESG_WITH_EVENT_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_monitoring_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MONITORING_MESG_LISTENER_HPP) 19 | #define FIT_MONITORING_MESG_LISTENER_HPP 20 | 21 | #include "fit_monitoring_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MonitoringMesgListener 27 | { 28 | public: 29 | virtual ~MonitoringMesgListener() {} 30 | virtual void OnMesg(MonitoringMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MONITORING_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_power_zone_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_POWER_ZONE_MESG_LISTENER_HPP) 19 | #define FIT_POWER_ZONE_MESG_LISTENER_HPP 20 | 21 | #include "fit_power_zone_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class PowerZoneMesgListener 27 | { 28 | public: 29 | virtual ~PowerZoneMesgListener() {} 30 | virtual void OnMesg(PowerZoneMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_POWER_ZONE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_speed_zone_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SPEED_ZONE_MESG_LISTENER_HPP) 19 | #define FIT_SPEED_ZONE_MESG_LISTENER_HPP 20 | 21 | #include "fit_speed_zone_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SpeedZoneMesgListener 27 | { 28 | public: 29 | virtual ~SpeedZoneMesgListener() {} 30 | virtual void OnMesg(SpeedZoneMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SPEED_ZONE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_device_info_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_DEVICE_INFO_MESG_LISTENER_HPP) 19 | #define FIT_DEVICE_INFO_MESG_LISTENER_HPP 20 | 21 | #include "fit_device_info_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class DeviceInfoMesgListener 27 | { 28 | public: 29 | virtual ~DeviceInfoMesgListener() {} 30 | virtual void OnMesg(DeviceInfoMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_DEVICE_INFO_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_hrm_profile_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HRM_PROFILE_MESG_LISTENER_HPP) 19 | #define FIT_HRM_PROFILE_MESG_LISTENER_HPP 20 | 21 | #include "fit_hrm_profile_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrmProfileMesgListener 27 | { 28 | public: 29 | virtual ~HrmProfileMesgListener() {} 30 | virtual void OnMesg(HrmProfileMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_HRM_PROFILE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_sdm_profile_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SDM_PROFILE_MESG_LISTENER_HPP) 19 | #define FIT_SDM_PROFILE_MESG_LISTENER_HPP 20 | 21 | #include "fit_sdm_profile_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SdmProfileMesgListener 27 | { 28 | public: 29 | virtual ~SdmProfileMesgListener() {} 30 | virtual void OnMesg(SdmProfileMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SDM_PROFILE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_mesg_definition_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_DEFINITION_LISTENER_HPP) 19 | #define FIT_MESG_DEFINITION_LISTENER_HPP 20 | 21 | #include "fit_mesg_definition.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MesgDefinitionListener { 27 | public: 28 | virtual ~MesgDefinitionListener() {} 29 | virtual void OnMesgDefinition(MesgDefinition& mesgDef) = 0; 30 | }; 31 | 32 | } // namespace fit 33 | 34 | #endif // !defined(FIT_MESG_DEFINITION_LISTENER_HPP) 35 | -------------------------------------------------------------------------------- /src/fit_bike_profile_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BIKE_PROFILE_MESG_LISTENER_HPP) 19 | #define FIT_BIKE_PROFILE_MESG_LISTENER_HPP 20 | 21 | #include "fit_bike_profile_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class BikeProfileMesgListener 27 | { 28 | public: 29 | virtual ~BikeProfileMesgListener() {} 30 | virtual void OnMesg(BikeProfileMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_BIKE_PROFILE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_cadence_zone_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_CADENCE_ZONE_MESG_LISTENER_HPP) 19 | #define FIT_CADENCE_ZONE_MESG_LISTENER_HPP 20 | 21 | #include "fit_cadence_zone_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CadenceZoneMesgListener 27 | { 28 | public: 29 | virtual ~CadenceZoneMesgListener() {} 30 | virtual void OnMesg(CadenceZoneMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_CADENCE_ZONE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_course_point_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_COURSE_POINT_MESG_LISTENER_HPP) 19 | #define FIT_COURSE_POINT_MESG_LISTENER_HPP 20 | 21 | #include "fit_course_point_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CoursePointMesgListener 27 | { 28 | public: 29 | virtual ~CoursePointMesgListener() {} 30 | virtual void OnMesg(CoursePointMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_COURSE_POINT_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_file_creator_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FILE_CREATOR_MESG_LISTENER_HPP) 19 | #define FIT_FILE_CREATOR_MESG_LISTENER_HPP 20 | 21 | #include "fit_file_creator_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FileCreatorMesgListener 27 | { 28 | public: 29 | virtual ~FileCreatorMesgListener() {} 30 | virtual void OnMesg(FileCreatorMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_FILE_CREATOR_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_slave_device_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SLAVE_DEVICE_MESG_LISTENER_HPP) 19 | #define FIT_SLAVE_DEVICE_MESG_LISTENER_HPP 20 | 21 | #include "fit_slave_device_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SlaveDeviceMesgListener 27 | { 28 | public: 29 | virtual ~SlaveDeviceMesgListener() {} 30 | virtual void OnMesg(SlaveDeviceMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_SLAVE_DEVICE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_user_profile_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_USER_PROFILE_MESG_LISTENER_HPP) 19 | #define FIT_USER_PROFILE_MESG_LISTENER_HPP 20 | 21 | #include "fit_user_profile_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class UserProfileMesgListener 27 | { 28 | public: 29 | virtual ~UserProfileMesgListener() {} 30 | virtual void OnMesg(UserProfileMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_USER_PROFILE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_weight_scale_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_WEIGHT_SCALE_MESG_LISTENER_HPP) 19 | #define FIT_WEIGHT_SCALE_MESG_LISTENER_HPP 20 | 21 | #include "fit_weight_scale_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class WeightScaleMesgListener 27 | { 28 | public: 29 | virtual ~WeightScaleMesgListener() {} 30 | virtual void OnMesg(WeightScaleMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_WEIGHT_SCALE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_workout_step_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_WORKOUT_STEP_MESG_LISTENER_HPP) 19 | #define FIT_WORKOUT_STEP_MESG_LISTENER_HPP 20 | 21 | #include "fit_workout_step_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class WorkoutStepMesgListener 27 | { 28 | public: 29 | virtual ~WorkoutStepMesgListener() {} 30 | virtual void OnMesg(WorkoutStepMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_WORKOUT_STEP_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_zones_target_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ZONES_TARGET_MESG_LISTENER_HPP) 19 | #define FIT_ZONES_TARGET_MESG_LISTENER_HPP 20 | 21 | #include "fit_zones_target_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class ZonesTargetMesgListener 27 | { 28 | public: 29 | virtual ~ZonesTargetMesgListener() {} 30 | virtual void OnMesg(ZonesTargetMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_ZONES_TARGET_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_capabilities_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_CAPABILITIES_MESG_LISTENER_HPP) 19 | #define FIT_CAPABILITIES_MESG_LISTENER_HPP 20 | 21 | #include "fit_capabilities_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CapabilitiesMesgListener 27 | { 28 | public: 29 | virtual ~CapabilitiesMesgListener() {} 30 | virtual void OnMesg(CapabilitiesMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_CAPABILITIES_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_runtime_exception.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_RUNTIME_EXCEPTION_HPP) 19 | #define FIT_RUNTIME_EXCEPTION_HPP 20 | 21 | #include 22 | #include 23 | 24 | namespace fit 25 | { 26 | 27 | class RuntimeException : public std::runtime_error 28 | { 29 | public: 30 | RuntimeException(const std::string& msg = "") 31 | : runtime_error(msg) 32 | { 33 | } 34 | }; 35 | 36 | } // namespace fit 37 | 38 | #endif // !defined(FIT_RUNTIME_EXCEPTION_HPP) 39 | -------------------------------------------------------------------------------- /src/fit_training_file_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_TRAINING_FILE_MESG_LISTENER_HPP) 19 | #define FIT_TRAINING_FILE_MESG_LISTENER_HPP 20 | 21 | #include "fit_training_file_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class TrainingFileMesgListener 27 | { 28 | public: 29 | virtual ~TrainingFileMesgListener() {} 30 | virtual void OnMesg(TrainingFileMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_TRAINING_FILE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_blood_pressure_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BLOOD_PRESSURE_MESG_LISTENER_HPP) 19 | #define FIT_BLOOD_PRESSURE_MESG_LISTENER_HPP 20 | 21 | #include "fit_blood_pressure_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class BloodPressureMesgListener 27 | { 28 | public: 29 | virtual ~BloodPressureMesgListener() {} 30 | virtual void OnMesg(BloodPressureMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_BLOOD_PRESSURE_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_buffered_record_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BUFFERED_RECORD_MESG_LISTENER_HPP) 19 | #define FIT_BUFFERED_RECORD_MESG_LISTENER_HPP 20 | 21 | #include "fit_buffered_record_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class BufferedRecordMesgListener 27 | { 28 | public: 29 | virtual ~BufferedRecordMesgListener() {} 30 | virtual void OnMesg(BufferedRecordMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_BUFFERED_RECORD_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_device_settings_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_DEVICE_SETTINGS_MESG_LISTENER_HPP) 19 | #define FIT_DEVICE_SETTINGS_MESG_LISTENER_HPP 20 | 21 | #include "fit_device_settings_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class DeviceSettingsMesgListener 27 | { 28 | public: 29 | virtual ~DeviceSettingsMesgListener() {} 30 | virtual void OnMesg(DeviceSettingsMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_DEVICE_SETTINGS_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_monitoring_info_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MONITORING_INFO_MESG_LISTENER_HPP) 19 | #define FIT_MONITORING_INFO_MESG_LISTENER_HPP 20 | 21 | #include "fit_monitoring_info_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MonitoringInfoMesgListener 27 | { 28 | public: 29 | virtual ~MonitoringInfoMesgListener() {} 30 | virtual void OnMesg(MonitoringInfoMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MONITORING_INFO_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_file_capabilities_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FILE_CAPABILITIES_MESG_LISTENER_HPP) 19 | #define FIT_FILE_CAPABILITIES_MESG_LISTENER_HPP 20 | 21 | #include "fit_file_capabilities_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FileCapabilitiesMesgListener 27 | { 28 | public: 29 | virtual ~FileCapabilitiesMesgListener() {} 30 | virtual void OnMesg(FileCapabilitiesMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_FILE_CAPABILITIES_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_mesg_capabilities_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_CAPABILITIES_MESG_LISTENER_HPP) 19 | #define FIT_MESG_CAPABILITIES_MESG_LISTENER_HPP 20 | 21 | #include "fit_mesg_capabilities_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MesgCapabilitiesMesgListener 27 | { 28 | public: 29 | virtual ~MesgCapabilitiesMesgListener() {} 30 | virtual void OnMesg(MesgCapabilitiesMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_MESG_CAPABILITIES_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_field_capabilities_mesg_listener.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FIELD_CAPABILITIES_MESG_LISTENER_HPP) 19 | #define FIT_FIELD_CAPABILITIES_MESG_LISTENER_HPP 20 | 21 | #include "fit_field_capabilities_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FieldCapabilitiesMesgListener 27 | { 28 | public: 29 | virtual ~FieldCapabilitiesMesgListener() {} 30 | virtual void OnMesg(FieldCapabilitiesMesg& mesg) = 0; 31 | }; 32 | 33 | } // namespace fit 34 | 35 | #endif // !defined(FIT_FIELD_CAPABILITIES_MESG_LISTENER_HPP) 36 | -------------------------------------------------------------------------------- /src/fit_config.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | 13 | 14 | #if !defined(FIT_CONFIG_H) 15 | #define FIT_CONFIG_H 16 | 17 | 18 | #if defined(__cplusplus) 19 | extern "C" { 20 | #endif 21 | 22 | //#define FIT_USE_STDINT_H // Define to use stdint.h types. By default size in bytes of integer types assumed to be char=1, short=2, long=4. 23 | #define FIT_WIDE_CHAR_SIZE 2 // Define the size of a wide character (1, 2 or 4 bytes). 24 | // Character encoding also defined by size. 1: UTF-8 2: UTF-16 4: UTF-32 25 | //#define FIT_CPP_INCLUDE_C // Define to include C definitions in C++ header file. Allows C and C++ code to be compiled together. 26 | 27 | #if defined(__cplusplus) 28 | } 29 | #endif 30 | 31 | #endif // !defined(FIT_CONFIG_H) 32 | -------------------------------------------------------------------------------- /src/fit_accumulator.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ACCUMULATOR_HPP) 19 | #define FIT_ACCUMULATOR_HPP 20 | 21 | #include 22 | #include "fit_accumulated_field.hpp" 23 | 24 | namespace fit 25 | { 26 | 27 | class Accumulator 28 | { 29 | public: 30 | FIT_UINT32 Accumulate(const FIT_UINT16 mesgNum, const FIT_UINT8 fieldNum, const FIT_UINT8 componentNum, const FIT_UINT32 value, const FIT_UINT8 bits); 31 | 32 | private: 33 | std::vector fields; 34 | }; 35 | 36 | } // namespace fit 37 | 38 | #endif // defined(FIT_ACCUMULATOR_HPP) 39 | 40 | -------------------------------------------------------------------------------- /src/fit_buffered_record_mesg_broadcaster.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_buffered_record_mesg_broadcaster.hpp" 19 | 20 | namespace fit 21 | { 22 | 23 | BufferedRecordMesgBroadcaster::BufferedRecordMesgBroadcaster(void) 24 | { 25 | } 26 | 27 | void BufferedRecordMesgBroadcaster::AddListener(BufferedRecordMesgListener& mesgListener) 28 | { 29 | listeners.push_back(&mesgListener); 30 | } 31 | 32 | void BufferedRecordMesgBroadcaster::OnMesg(RecordMesg& mesg) 33 | { 34 | bufferedRecordMesg.SetFields(mesg); 35 | 36 | for (int i = 0; i < (int)listeners.size(); i++) 37 | { 38 | listeners[i]->OnMesg(bufferedRecordMesg); 39 | } 40 | } 41 | 42 | } // namespace fit 43 | -------------------------------------------------------------------------------- /src/fit_accumulated_field.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_accumulated_field.hpp" 19 | 20 | namespace fit 21 | { 22 | 23 | AccumulatedField::AccumulatedField(const FIT_UINT16 newMesgNum, const FIT_UINT8 newFieldNum, const FIT_UINT8 newComponentNum) 24 | : mesgNum(newMesgNum), fieldNum(newFieldNum), componentNum(newComponentNum), lastValue(0), accumulatedValue(0) 25 | { 26 | } 27 | 28 | FIT_UINT32 AccumulatedField::Accumulate(const FIT_UINT32 value, const FIT_UINT8 bits) 29 | { 30 | FIT_UINT32 mask = ((FIT_UINT32) 1 << bits) - 1; 31 | 32 | accumulatedValue += (value - lastValue) & mask; 33 | lastValue = value; 34 | 35 | return accumulatedValue; 36 | } 37 | 38 | } // namespace fit 39 | -------------------------------------------------------------------------------- /src/fit_accumulator.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_accumulator.hpp" 19 | 20 | namespace fit 21 | { 22 | 23 | FIT_UINT32 Accumulator::Accumulate(const FIT_UINT16 mesgNum, const FIT_UINT8 fieldNum, const FIT_UINT8 componentNum, const FIT_UINT32 value, const FIT_UINT8 bits) 24 | { 25 | int i; 26 | 27 | for (i = 0; i < (int)fields.size(); i++) 28 | { 29 | if ((fields[i].mesgNum == mesgNum) && (fields[i].fieldNum == fieldNum) && (fields[i].componentNum == componentNum)) 30 | break; 31 | } 32 | 33 | if (i == (int)fields.size()) { 34 | fields.push_back(AccumulatedField(mesgNum, fieldNum, componentNum)); 35 | } 36 | 37 | return fields[i].Accumulate(value, bits); 38 | } 39 | 40 | } // namespace fit 41 | -------------------------------------------------------------------------------- /src/fit_accumulated_field.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ACCUMULATED_FIELD_HPP) 19 | #define FIT_ACCUMULATED_FIELD_HPP 20 | 21 | #include "fit.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class AccumulatedField 27 | { 28 | public: 29 | FIT_UINT16 mesgNum; 30 | FIT_UINT8 fieldNum; 31 | FIT_UINT8 componentNum; 32 | FIT_UINT32 lastValue; 33 | FIT_UINT32 accumulatedValue; 34 | 35 | AccumulatedField(const FIT_UINT16 newMesgNum, const FIT_UINT8 newFieldNum, const FIT_UINT8 newComponentNum); 36 | FIT_UINT32 Accumulate(const FIT_UINT32 value, const FIT_UINT8 bits); 37 | 38 | private: 39 | }; 40 | 41 | } // namespace fit 42 | 43 | #endif // defined(FIT_ACCUMULATED_FIELD_HPP) 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/fit_mesg_with_event.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_WITH_EVENT_HPP) 19 | #define FIT_MESG_WITH_EVENT_HPP 20 | 21 | #include "fit.hpp" 22 | #include "fit_profile.hpp" 23 | 24 | namespace fit 25 | { 26 | 27 | class MesgWithEvent 28 | { 29 | public: 30 | virtual ~MesgWithEvent() {} 31 | virtual FIT_DATE_TIME GetTimestamp(void) const = 0; 32 | virtual void SetTimestamp(FIT_DATE_TIME timestamp) = 0; 33 | virtual FIT_EVENT GetEvent() const = 0; 34 | virtual void SetEvent(FIT_EVENT event) = 0; 35 | virtual FIT_EVENT_TYPE GetEventType() const = 0; 36 | virtual void SetEventType(FIT_EVENT_TYPE type) = 0; 37 | virtual FIT_UINT8 GetEventGroup() const = 0; 38 | virtual void SetEventGroup(FIT_UINT8 group) = 0; 39 | }; 40 | 41 | } // namespace fit 42 | 43 | #endif // !defined(FIT_MESG_WITH_EVENT_HPP) 44 | -------------------------------------------------------------------------------- /src/fit_buffered_record_mesg_broadcaster.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BUFFERED_RECORD_MESG_BROADCASTER_HPP) 19 | #define FIT_BUFFERED_RECORD_MESG_BROADCASTER_HPP 20 | 21 | #include 22 | #include "fit_buffered_record_mesg_listener.hpp" 23 | #include "fit_buffered_record_mesg.hpp" 24 | #include "fit_record_mesg_listener.hpp" 25 | 26 | namespace fit 27 | { 28 | 29 | class BufferedRecordMesgBroadcaster : public RecordMesgListener 30 | { 31 | public: 32 | BufferedRecordMesgBroadcaster(void); 33 | void AddListener(BufferedRecordMesgListener& mesgListener); 34 | void OnMesg(RecordMesg& mesg); 35 | 36 | private: 37 | BufferedRecordMesg bufferedRecordMesg; 38 | std::vector listeners; 39 | }; 40 | 41 | } // namespace fit 42 | 43 | #endif // !defined(FIT_BUFFERED_RECORD_MESG_BROADCASTER_HPP) 44 | -------------------------------------------------------------------------------- /src/fit_mesg_with_event_broadcaster.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_WITH_EVENT_BROADCASTER_HPP) 19 | #define FIT_MESG_WITH_EVENT_BROADCASTER_HPP 20 | 21 | #include 22 | #include 23 | #include "fit_mesg_with_event_listener.hpp" 24 | #include "fit_mesg_with_event.hpp" 25 | 26 | namespace fit 27 | { 28 | 29 | class MesgWithEventBroadcaster : public MesgWithEventListener 30 | { 31 | public: 32 | MesgWithEventBroadcaster(void); 33 | void AddListener(MesgWithEventListener& mesgObserver); 34 | void OnMesg(MesgWithEvent& mesg); 35 | 36 | private: 37 | void Broadcast(MesgWithEvent& mesg); 38 | 39 | std::vector listeners; 40 | std::vector > startedEvents; 41 | }; 42 | 43 | } // namespace fit 44 | 45 | #endif // !defined(FIT_MESG_WITH_EVENT_BROADCASTER_HPP) 46 | -------------------------------------------------------------------------------- /src/fit_field_definition.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FIELD_DEFINITION_HPP) 19 | #define FIT_FIELD_DEFINITION_HPP 20 | 21 | #include 22 | #include "fit.hpp" 23 | #include "fit_field.hpp" 24 | 25 | namespace fit 26 | { 27 | 28 | class FieldDefinition 29 | { 30 | public: 31 | FieldDefinition(); 32 | FieldDefinition(const Field& field); 33 | FieldDefinition(const Field* field); 34 | FIT_UINT8 GetNum() const; 35 | FIT_UINT8 GetSize() const; 36 | FIT_UINT8 GetType() const; 37 | void SetNum(const FIT_UINT8 newNum); 38 | void SetSize(const FIT_UINT8 newSize); 39 | void SetType(const FIT_UINT8 newType); 40 | FIT_BOOL operator==(const FieldDefinition& field) const; 41 | FIT_BOOL operator!=(const FieldDefinition& field) const; 42 | FIT_UINT8 Write(std::ostream &file) const; 43 | 44 | private: 45 | FIT_UINT8 num; 46 | FIT_UINT8 size; 47 | FIT_UINT8 type; 48 | }; 49 | 50 | } // namespace fit 51 | 52 | #endif // defined(FIT_FIELD_DEFINITION_HPP) 53 | -------------------------------------------------------------------------------- /src/fit_encode.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ENCODE_HPP) 19 | #define FIT_ENCODE_HPP 20 | 21 | #include 22 | #include 23 | #include "fit.hpp" 24 | #include "fit_mesg.hpp" 25 | #include "fit_mesg_definition.hpp" 26 | #include "fit_mesg_definition_listener.hpp" 27 | #include "fit_mesg_listener.hpp" 28 | 29 | namespace fit 30 | { 31 | 32 | class Encode : public MesgListener, public MesgDefinitionListener 33 | { 34 | public: 35 | Encode(void); 36 | void Open(std::iostream& file); 37 | void Write(const MesgDefinition& mesgDef); 38 | void Write(const Mesg& mesg); 39 | void Write(const std::vector& mesgs); 40 | FIT_BOOL Close(void); 41 | void OnMesg(Mesg& mesg); 42 | void OnMesgDefinition(MesgDefinition& mesgDef); 43 | 44 | private: 45 | void WriteFileHeader(void); 46 | 47 | MesgDefinition lastMesgDefinition[FIT_MAX_LOCAL_MESGS]; 48 | long dataSize; 49 | std::iostream *file; 50 | }; 51 | 52 | } // namespace fit 53 | 54 | #endif // defined(FIT_ENCODE_HPP) 55 | -------------------------------------------------------------------------------- /src/fit_buffer_encode.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_BUFFER_ENCODE_HPP) 19 | #define FIT_BUFFER_ENCODE_HPP 20 | 21 | #include 22 | #include 23 | #include 24 | #include "fit.hpp" 25 | #include "fit_mesg.hpp" 26 | #include "fit_mesg_definition.hpp" 27 | #include "fit_mesg_definition_listener.hpp" 28 | #include "fit_mesg_listener.hpp" 29 | 30 | namespace fit 31 | { 32 | 33 | class BufferEncode : public MesgListener, public MesgDefinitionListener 34 | { 35 | public: 36 | BufferEncode(void); 37 | void Open(); 38 | void Write(const MesgDefinition& mesgDef); 39 | void Write(const Mesg& mesg); 40 | void Write(const std::vector& mesgs); 41 | std::string Close(void); 42 | void OnMesg(Mesg& mesg); 43 | void OnMesgDefinition(MesgDefinition& mesgDef); 44 | 45 | private: 46 | std::stringstream stringWriter; 47 | long dataSize; 48 | MesgDefinition lastMesgDefinition[FIT_MAX_LOCAL_MESGS]; 49 | }; 50 | 51 | } // namespace fit 52 | 53 | #endif // defined(FIT_BUFFER_ENCODE_HPP) 54 | -------------------------------------------------------------------------------- /src/fit_unicode.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_UNICODE_HPP) 19 | #define FIT_UNICODE_HPP 20 | 21 | #include 22 | #include 23 | #include "fit.hpp" 24 | 25 | namespace fit 26 | { 27 | 28 | class Unicode 29 | { 30 | public: 31 | typedef std::string UTF8_STRING; // UTF-8 encoded strings used for file/message input and output. 32 | typedef std::fstream UTF8_FSTREAM; 33 | typedef std::ofstream UTF8_OFSTREAM; 34 | typedef std::ifstream UTF8_IFSTREAM; 35 | typedef std::stringstream UTF8_SSTREAM; 36 | typedef std::ostringstream UTF8_OSSTREAM; 37 | typedef std::istringstream UTF8_ISSTREAM; 38 | 39 | public: 40 | static Unicode::UTF8_STRING Encode_BaseToUTF8(const FIT_WSTRING& strSrc); 41 | static FIT_WSTRING Encode_UTF8ToBase(const Unicode::UTF8_STRING& strSrc); 42 | static Unicode::UTF8_STRING Copy_StdToUTF8(const std::string& strSrc); 43 | static std::string Copy_UTF8ToStd(const Unicode::UTF8_STRING& strSrc); 44 | }; 45 | 46 | } // namespace fit 47 | 48 | #endif // !defined(FIT_UNICODE_HPP) 49 | -------------------------------------------------------------------------------- /src/fit_crc.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_crc.hpp" 19 | 20 | namespace fit 21 | { 22 | 23 | FIT_UINT16 CRC::Get16(FIT_UINT16 crc, FIT_UINT8 byte) 24 | { 25 | static const FIT_UINT16 crc_table[16] = 26 | { 27 | 0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401, 28 | 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400 29 | }; 30 | FIT_UINT16 tmp; 31 | 32 | // compute checksum of lower four bits of byte 33 | tmp = crc_table[crc & 0xF]; 34 | crc = (crc >> 4) & 0x0FFF; 35 | crc = crc ^ tmp ^ crc_table[byte & 0xF]; 36 | 37 | // now compute checksum of upper four bits of byte 38 | tmp = crc_table[crc & 0xF]; 39 | crc = (crc >> 4) & 0x0FFF; 40 | crc = crc ^ tmp ^ crc_table[(byte >> 4) & 0xF]; 41 | 42 | return crc; 43 | } 44 | 45 | FIT_UINT16 CRC::Calc16(const volatile void *data, FIT_UINT8 size) 46 | { 47 | FIT_UINT16 crc = 0; 48 | FIT_BYTE *data_ptr = (FIT_BYTE *)data; 49 | 50 | while (size) 51 | { 52 | crc = CRC::Get16(crc, *data_ptr); 53 | data_ptr++; 54 | size--; 55 | } 56 | 57 | return crc; 58 | } 59 | 60 | } // namespace fit 61 | -------------------------------------------------------------------------------- /ANT+_LICENSE.txt: -------------------------------------------------------------------------------- 1 | ANT+ SHARED SOURCE LICENSE 2 | ========================== 3 | 4 | ANT+ reference software published on our website with the following license is made available for use by the ANT+ community in products or developments. Please contact info@thisisant.com with any questions on the license. 5 | 6 | This software is subject to the ANT+ Shared Source License www.thisisant.com/developer/ant/licensing 7 | Copyright (c) Dynastream Innovations, Inc. 2012 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 13 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | 3. Neither the name of Dynastream nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 15 | 16 | The following actions are prohibited: 17 | 18 | 1. Redistribution of source code containing the ANT+ Network Key. The ANT+ Network Key is available to ANT+ Adopters. 19 | Please refer to http://thisisant.com to become an ANT+ Adopter and access the key. 20 | 2. Reverse engineering, decompilation, and/or disassembly of software provided in binary form under this license. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /src/fit_mesg_definition.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MESG_DEFINITION_HPP) 19 | #define FIT_MESG_DEFINITION_HPP 20 | 21 | #include 22 | #include 23 | #include "fit.hpp" 24 | #include "fit_field_definition.hpp" 25 | #include "fit_mesg.hpp" 26 | 27 | namespace fit 28 | { 29 | 30 | class MesgDefinition 31 | { 32 | public: 33 | MesgDefinition(); 34 | MesgDefinition(const Mesg& mesg); 35 | FIT_UINT16 GetNum() const; 36 | FIT_UINT8 GetLocalNum() const; 37 | void SetNum(const FIT_UINT16 newNum); 38 | void SetLocalNum(const FIT_UINT8 newLocalNum); 39 | void AddField(const FieldDefinition& fieldDef); 40 | void ClearFields(); 41 | int GetNumFields() const; 42 | std::vector& GetFields(); 43 | FieldDefinition* GetField(const FIT_UINT8 fieldNum); 44 | FieldDefinition* GetFieldByIndex(const FIT_UINT16 index); 45 | const std::vector& GetFields() const; 46 | const FieldDefinition* GetField(const FIT_UINT8 fieldNum) const; 47 | const FieldDefinition* GetFieldByIndex(const FIT_UINT16 index) const; 48 | FIT_BOOL operator==(const MesgDefinition& mesgDef) const; 49 | FIT_BOOL operator!=(const MesgDefinition& mesgDef) const; 50 | FIT_BOOL Supports(const Mesg& mesg) const; 51 | FIT_BOOL Supports(const MesgDefinition& mesgDef) const; 52 | int Write(std::ostream &file) const; 53 | 54 | private: 55 | FIT_UINT16 num; 56 | FIT_UINT8 localNum; 57 | std::vector fields; 58 | }; 59 | 60 | } // namespace fit 61 | 62 | #endif // defined(FIT_MESG_DEFINITION_HPP) 63 | -------------------------------------------------------------------------------- /src/fit_hrv_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HRV_MESG_HPP) 19 | #define FIT_HRV_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrvMesg : public Mesg 27 | { 28 | public: 29 | HrvMesg(void) : Mesg(Profile::MESG_HRV) 30 | { 31 | } 32 | 33 | HrvMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns number of time 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_UINT8 GetNumTime(void) const 41 | { 42 | return GetFieldNumValues(0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Returns time field 47 | // Units: s 48 | // Comment: Time between beats 49 | /////////////////////////////////////////////////////////////////////// 50 | FIT_FLOAT32 GetTime(FIT_UINT8 index) const 51 | { 52 | return GetFieldFLOAT32Value(0, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 53 | } 54 | 55 | /////////////////////////////////////////////////////////////////////// 56 | // Set time field 57 | // Units: s 58 | // Comment: Time between beats 59 | /////////////////////////////////////////////////////////////////////// 60 | void SetTime(FIT_UINT8 index, FIT_FLOAT32 time) 61 | { 62 | SetFieldFLOAT32Value(0, time, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 63 | } 64 | 65 | }; 66 | 67 | } // namespace fit 68 | 69 | #endif // !defined(FIT_HRV_MESG_HPP) 70 | -------------------------------------------------------------------------------- /src/fit_file_creator_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FILE_CREATOR_MESG_HPP) 19 | #define FIT_FILE_CREATOR_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FileCreatorMesg : public Mesg 27 | { 28 | public: 29 | FileCreatorMesg(void) : Mesg(Profile::MESG_FILE_CREATOR) 30 | { 31 | } 32 | 33 | FileCreatorMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns software_version field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_UINT16 GetSoftwareVersion(void) const 41 | { 42 | return GetFieldUINT16Value(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set software_version field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetSoftwareVersion(FIT_UINT16 softwareVersion) 49 | { 50 | SetFieldUINT16Value(0, softwareVersion, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns hardware_version field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_UINT8 GetHardwareVersion(void) const 57 | { 58 | return GetFieldUINT8Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set hardware_version field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetHardwareVersion(FIT_UINT8 hardwareVersion) 65 | { 66 | SetFieldUINT8Value(1, hardwareVersion, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | }; 70 | 71 | } // namespace fit 72 | 73 | #endif // !defined(FIT_FILE_CREATOR_MESG_HPP) 74 | -------------------------------------------------------------------------------- /src/fit_field_definition.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include 19 | #include "fit_field_definition.hpp" 20 | 21 | namespace fit 22 | { 23 | 24 | FieldDefinition::FieldDefinition() 25 | : num(FIT_FIELD_NUM_INVALID), size(0), type(FIT_UINT8_INVALID) 26 | { 27 | } 28 | 29 | FieldDefinition::FieldDefinition(const Field& field) 30 | : num(field.GetNum()), size(field.GetSize()), type(field.GetType()) 31 | { 32 | } 33 | 34 | FieldDefinition::FieldDefinition(const Field* field) 35 | { 36 | if (field != FIT_NULL) 37 | { 38 | num = field->GetNum(); 39 | size = field->GetSize(); 40 | type = field->GetType(); 41 | } 42 | else 43 | { 44 | num = FIT_FIELD_NUM_INVALID; 45 | size = 0; 46 | type = FIT_UINT8_INVALID; 47 | } 48 | } 49 | 50 | FIT_UINT8 FieldDefinition::GetNum() const 51 | { 52 | return num; 53 | } 54 | 55 | FIT_UINT8 FieldDefinition::GetSize() const 56 | { 57 | return size; 58 | } 59 | 60 | FIT_UINT8 FieldDefinition::GetType() const 61 | { 62 | return type; 63 | } 64 | 65 | void FieldDefinition::SetNum(const FIT_UINT8 newNum) 66 | { 67 | num = newNum; 68 | } 69 | 70 | void FieldDefinition::SetSize(const FIT_UINT8 newSize) 71 | { 72 | size = newSize; 73 | } 74 | 75 | void FieldDefinition::SetType(const FIT_UINT8 newType) 76 | { 77 | type = newType; 78 | } 79 | 80 | FIT_BOOL FieldDefinition::operator==(const FieldDefinition& field) const 81 | { 82 | if (num != field.num) 83 | return FIT_FALSE; 84 | 85 | if (size != field.size) 86 | return FIT_FALSE; 87 | 88 | if (type != field.type) 89 | return FIT_FALSE; 90 | 91 | return FIT_TRUE; 92 | } 93 | 94 | FIT_BOOL FieldDefinition::operator!=(const FieldDefinition& field) const 95 | { 96 | return !(*this==field); 97 | } 98 | 99 | FIT_UINT8 FieldDefinition::Write(std::ostream &file) const 100 | { 101 | file.put(num); 102 | file.put(size); 103 | file.put(type); 104 | 105 | return 3; 106 | } 107 | 108 | } // namespace fit 109 | -------------------------------------------------------------------------------- /src/fit_sport_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SPORT_MESG_HPP) 19 | #define FIT_SPORT_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SportMesg : public Mesg 27 | { 28 | public: 29 | SportMesg(void) : Mesg(Profile::MESG_SPORT) 30 | { 31 | } 32 | 33 | SportMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns sport field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_SPORT GetSport(void) const 41 | { 42 | return GetFieldENUMValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set sport field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetSport(FIT_SPORT sport) 49 | { 50 | SetFieldENUMValue(0, sport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns sub_sport field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_SUB_SPORT GetSubSport(void) const 57 | { 58 | return GetFieldENUMValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set sub_sport field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetSubSport(FIT_SUB_SPORT subSport) 65 | { 66 | SetFieldENUMValue(1, subSport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns name field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_WSTRING GetName(void) const 73 | { 74 | return GetFieldSTRINGValue(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set name field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetName(FIT_WSTRING name) 81 | { 82 | SetFieldSTRINGValue(3, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | }; 86 | 87 | } // namespace fit 88 | 89 | #endif // !defined(FIT_SPORT_MESG_HPP) 90 | -------------------------------------------------------------------------------- /src/fit_course_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_COURSE_MESG_HPP) 19 | #define FIT_COURSE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CourseMesg : public Mesg 27 | { 28 | public: 29 | CourseMesg(void) : Mesg(Profile::MESG_COURSE) 30 | { 31 | } 32 | 33 | CourseMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns sport field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_SPORT GetSport(void) const 41 | { 42 | return GetFieldENUMValue(4, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set sport field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetSport(FIT_SPORT sport) 49 | { 50 | SetFieldENUMValue(4, sport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns name field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_WSTRING GetName(void) const 57 | { 58 | return GetFieldSTRINGValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set name field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetName(FIT_WSTRING name) 65 | { 66 | SetFieldSTRINGValue(5, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns capabilities field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_COURSE_CAPABILITIES GetCapabilities(void) const 73 | { 74 | return GetFieldUINT32ZValue(6, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set capabilities field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetCapabilities(FIT_COURSE_CAPABILITIES capabilities) 81 | { 82 | SetFieldUINT32ZValue(6, capabilities, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | }; 86 | 87 | } // namespace fit 88 | 89 | #endif // !defined(FIT_COURSE_MESG_HPP) 90 | -------------------------------------------------------------------------------- /src/fit.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit.hpp" 19 | 20 | /////////////////////////////////////////////////////////////////////// 21 | // Private Definitions 22 | /////////////////////////////////////////////////////////////////////// 23 | 24 | namespace fit 25 | { 26 | 27 | /////////////////////////////////////////////////////////////////////// 28 | // Public Constants 29 | /////////////////////////////////////////////////////////////////////// 30 | 31 | const FIT_UINT8 baseTypeSizes[FIT_BASE_TYPES] = 32 | { 33 | sizeof(FIT_ENUM), 34 | sizeof(FIT_SINT8), 35 | sizeof(FIT_UINT8), 36 | sizeof(FIT_SINT16), 37 | sizeof(FIT_UINT16), 38 | sizeof(FIT_SINT32), 39 | sizeof(FIT_UINT32), 40 | sizeof(FIT_STRING), 41 | sizeof(FIT_FLOAT32), 42 | sizeof(FIT_FLOAT64), 43 | sizeof(FIT_UINT8Z), 44 | sizeof(FIT_UINT16Z), 45 | sizeof(FIT_UINT32Z), 46 | sizeof(FIT_BYTE), 47 | }; 48 | 49 | const FIT_ENUM enumInvalid = FIT_ENUM_INVALID; 50 | const FIT_SINT8 sint8Invalid = FIT_SINT8_INVALID; 51 | const FIT_UINT8 uint8Invalid = FIT_UINT8_INVALID; 52 | const FIT_SINT16 sint16Invalid = FIT_SINT16_INVALID; 53 | const FIT_UINT16 uint16Invalid = FIT_UINT16_INVALID; 54 | const FIT_SINT32 sint32Invalid = FIT_SINT32_INVALID; 55 | const FIT_UINT32 uint32Invalid = FIT_UINT32_INVALID; 56 | const FIT_STRING stringInvalid = FIT_STRING_INVALID; 57 | const FIT_FLOAT32 float32Invalid = FIT_FLOAT32_INVALID; 58 | const FIT_FLOAT64 float64Invalid = FIT_FLOAT64_INVALID; 59 | const FIT_UINT8Z uint8zInvalid = FIT_UINT8Z_INVALID; 60 | const FIT_UINT16Z uint16zInvalid = FIT_UINT16Z_INVALID; 61 | const FIT_UINT32Z uint32zInvalid = FIT_UINT32Z_INVALID; 62 | const FIT_BYTE byteInvalid = FIT_BYTE_INVALID; 63 | 64 | const FIT_UINT8 *baseTypeInvalids[FIT_BASE_TYPES] = 65 | { 66 | (FIT_UINT8 *)&enumInvalid, 67 | (FIT_UINT8 *)&sint8Invalid, 68 | (FIT_UINT8 *)&uint8Invalid, 69 | (FIT_UINT8 *)&sint16Invalid, 70 | (FIT_UINT8 *)&uint16Invalid, 71 | (FIT_UINT8 *)&sint32Invalid, 72 | (FIT_UINT8 *)&uint32Invalid, 73 | (FIT_UINT8 *)&stringInvalid, 74 | (FIT_UINT8 *)&float32Invalid, 75 | (FIT_UINT8 *)&float64Invalid, 76 | (FIT_UINT8 *)&uint8zInvalid, 77 | (FIT_UINT8 *)&uint16zInvalid, 78 | (FIT_UINT8 *)&uint32zInvalid, 79 | (FIT_UINT8 *)&byteInvalid, 80 | }; 81 | 82 | 83 | /////////////////////////////////////////////////////////////////////// 84 | // Public Functions 85 | /////////////////////////////////////////////////////////////////////// 86 | 87 | FIT_UINT8 GetArch(void) 88 | { 89 | const FIT_UINT16 arch = 0x0100; 90 | return (*(FIT_UINT8 *)&arch); 91 | } 92 | 93 | } // namespace fit 94 | 95 | -------------------------------------------------------------------------------- /src/fit_hr_zone_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HR_ZONE_MESG_HPP) 19 | #define FIT_HR_ZONE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrZoneMesg : public Mesg 27 | { 28 | public: 29 | HrZoneMesg(void) : Mesg(Profile::MESG_HR_ZONE) 30 | { 31 | } 32 | 33 | HrZoneMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns high_bpm field 55 | // Units: bpm 56 | /////////////////////////////////////////////////////////////////////// 57 | FIT_UINT8 GetHighBpm(void) const 58 | { 59 | return GetFieldUINT8Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 60 | } 61 | 62 | /////////////////////////////////////////////////////////////////////// 63 | // Set high_bpm field 64 | // Units: bpm 65 | /////////////////////////////////////////////////////////////////////// 66 | void SetHighBpm(FIT_UINT8 highBpm) 67 | { 68 | SetFieldUINT8Value(1, highBpm, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 69 | } 70 | 71 | /////////////////////////////////////////////////////////////////////// 72 | // Returns name field 73 | /////////////////////////////////////////////////////////////////////// 74 | FIT_WSTRING GetName(void) const 75 | { 76 | return GetFieldSTRINGValue(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 77 | } 78 | 79 | /////////////////////////////////////////////////////////////////////// 80 | // Set name field 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetName(FIT_WSTRING name) 83 | { 84 | SetFieldSTRINGValue(2, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | }; 88 | 89 | } // namespace fit 90 | 91 | #endif // !defined(FIT_HR_ZONE_MESG_HPP) 92 | -------------------------------------------------------------------------------- /src/fit_software_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SOFTWARE_MESG_HPP) 19 | #define FIT_SOFTWARE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SoftwareMesg : public Mesg 27 | { 28 | public: 29 | SoftwareMesg(void) : Mesg(Profile::MESG_SOFTWARE) 30 | { 31 | } 32 | 33 | SoftwareMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns version field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_FLOAT32 GetVersion(void) const 57 | { 58 | return GetFieldFLOAT32Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set version field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetVersion(FIT_FLOAT32 version) 65 | { 66 | SetFieldFLOAT32Value(3, version, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns part_number field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_WSTRING GetPartNumber(void) const 73 | { 74 | return GetFieldSTRINGValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set part_number field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetPartNumber(FIT_WSTRING partNumber) 81 | { 82 | SetFieldSTRINGValue(5, partNumber, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | }; 86 | 87 | } // namespace fit 88 | 89 | #endif // !defined(FIT_SOFTWARE_MESG_HPP) 90 | -------------------------------------------------------------------------------- /src/fit_power_zone_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_POWER_ZONE_MESG_HPP) 19 | #define FIT_POWER_ZONE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class PowerZoneMesg : public Mesg 27 | { 28 | public: 29 | PowerZoneMesg(void) : Mesg(Profile::MESG_POWER_ZONE) 30 | { 31 | } 32 | 33 | PowerZoneMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns high_value field 55 | // Units: watts 56 | /////////////////////////////////////////////////////////////////////// 57 | FIT_UINT16 GetHighValue(void) const 58 | { 59 | return GetFieldUINT16Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 60 | } 61 | 62 | /////////////////////////////////////////////////////////////////////// 63 | // Set high_value field 64 | // Units: watts 65 | /////////////////////////////////////////////////////////////////////// 66 | void SetHighValue(FIT_UINT16 highValue) 67 | { 68 | SetFieldUINT16Value(1, highValue, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 69 | } 70 | 71 | /////////////////////////////////////////////////////////////////////// 72 | // Returns name field 73 | /////////////////////////////////////////////////////////////////////// 74 | FIT_WSTRING GetName(void) const 75 | { 76 | return GetFieldSTRINGValue(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 77 | } 78 | 79 | /////////////////////////////////////////////////////////////////////// 80 | // Set name field 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetName(FIT_WSTRING name) 83 | { 84 | SetFieldSTRINGValue(2, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | }; 88 | 89 | } // namespace fit 90 | 91 | #endif // !defined(FIT_POWER_ZONE_MESG_HPP) 92 | -------------------------------------------------------------------------------- /src/fit_speed_zone_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SPEED_ZONE_MESG_HPP) 19 | #define FIT_SPEED_ZONE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SpeedZoneMesg : public Mesg 27 | { 28 | public: 29 | SpeedZoneMesg(void) : Mesg(Profile::MESG_SPEED_ZONE) 30 | { 31 | } 32 | 33 | SpeedZoneMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns high_value field 55 | // Units: m/s 56 | /////////////////////////////////////////////////////////////////////// 57 | FIT_FLOAT32 GetHighValue(void) const 58 | { 59 | return GetFieldFLOAT32Value(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 60 | } 61 | 62 | /////////////////////////////////////////////////////////////////////// 63 | // Set high_value field 64 | // Units: m/s 65 | /////////////////////////////////////////////////////////////////////// 66 | void SetHighValue(FIT_FLOAT32 highValue) 67 | { 68 | SetFieldFLOAT32Value(0, highValue, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 69 | } 70 | 71 | /////////////////////////////////////////////////////////////////////// 72 | // Returns name field 73 | /////////////////////////////////////////////////////////////////////// 74 | FIT_WSTRING GetName(void) const 75 | { 76 | return GetFieldSTRINGValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 77 | } 78 | 79 | /////////////////////////////////////////////////////////////////////// 80 | // Set name field 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetName(FIT_WSTRING name) 83 | { 84 | SetFieldSTRINGValue(1, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | }; 88 | 89 | } // namespace fit 90 | 91 | #endif // !defined(FIT_SPEED_ZONE_MESG_HPP) 92 | -------------------------------------------------------------------------------- /src/fit_cadence_zone_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_CADENCE_ZONE_MESG_HPP) 19 | #define FIT_CADENCE_ZONE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CadenceZoneMesg : public Mesg 27 | { 28 | public: 29 | CadenceZoneMesg(void) : Mesg(Profile::MESG_CADENCE_ZONE) 30 | { 31 | } 32 | 33 | CadenceZoneMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns high_value field 55 | // Units: rpm 56 | /////////////////////////////////////////////////////////////////////// 57 | FIT_UINT8 GetHighValue(void) const 58 | { 59 | return GetFieldUINT8Value(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 60 | } 61 | 62 | /////////////////////////////////////////////////////////////////////// 63 | // Set high_value field 64 | // Units: rpm 65 | /////////////////////////////////////////////////////////////////////// 66 | void SetHighValue(FIT_UINT8 highValue) 67 | { 68 | SetFieldUINT8Value(0, highValue, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 69 | } 70 | 71 | /////////////////////////////////////////////////////////////////////// 72 | // Returns name field 73 | /////////////////////////////////////////////////////////////////////// 74 | FIT_WSTRING GetName(void) const 75 | { 76 | return GetFieldSTRINGValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 77 | } 78 | 79 | /////////////////////////////////////////////////////////////////////// 80 | // Set name field 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetName(FIT_WSTRING name) 83 | { 84 | SetFieldSTRINGValue(1, name, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | }; 88 | 89 | } // namespace fit 90 | 91 | #endif // !defined(FIT_CADENCE_ZONE_MESG_HPP) 92 | -------------------------------------------------------------------------------- /src/fit_encode.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include 19 | #include "fit_encode.hpp" 20 | #include "fit_crc.hpp" 21 | #include 22 | 23 | namespace fit 24 | { 25 | 26 | Encode::Encode(void) 27 | : dataSize(0) 28 | { 29 | } 30 | 31 | void Encode::Open(std::iostream &file) 32 | { 33 | this->file = &file; 34 | WriteFileHeader(); 35 | } 36 | 37 | void Encode::Write(const MesgDefinition& mesgDef) 38 | { 39 | if (!file) 40 | return; 41 | 42 | dataSize += mesgDef.Write(*file); 43 | lastMesgDefinition[mesgDef.GetLocalNum()] = mesgDef; 44 | } 45 | 46 | void Encode::Write(const Mesg& mesg) 47 | { 48 | MesgDefinition mesgDefinition(mesg); 49 | 50 | if (!file) 51 | return; 52 | 53 | if (!lastMesgDefinition[mesg.GetLocalNum()].Supports(mesgDefinition)) 54 | Write(mesgDefinition); 55 | 56 | dataSize += mesg.Write(*file, &(lastMesgDefinition[mesg.GetLocalNum()])); 57 | } 58 | 59 | void Encode::Write(const std::vector& mesgs) 60 | { 61 | for (std::vector::size_type i = 0; i < mesgs.size(); i++) 62 | Write(mesgs[i]); 63 | } 64 | 65 | FIT_BOOL Encode::Close(void) 66 | { 67 | FIT_UINT32 fileBytesLeft = FIT_FILE_HDR_SIZE + dataSize; 68 | int crc = 0; 69 | 70 | if (!file) 71 | return FIT_FALSE; 72 | 73 | WriteFileHeader(); 74 | 75 | file->seekg(0, std::ios::beg); 76 | 77 | while (fileBytesLeft > 0) 78 | { 79 | int byte = file->get(); 80 | 81 | if (file->eof()) 82 | return FIT_FALSE; // File smaller than expected. 83 | 84 | crc = CRC::Get16(crc, byte); 85 | fileBytesLeft--; 86 | } 87 | 88 | file->seekp(0, std::ios::end); 89 | file->put(crc & 0xFF); 90 | file->put(crc >> 8); 91 | 92 | return FIT_TRUE; 93 | } 94 | 95 | void Encode::OnMesg(Mesg &mesg) 96 | { 97 | Write(mesg); 98 | } 99 | 100 | void Encode::OnMesgDefinition(MesgDefinition& mesgDef) 101 | { 102 | Write(mesgDef); 103 | } 104 | 105 | void Encode::WriteFileHeader() 106 | { 107 | FIT_FILE_HDR file_header; 108 | 109 | if (!file) 110 | return; 111 | 112 | file_header.header_size = FIT_FILE_HDR_SIZE; 113 | file_header.profile_version = FIT_PROFILE_VERSION; 114 | file_header.protocol_version = FIT_PROTOCOL_VERSION; 115 | memcpy((FIT_UINT8 *)&file_header.data_type, ".FIT", 4); 116 | file_header.data_size = dataSize; 117 | file_header.crc = CRC::Calc16(&file_header, FIT_STRUCT_OFFSET(crc, FIT_FILE_HDR)); 118 | 119 | file->seekp(0, std::ios::beg); 120 | file->write((const char *)&file_header, FIT_FILE_HDR_SIZE); 121 | } 122 | 123 | } // namespace fit 124 | -------------------------------------------------------------------------------- /src/fit_slave_device_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_SLAVE_DEVICE_MESG_HPP) 19 | #define FIT_SLAVE_DEVICE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class SlaveDeviceMesg : public Mesg 27 | { 28 | public: 29 | SlaveDeviceMesg(void) : Mesg(Profile::MESG_SLAVE_DEVICE) 30 | { 31 | } 32 | 33 | SlaveDeviceMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns manufacturer field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MANUFACTURER GetManufacturer(void) const 41 | { 42 | return GetFieldUINT16Value(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set manufacturer field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetManufacturer(FIT_MANUFACTURER manufacturer) 49 | { 50 | SetFieldUINT16Value(0, manufacturer, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns product field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_UINT16 GetProduct(void) const 57 | { 58 | return GetFieldUINT16Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set product field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetProduct(FIT_UINT16 product) 65 | { 66 | SetFieldUINT16Value(1, product, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns garmin_product field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_GARMIN_PRODUCT GetGarminProduct(void) const 73 | { 74 | return GetFieldUINT16Value(1, 0, (FIT_UINT16) Profile::SLAVE_DEVICE_MESG_PRODUCT_FIELD_GARMIN_PRODUCT); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set garmin_product field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetGarminProduct(FIT_GARMIN_PRODUCT garminProduct) 81 | { 82 | SetFieldUINT16Value(1, garminProduct, 0, (FIT_UINT16) Profile::SLAVE_DEVICE_MESG_PRODUCT_FIELD_GARMIN_PRODUCT); 83 | } 84 | 85 | }; 86 | 87 | } // namespace fit 88 | 89 | #endif // !defined(FIT_SLAVE_DEVICE_MESG_HPP) 90 | -------------------------------------------------------------------------------- /src/fit_buffer_encode.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_buffer_encode.hpp" 19 | #include "fit_crc.hpp" 20 | #include 21 | 22 | namespace fit 23 | { 24 | 25 | BufferEncode::BufferEncode(void) 26 | { 27 | this->Open(); 28 | } 29 | 30 | void BufferEncode::Open() 31 | { 32 | stringWriter.str(std::string("")); 33 | stringWriter.clear(); 34 | dataSize = 0; 35 | 36 | for (int i = 0; i < FIT_MAX_LOCAL_MESGS; ++i) 37 | { 38 | lastMesgDefinition[i].SetNum(FIT_MESG_NUM_INVALID); 39 | lastMesgDefinition[i].SetLocalNum(i); 40 | lastMesgDefinition[i].ClearFields(); 41 | } 42 | } 43 | 44 | void BufferEncode::Write(const MesgDefinition& mesgDef) 45 | { 46 | dataSize += mesgDef.Write(stringWriter); 47 | lastMesgDefinition[mesgDef.GetLocalNum()] = mesgDef; 48 | } 49 | 50 | void BufferEncode::Write(const Mesg& mesg) 51 | { 52 | MesgDefinition mesgDefinition(mesg); 53 | 54 | if (!lastMesgDefinition[mesg.GetLocalNum()].Supports(mesgDefinition)) 55 | Write(mesgDefinition); 56 | 57 | dataSize += mesg.Write(stringWriter, &(lastMesgDefinition[mesg.GetLocalNum()])); 58 | } 59 | 60 | void BufferEncode::Write(const std::vector& mesgs) 61 | { 62 | for (std::vector::size_type i = 0; i < mesgs.size(); i++) 63 | Write(mesgs[i]); 64 | } 65 | 66 | std::string BufferEncode::Close(void) 67 | { 68 | FIT_FILE_HDR file_header; 69 | 70 | // Get the data. 71 | std::string dataString = stringWriter.str(); 72 | 73 | // Write the header. 74 | stringWriter.str(std::string("")); 75 | stringWriter.clear(); 76 | file_header.header_size = FIT_FILE_HDR_SIZE; 77 | file_header.profile_version = FIT_PROFILE_VERSION; 78 | file_header.protocol_version = FIT_PROTOCOL_VERSION; 79 | memcpy((FIT_UINT8 *)&file_header.data_type, ".FIT", 4); 80 | file_header.data_size = dataSize; 81 | file_header.crc = CRC::Calc16(&file_header, FIT_STRUCT_OFFSET(crc, FIT_FILE_HDR)); 82 | stringWriter.write((const char *)&file_header, FIT_FILE_HDR_SIZE); 83 | 84 | std::string headerString = stringWriter.str(); 85 | 86 | // Write the CRC. 87 | stringWriter.str(std::string("")); 88 | stringWriter.clear(); 89 | 90 | int crc = 0; 91 | 92 | for (std::string::size_type i = 0; i < headerString.size(); i++) 93 | crc = CRC::Get16(crc, (int) headerString[i]); 94 | 95 | for (std::string::size_type i = 0; i < dataString.size(); i++) 96 | crc = CRC::Get16(crc, (int) dataString[i]); 97 | 98 | stringWriter.put(crc & 0xFF); 99 | stringWriter.put(crc >> 8); 100 | 101 | std::string crcString = stringWriter.str(); 102 | 103 | // Discard the output stream and re-initialize. 104 | Open(); 105 | 106 | // Put the result together. 107 | return (headerString + dataString + crcString); 108 | } 109 | 110 | void BufferEncode::OnMesg(Mesg &mesg) 111 | { 112 | Write(mesg); 113 | } 114 | 115 | void BufferEncode::OnMesgDefinition(MesgDefinition& mesgDef) 116 | { 117 | Write(mesgDef); 118 | } 119 | 120 | } // namespace fit 121 | -------------------------------------------------------------------------------- /src/fit_workout_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_WORKOUT_MESG_HPP) 19 | #define FIT_WORKOUT_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class WorkoutMesg : public Mesg 27 | { 28 | public: 29 | WorkoutMesg(void) : Mesg(Profile::MESG_WORKOUT) 30 | { 31 | } 32 | 33 | WorkoutMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns sport field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_SPORT GetSport(void) const 41 | { 42 | return GetFieldENUMValue(4, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set sport field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetSport(FIT_SPORT sport) 49 | { 50 | SetFieldENUMValue(4, sport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns capabilities field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_WORKOUT_CAPABILITIES GetCapabilities(void) const 57 | { 58 | return GetFieldUINT32ZValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set capabilities field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetCapabilities(FIT_WORKOUT_CAPABILITIES capabilities) 65 | { 66 | SetFieldUINT32ZValue(5, capabilities, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns num_valid_steps field 71 | // Comment: number of valid steps 72 | /////////////////////////////////////////////////////////////////////// 73 | FIT_UINT16 GetNumValidSteps(void) const 74 | { 75 | return GetFieldUINT16Value(6, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 76 | } 77 | 78 | /////////////////////////////////////////////////////////////////////// 79 | // Set num_valid_steps field 80 | // Comment: number of valid steps 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetNumValidSteps(FIT_UINT16 numValidSteps) 83 | { 84 | SetFieldUINT16Value(6, numValidSteps, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | /////////////////////////////////////////////////////////////////////// 88 | // Returns wkt_name field 89 | /////////////////////////////////////////////////////////////////////// 90 | FIT_WSTRING GetWktName(void) const 91 | { 92 | return GetFieldSTRINGValue(8, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 93 | } 94 | 95 | /////////////////////////////////////////////////////////////////////// 96 | // Set wkt_name field 97 | /////////////////////////////////////////////////////////////////////// 98 | void SetWktName(FIT_WSTRING wktName) 99 | { 100 | SetFieldSTRINGValue(8, wktName, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 101 | } 102 | 103 | }; 104 | 105 | } // namespace fit 106 | 107 | #endif // !defined(FIT_WORKOUT_MESG_HPP) 108 | -------------------------------------------------------------------------------- /src/fit_met_zone_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MET_ZONE_MESG_HPP) 19 | #define FIT_MET_ZONE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MetZoneMesg : public Mesg 27 | { 28 | public: 29 | MetZoneMesg(void) : Mesg(Profile::MESG_MET_ZONE) 30 | { 31 | } 32 | 33 | MetZoneMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns high_bpm field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_UINT8 GetHighBpm(void) const 57 | { 58 | return GetFieldUINT8Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set high_bpm field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetHighBpm(FIT_UINT8 highBpm) 65 | { 66 | SetFieldUINT8Value(1, highBpm, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns calories field 71 | // Units: kcal / min 72 | /////////////////////////////////////////////////////////////////////// 73 | FIT_FLOAT32 GetCalories(void) const 74 | { 75 | return GetFieldFLOAT32Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 76 | } 77 | 78 | /////////////////////////////////////////////////////////////////////// 79 | // Set calories field 80 | // Units: kcal / min 81 | /////////////////////////////////////////////////////////////////////// 82 | void SetCalories(FIT_FLOAT32 calories) 83 | { 84 | SetFieldFLOAT32Value(2, calories, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 85 | } 86 | 87 | /////////////////////////////////////////////////////////////////////// 88 | // Returns fat_calories field 89 | // Units: kcal / min 90 | /////////////////////////////////////////////////////////////////////// 91 | FIT_FLOAT32 GetFatCalories(void) const 92 | { 93 | return GetFieldFLOAT32Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 94 | } 95 | 96 | /////////////////////////////////////////////////////////////////////// 97 | // Set fat_calories field 98 | // Units: kcal / min 99 | /////////////////////////////////////////////////////////////////////// 100 | void SetFatCalories(FIT_FLOAT32 fatCalories) 101 | { 102 | SetFieldFLOAT32Value(3, fatCalories, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 103 | } 104 | 105 | }; 106 | 107 | } // namespace fit 108 | 109 | #endif // !defined(FIT_MET_ZONE_MESG_HPP) 110 | -------------------------------------------------------------------------------- /src/fit_device_settings_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_DEVICE_SETTINGS_MESG_HPP) 19 | #define FIT_DEVICE_SETTINGS_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class DeviceSettingsMesg : public Mesg 27 | { 28 | public: 29 | DeviceSettingsMesg(void) : Mesg(Profile::MESG_DEVICE_SETTINGS) 30 | { 31 | } 32 | 33 | DeviceSettingsMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns active_time_zone field 39 | // Comment: Index into time zone arrays. 40 | /////////////////////////////////////////////////////////////////////// 41 | FIT_UINT8 GetActiveTimeZone(void) const 42 | { 43 | return GetFieldUINT8Value(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 44 | } 45 | 46 | /////////////////////////////////////////////////////////////////////// 47 | // Set active_time_zone field 48 | // Comment: Index into time zone arrays. 49 | /////////////////////////////////////////////////////////////////////// 50 | void SetActiveTimeZone(FIT_UINT8 activeTimeZone) 51 | { 52 | SetFieldUINT8Value(0, activeTimeZone, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 53 | } 54 | 55 | /////////////////////////////////////////////////////////////////////// 56 | // Returns utc_offset field 57 | // Comment: Offset from system time. Required to convert timestamp from system time to UTC. 58 | /////////////////////////////////////////////////////////////////////// 59 | FIT_UINT32 GetUtcOffset(void) const 60 | { 61 | return GetFieldUINT32Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 62 | } 63 | 64 | /////////////////////////////////////////////////////////////////////// 65 | // Set utc_offset field 66 | // Comment: Offset from system time. Required to convert timestamp from system time to UTC. 67 | /////////////////////////////////////////////////////////////////////// 68 | void SetUtcOffset(FIT_UINT32 utcOffset) 69 | { 70 | SetFieldUINT32Value(1, utcOffset, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 71 | } 72 | 73 | /////////////////////////////////////////////////////////////////////// 74 | // Returns number of time_zone_offset 75 | /////////////////////////////////////////////////////////////////////// 76 | FIT_UINT8 GetNumTimeZoneOffset(void) const 77 | { 78 | return GetFieldNumValues(5, FIT_SUBFIELD_INDEX_MAIN_FIELD); 79 | } 80 | 81 | /////////////////////////////////////////////////////////////////////// 82 | // Returns time_zone_offset field 83 | // Units: hr 84 | // Comment: timezone offset in 1/4 hour increments 85 | /////////////////////////////////////////////////////////////////////// 86 | FIT_FLOAT32 GetTimeZoneOffset(FIT_UINT8 index) const 87 | { 88 | return GetFieldFLOAT32Value(5, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 89 | } 90 | 91 | /////////////////////////////////////////////////////////////////////// 92 | // Set time_zone_offset field 93 | // Units: hr 94 | // Comment: timezone offset in 1/4 hour increments 95 | /////////////////////////////////////////////////////////////////////// 96 | void SetTimeZoneOffset(FIT_UINT8 index, FIT_FLOAT32 timeZoneOffset) 97 | { 98 | SetFieldFLOAT32Value(5, timeZoneOffset, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 99 | } 100 | 101 | }; 102 | 103 | } // namespace fit 104 | 105 | #endif // !defined(FIT_DEVICE_SETTINGS_MESG_HPP) 106 | -------------------------------------------------------------------------------- /src/fit_field_capabilities_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_FIELD_CAPABILITIES_MESG_HPP) 19 | #define FIT_FIELD_CAPABILITIES_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class FieldCapabilitiesMesg : public Mesg 27 | { 28 | public: 29 | FieldCapabilitiesMesg(void) : Mesg(Profile::MESG_FIELD_CAPABILITIES) 30 | { 31 | } 32 | 33 | FieldCapabilitiesMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns file field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_FILE GetFile(void) const 57 | { 58 | return GetFieldENUMValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set file field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetFile(FIT_FILE file) 65 | { 66 | SetFieldENUMValue(0, file, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns mesg_num field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_MESG_NUM GetMesgNum(void) const 73 | { 74 | return GetFieldUINT16Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set mesg_num field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetMesgNum(FIT_MESG_NUM mesgNum) 81 | { 82 | SetFieldUINT16Value(1, mesgNum, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | /////////////////////////////////////////////////////////////////////// 86 | // Returns field_num field 87 | /////////////////////////////////////////////////////////////////////// 88 | FIT_UINT8 GetFieldNum(void) const 89 | { 90 | return GetFieldUINT8Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 91 | } 92 | 93 | /////////////////////////////////////////////////////////////////////// 94 | // Set field_num field 95 | /////////////////////////////////////////////////////////////////////// 96 | void SetFieldNum(FIT_UINT8 fieldNum) 97 | { 98 | SetFieldUINT8Value(2, fieldNum, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 99 | } 100 | 101 | /////////////////////////////////////////////////////////////////////// 102 | // Returns count field 103 | /////////////////////////////////////////////////////////////////////// 104 | FIT_UINT16 GetCount(void) const 105 | { 106 | return GetFieldUINT16Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 107 | } 108 | 109 | /////////////////////////////////////////////////////////////////////// 110 | // Set count field 111 | /////////////////////////////////////////////////////////////////////// 112 | void SetCount(FIT_UINT16 count) 113 | { 114 | SetFieldUINT16Value(3, count, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 115 | } 116 | 117 | }; 118 | 119 | } // namespace fit 120 | 121 | #endif // !defined(FIT_FIELD_CAPABILITIES_MESG_HPP) 122 | -------------------------------------------------------------------------------- /src/fit_hrm_profile_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_HRM_PROFILE_MESG_HPP) 19 | #define FIT_HRM_PROFILE_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class HrmProfileMesg : public Mesg 27 | { 28 | public: 29 | HrmProfileMesg(void) : Mesg(Profile::MESG_HRM_PROFILE) 30 | { 31 | } 32 | 33 | HrmProfileMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns message_index field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 41 | { 42 | return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set message_index field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 49 | { 50 | SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns enabled field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_BOOL GetEnabled(void) const 57 | { 58 | return GetFieldENUMValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set enabled field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetEnabled(FIT_BOOL enabled) 65 | { 66 | SetFieldENUMValue(0, enabled, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns hrm_ant_id field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_UINT16Z GetHrmAntId(void) const 73 | { 74 | return GetFieldUINT16ZValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set hrm_ant_id field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetHrmAntId(FIT_UINT16Z hrmAntId) 81 | { 82 | SetFieldUINT16ZValue(1, hrmAntId, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | /////////////////////////////////////////////////////////////////////// 86 | // Returns log_hrv field 87 | /////////////////////////////////////////////////////////////////////// 88 | FIT_BOOL GetLogHrv(void) const 89 | { 90 | return GetFieldENUMValue(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 91 | } 92 | 93 | /////////////////////////////////////////////////////////////////////// 94 | // Set log_hrv field 95 | /////////////////////////////////////////////////////////////////////// 96 | void SetLogHrv(FIT_BOOL logHrv) 97 | { 98 | SetFieldENUMValue(2, logHrv, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 99 | } 100 | 101 | /////////////////////////////////////////////////////////////////////// 102 | // Returns hrm_ant_id_trans_type field 103 | /////////////////////////////////////////////////////////////////////// 104 | FIT_UINT8Z GetHrmAntIdTransType(void) const 105 | { 106 | return GetFieldUINT8ZValue(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 107 | } 108 | 109 | /////////////////////////////////////////////////////////////////////// 110 | // Set hrm_ant_id_trans_type field 111 | /////////////////////////////////////////////////////////////////////// 112 | void SetHrmAntIdTransType(FIT_UINT8Z hrmAntIdTransType) 113 | { 114 | SetFieldUINT8ZValue(3, hrmAntIdTransType, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 115 | } 116 | 117 | }; 118 | 119 | } // namespace fit 120 | 121 | #endif // !defined(FIT_HRM_PROFILE_MESG_HPP) 122 | -------------------------------------------------------------------------------- /src/fit_memo_glob_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_MEMO_GLOB_MESG_HPP) 19 | #define FIT_MEMO_GLOB_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class MemoGlobMesg : public Mesg 27 | { 28 | public: 29 | MemoGlobMesg(void) : Mesg(Profile::MESG_MEMO_GLOB) 30 | { 31 | } 32 | 33 | MemoGlobMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns part_index field 39 | // Comment: Sequence number of memo blocks 40 | /////////////////////////////////////////////////////////////////////// 41 | FIT_UINT32 GetPartIndex(void) const 42 | { 43 | return GetFieldUINT32Value(250, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 44 | } 45 | 46 | /////////////////////////////////////////////////////////////////////// 47 | // Set part_index field 48 | // Comment: Sequence number of memo blocks 49 | /////////////////////////////////////////////////////////////////////// 50 | void SetPartIndex(FIT_UINT32 partIndex) 51 | { 52 | SetFieldUINT32Value(250, partIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 53 | } 54 | 55 | /////////////////////////////////////////////////////////////////////// 56 | // Returns number of memo 57 | /////////////////////////////////////////////////////////////////////// 58 | FIT_UINT8 GetNumMemo(void) const 59 | { 60 | return GetFieldNumValues(0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 61 | } 62 | 63 | /////////////////////////////////////////////////////////////////////// 64 | // Returns memo field 65 | // Comment: Block of utf8 bytes 66 | /////////////////////////////////////////////////////////////////////// 67 | FIT_BYTE GetMemo(FIT_UINT8 index) const 68 | { 69 | return GetFieldBYTEValue(0, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 70 | } 71 | 72 | /////////////////////////////////////////////////////////////////////// 73 | // Set memo field 74 | // Comment: Block of utf8 bytes 75 | /////////////////////////////////////////////////////////////////////// 76 | void SetMemo(FIT_UINT8 index, FIT_BYTE memo) 77 | { 78 | SetFieldBYTEValue(0, memo, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 79 | } 80 | 81 | /////////////////////////////////////////////////////////////////////// 82 | // Returns message_number field 83 | // Comment: Allows relating glob to another mesg If used only required for first part of each memo_glob 84 | /////////////////////////////////////////////////////////////////////// 85 | FIT_UINT16 GetMessageNumber(void) const 86 | { 87 | return GetFieldUINT16Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 88 | } 89 | 90 | /////////////////////////////////////////////////////////////////////// 91 | // Set message_number field 92 | // Comment: Allows relating glob to another mesg If used only required for first part of each memo_glob 93 | /////////////////////////////////////////////////////////////////////// 94 | void SetMessageNumber(FIT_UINT16 messageNumber) 95 | { 96 | SetFieldUINT16Value(1, messageNumber, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 97 | } 98 | 99 | /////////////////////////////////////////////////////////////////////// 100 | // Returns message_index field 101 | // Comment: Index of external mesg 102 | /////////////////////////////////////////////////////////////////////// 103 | FIT_MESSAGE_INDEX GetMessageIndex(void) const 104 | { 105 | return GetFieldUINT16Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 106 | } 107 | 108 | /////////////////////////////////////////////////////////////////////// 109 | // Set message_index field 110 | // Comment: Index of external mesg 111 | /////////////////////////////////////////////////////////////////////// 112 | void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) 113 | { 114 | SetFieldUINT16Value(2, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 115 | } 116 | 117 | }; 118 | 119 | } // namespace fit 120 | 121 | #endif // !defined(FIT_MEMO_GLOB_MESG_HPP) 122 | -------------------------------------------------------------------------------- /src/fit_zones_target_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_ZONES_TARGET_MESG_HPP) 19 | #define FIT_ZONES_TARGET_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class ZonesTargetMesg : public Mesg 27 | { 28 | public: 29 | ZonesTargetMesg(void) : Mesg(Profile::MESG_ZONES_TARGET) 30 | { 31 | } 32 | 33 | ZonesTargetMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns max_heart_rate field 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_UINT8 GetMaxHeartRate(void) const 41 | { 42 | return GetFieldUINT8Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Set max_heart_rate field 47 | /////////////////////////////////////////////////////////////////////// 48 | void SetMaxHeartRate(FIT_UINT8 maxHeartRate) 49 | { 50 | SetFieldUINT8Value(1, maxHeartRate, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 51 | } 52 | 53 | /////////////////////////////////////////////////////////////////////// 54 | // Returns threshold_heart_rate field 55 | /////////////////////////////////////////////////////////////////////// 56 | FIT_UINT8 GetThresholdHeartRate(void) const 57 | { 58 | return GetFieldUINT8Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 59 | } 60 | 61 | /////////////////////////////////////////////////////////////////////// 62 | // Set threshold_heart_rate field 63 | /////////////////////////////////////////////////////////////////////// 64 | void SetThresholdHeartRate(FIT_UINT8 thresholdHeartRate) 65 | { 66 | SetFieldUINT8Value(2, thresholdHeartRate, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////// 70 | // Returns functional_threshold_power field 71 | /////////////////////////////////////////////////////////////////////// 72 | FIT_UINT16 GetFunctionalThresholdPower(void) const 73 | { 74 | return GetFieldUINT16Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 75 | } 76 | 77 | /////////////////////////////////////////////////////////////////////// 78 | // Set functional_threshold_power field 79 | /////////////////////////////////////////////////////////////////////// 80 | void SetFunctionalThresholdPower(FIT_UINT16 functionalThresholdPower) 81 | { 82 | SetFieldUINT16Value(3, functionalThresholdPower, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 83 | } 84 | 85 | /////////////////////////////////////////////////////////////////////// 86 | // Returns hr_calc_type field 87 | /////////////////////////////////////////////////////////////////////// 88 | FIT_HR_ZONE_CALC GetHrCalcType(void) const 89 | { 90 | return GetFieldENUMValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 91 | } 92 | 93 | /////////////////////////////////////////////////////////////////////// 94 | // Set hr_calc_type field 95 | /////////////////////////////////////////////////////////////////////// 96 | void SetHrCalcType(FIT_HR_ZONE_CALC hrCalcType) 97 | { 98 | SetFieldENUMValue(5, hrCalcType, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 99 | } 100 | 101 | /////////////////////////////////////////////////////////////////////// 102 | // Returns pwr_calc_type field 103 | /////////////////////////////////////////////////////////////////////// 104 | FIT_PWR_ZONE_CALC GetPwrCalcType(void) const 105 | { 106 | return GetFieldENUMValue(7, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 107 | } 108 | 109 | /////////////////////////////////////////////////////////////////////// 110 | // Set pwr_calc_type field 111 | /////////////////////////////////////////////////////////////////////// 112 | void SetPwrCalcType(FIT_PWR_ZONE_CALC pwrCalcType) 113 | { 114 | SetFieldENUMValue(7, pwrCalcType, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 115 | } 116 | 117 | }; 118 | 119 | } // namespace fit 120 | 121 | #endif // !defined(FIT_ZONES_TARGET_MESG_HPP) 122 | -------------------------------------------------------------------------------- /src/fit_capabilities_mesg.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #if !defined(FIT_CAPABILITIES_MESG_HPP) 19 | #define FIT_CAPABILITIES_MESG_HPP 20 | 21 | #include "fit_mesg.hpp" 22 | 23 | namespace fit 24 | { 25 | 26 | class CapabilitiesMesg : public Mesg 27 | { 28 | public: 29 | CapabilitiesMesg(void) : Mesg(Profile::MESG_CAPABILITIES) 30 | { 31 | } 32 | 33 | CapabilitiesMesg(const Mesg &mesg) : Mesg(mesg) 34 | { 35 | } 36 | 37 | /////////////////////////////////////////////////////////////////////// 38 | // Returns number of languages 39 | /////////////////////////////////////////////////////////////////////// 40 | FIT_UINT8 GetNumLanguages(void) const 41 | { 42 | return GetFieldNumValues(0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 43 | } 44 | 45 | /////////////////////////////////////////////////////////////////////// 46 | // Returns languages field 47 | // Comment: Use language_bits_x types where x is index of array. 48 | /////////////////////////////////////////////////////////////////////// 49 | FIT_UINT8Z GetLanguages(FIT_UINT8 index) const 50 | { 51 | return GetFieldUINT8ZValue(0, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 52 | } 53 | 54 | /////////////////////////////////////////////////////////////////////// 55 | // Set languages field 56 | // Comment: Use language_bits_x types where x is index of array. 57 | /////////////////////////////////////////////////////////////////////// 58 | void SetLanguages(FIT_UINT8 index, FIT_UINT8Z languages) 59 | { 60 | SetFieldUINT8ZValue(0, languages, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 61 | } 62 | 63 | /////////////////////////////////////////////////////////////////////// 64 | // Returns number of sports 65 | /////////////////////////////////////////////////////////////////////// 66 | FIT_UINT8 GetNumSports(void) const 67 | { 68 | return GetFieldNumValues(1, FIT_SUBFIELD_INDEX_MAIN_FIELD); 69 | } 70 | 71 | /////////////////////////////////////////////////////////////////////// 72 | // Returns sports field 73 | // Comment: Use sport_bits_x types where x is index of array. 74 | /////////////////////////////////////////////////////////////////////// 75 | FIT_SPORT_BITS_0 GetSports(FIT_UINT8 index) const 76 | { 77 | return GetFieldUINT8ZValue(1, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 78 | } 79 | 80 | /////////////////////////////////////////////////////////////////////// 81 | // Set sports field 82 | // Comment: Use sport_bits_x types where x is index of array. 83 | /////////////////////////////////////////////////////////////////////// 84 | void SetSports(FIT_UINT8 index, FIT_SPORT_BITS_0 sports) 85 | { 86 | SetFieldUINT8ZValue(1, sports, index, FIT_SUBFIELD_INDEX_MAIN_FIELD); 87 | } 88 | 89 | /////////////////////////////////////////////////////////////////////// 90 | // Returns workouts_supported field 91 | /////////////////////////////////////////////////////////////////////// 92 | FIT_WORKOUT_CAPABILITIES GetWorkoutsSupported(void) const 93 | { 94 | return GetFieldUINT32ZValue(21, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 95 | } 96 | 97 | /////////////////////////////////////////////////////////////////////// 98 | // Set workouts_supported field 99 | /////////////////////////////////////////////////////////////////////// 100 | void SetWorkoutsSupported(FIT_WORKOUT_CAPABILITIES workoutsSupported) 101 | { 102 | SetFieldUINT32ZValue(21, workoutsSupported, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 103 | } 104 | 105 | /////////////////////////////////////////////////////////////////////// 106 | // Returns connectivity_supported field 107 | /////////////////////////////////////////////////////////////////////// 108 | FIT_CONNECTIVITY_CAPABILITIES GetConnectivitySupported(void) const 109 | { 110 | return GetFieldUINT32ZValue(23, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 111 | } 112 | 113 | /////////////////////////////////////////////////////////////////////// 114 | // Set connectivity_supported field 115 | /////////////////////////////////////////////////////////////////////// 116 | void SetConnectivitySupported(FIT_CONNECTIVITY_CAPABILITIES connectivitySupported) 117 | { 118 | SetFieldUINT32ZValue(23, connectivitySupported, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); 119 | } 120 | 121 | }; 122 | 123 | } // namespace fit 124 | 125 | #endif // !defined(FIT_CAPABILITIES_MESG_HPP) 126 | -------------------------------------------------------------------------------- /src/fit_mesg_with_event_broadcaster.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include "fit_mesg_with_event_broadcaster.hpp" 19 | 20 | namespace fit 21 | { 22 | 23 | #define MAX_GROUPS 256 24 | #define DEFAULT_GROUP 255 25 | #define BEGIN_END_GROUP 254 26 | 27 | MesgWithEventBroadcaster::MesgWithEventBroadcaster(void) 28 | { 29 | for (int i = 0; i < MAX_GROUPS; i++) { 30 | startedEvents.push_back(std::list()); 31 | } 32 | } 33 | 34 | void MesgWithEventBroadcaster::AddListener(MesgWithEventListener& mesgObserver) 35 | { 36 | listeners.push_back(&mesgObserver); 37 | } 38 | 39 | void MesgWithEventBroadcaster::OnMesg(MesgWithEvent& mesg) 40 | { 41 | /* 42 | MesgWithEvent broadcastMesg(mesg); 43 | int group = DEFAULT_GROUP; 44 | 45 | if (broadcastMesg.GetEventGroup() != UINT8_INVALID) 46 | { 47 | group = broadcastMesg.GetEventGroup(); 48 | } 49 | 50 | if (broadcastMesg.GetEventType() == EVENT_TYPE_INVALID) 51 | return; // Invalid so ignore. 52 | 53 | // Convert depreciated events types for backwards compatibility. 54 | switch (broadcastMesg.GetEventType()) 55 | { 56 | case EVENT_TYPE_BEGIN_DEPRECIATED: 57 | group = BEGIN_END_GROUP; 58 | broadcastMesg.SetEventType(EVENT_TYPE_START); 59 | break; 60 | 61 | case EVENT_TYPE_END_DEPRECIATED: 62 | group = BEGIN_END_GROUP; 63 | broadcastMesg.SetEventType(EVENT_TYPE_STOP); 64 | break; 65 | 66 | case EVENT_TYPE_CONSECUTIVE_DEPRECIATED: 67 | broadcastMesg.SetEventType(EVENT_TYPE_STOP); 68 | break; 69 | 70 | case EVENT_TYPE_END_ALL_DEPRECIATED: 71 | group = BEGIN_END_GROUP; 72 | broadcastMesg.SetEventType(EVENT_TYPE_STOP_ALL); 73 | break; 74 | 75 | default: 76 | break; 77 | } 78 | 79 | switch (broadcastMesg.GetEventType()) 80 | { 81 | case EVENT_TYPE_START: 82 | for (list::iterator it = startedEvents.begin(); it < startedEvents[group].end(); it++) 83 | { 84 | if (startedEvents[group][i].GetEvent() == broadcastMesg.GetEvent()) 85 | { 86 | MesgWithEvent stopEvent(startedEvents[group].[i]); 87 | stopEvent.SetEventType(EVENT_TYPE_STOP); 88 | stopEvent.SetTimestamp(broadcastMesg.GetTimestamp()); 89 | Broadcast(stopEvent); 90 | startedEvents[group].remove(stopEvent); 91 | } 92 | } 93 | 94 | startedEvents[group].add(broadcastMesg); 95 | break; 96 | 97 | case EVENT_TYPE_STOP: 98 | case EVENT_TYPE_STOP_DISABLE: 99 | for (int i = 0; i < startedEvents.get(group).size(); i++) { 100 | if (startedEvents.get(group).get(i).getEvent() == broadcastMesg.getEvent()) { 101 | startedEvents.get(group).remove(i); 102 | } 103 | } 104 | break; 105 | 106 | case EVENT_TYPE_STOP_ALL: 107 | for (int i = 0; i < (int)startedEvents[group].size(); i++) { 108 | if (startedEvents.get(group).get(i).getEvent() != broadcastMesg.getEvent()) { 109 | MesgWithEvent stopEvent = (MesgWithEvent)Factory.createMesg((Mesg)startedEvents.get(group).get(i)); 110 | stopEvent.setEventType(EventType.STOP); 111 | stopEvent.setTimestamp(broadcastMesg.getTimestamp()); 112 | broadcast(stopEvent); 113 | } 114 | } 115 | 116 | startedEvents.get(group).clear(); 117 | broadcastMesg.setEventType(EventType.STOP); 118 | break; 119 | 120 | case EVENT_TYPE_STOP_DISABLE_ALL: 121 | for (int i = 0; i < startedEvents.get(group).size(); i++) { 122 | if (startedEvents.get(group).get(i).getEvent() != broadcastMesg.getEvent()) { 123 | MesgWithEvent stopEvent = (MesgWithEvent)Factory.createMesg((Mesg)startedEvents.get(group).get(i)); 124 | stopEvent.setEventType(EVENT_TYPE_STOP_DISABLE); 125 | stopEvent.setTimestamp(broadcastMesg.getTimestamp()); 126 | broadcast(stopEvent); 127 | } 128 | } 129 | 130 | startedEvents.get(group).clear(); 131 | broadcastMesg.SetEventType(EVENT_TYPE_STOP_DISABLE); 132 | break; 133 | 134 | case EVENT_TYPE_MARKER: 135 | default: 136 | break; 137 | } 138 | 139 | Broadcast(broadcastMesg); 140 | 141 | */ 142 | } 143 | 144 | void MesgWithEventBroadcaster::Broadcast(MesgWithEvent& mesg) 145 | { 146 | for (int i = 0; i < (int)listeners.size(); i++) 147 | { 148 | listeners[i]->OnMesg(mesg); 149 | } 150 | } 151 | 152 | 153 | } // namespace fit 154 | -------------------------------------------------------------------------------- /src/fit_mesg_definition.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // The following FIT Protocol software provided may be used with FIT protocol 3 | // devices only and remains the copyrighted property of Dynastream Innovations Inc. 4 | // The software is being provided on an "as-is" basis and as an accommodation, 5 | // and therefore all warranties, representations, or guarantees of any kind 6 | // (whether express, implied or statutory) including, without limitation, 7 | // warranties of merchantability, non-infringement, or fitness for a particular 8 | // purpose, are specifically disclaimed. 9 | // 10 | // Copyright 2014 Dynastream Innovations Inc. 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // ****WARNING**** This file is auto-generated! Do NOT edit this file. 13 | // Profile Version = 12.20Release 14 | // Tag = $Name$ 15 | //////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | #include 19 | #include "fit_mesg_definition.hpp" 20 | 21 | namespace fit 22 | { 23 | 24 | MesgDefinition::MesgDefinition(void) 25 | : num(FIT_MESG_NUM_INVALID), localNum(0), fields() 26 | { 27 | } 28 | 29 | MesgDefinition::MesgDefinition(const Mesg& mesg) 30 | : num(mesg.GetNum()), localNum(mesg.GetLocalNum()) 31 | { 32 | for (int i=0; i& MesgDefinition::GetFields() 72 | { 73 | return fields; 74 | } 75 | 76 | FieldDefinition* MesgDefinition::GetField(const FIT_UINT8 fieldNum) 77 | { 78 | for (int i=0; i<(int)fields.size(); i++) 79 | { 80 | if (fieldNum == fields[i].GetNum()) 81 | return &(fields[i]); 82 | } 83 | 84 | return FIT_NULL; 85 | } 86 | 87 | FieldDefinition* MesgDefinition::GetFieldByIndex(const FIT_UINT16 index) 88 | { 89 | if (index < fields.size()) 90 | return &(fields[index]); 91 | 92 | return FIT_NULL; 93 | } 94 | 95 | const std::vector& MesgDefinition::GetFields() const 96 | { 97 | return fields; 98 | } 99 | 100 | const FieldDefinition* MesgDefinition::GetField(const FIT_UINT8 fieldNum) const 101 | { 102 | for (int i=0; i<(int)fields.size(); i++) 103 | { 104 | if (fieldNum == fields[i].GetNum()) 105 | return &(fields[i]); 106 | } 107 | 108 | return FIT_NULL; 109 | } 110 | 111 | const FieldDefinition* MesgDefinition::GetFieldByIndex(const FIT_UINT16 index) const 112 | { 113 | if (index < fields.size()) 114 | return &(fields[index]); 115 | 116 | return FIT_NULL; 117 | } 118 | 119 | FIT_BOOL MesgDefinition::operator==(const MesgDefinition& mesgDef) const 120 | { 121 | if (num != mesgDef.num) 122 | return FIT_FALSE; 123 | 124 | if (localNum != mesgDef.localNum) 125 | return FIT_FALSE; 126 | 127 | if (fields.size() != mesgDef.fields.size()) 128 | return FIT_FALSE; 129 | 130 | for (int i=0; i<(int)fields.size(); i++) 131 | { 132 | if (fields[i] != mesgDef.fields[i]) 133 | return FIT_FALSE; 134 | } 135 | 136 | return FIT_TRUE; 137 | } 138 | 139 | FIT_BOOL MesgDefinition::operator!=(const MesgDefinition& mesgDef) const 140 | { 141 | return !(*this == mesgDef); 142 | } 143 | 144 | FIT_BOOL MesgDefinition::Supports(const Mesg& mesg) const 145 | { 146 | return Supports(MesgDefinition(mesg)); 147 | } 148 | 149 | FIT_BOOL MesgDefinition::Supports(const MesgDefinition& mesgDef) const 150 | { 151 | if (num != mesgDef.num) 152 | return FIT_FALSE; 153 | 154 | if (localNum != mesgDef.localNum) 155 | return FIT_FALSE; 156 | 157 | for (int i=0; i<(int)mesgDef.fields.size(); i++) 158 | { 159 | const FieldDefinition* supportedFieldDef = GetField(mesgDef.fields[i].GetNum()); 160 | 161 | if (supportedFieldDef == FIT_NULL) // Could not find field with matching number. 162 | return FIT_FALSE; 163 | 164 | if (mesgDef.fields[i].GetSize() > supportedFieldDef->GetSize()) // Other field definition is larger than this field definition. 165 | return FIT_FALSE; 166 | } 167 | 168 | return FIT_TRUE; 169 | } 170 | 171 | int MesgDefinition::Write(std::ostream &file) const 172 | { 173 | int mesgSize = 6; 174 | 175 | file.put((FIT_HDR_TYPE_DEF_BIT) | (localNum & FIT_HDR_TYPE_MASK)); // Message definition record header with local message number. 176 | file.put(0); // Reserved 177 | file.put(GetArch()); 178 | if (GetArch()) 179 | { // Big Endian 180 | file.put((FIT_UINT8)(num >> 8)); 181 | file.put((FIT_UINT8)num); 182 | } 183 | else 184 | { 185 | file.put((FIT_UINT8)num); 186 | file.put((FIT_UINT8)(num >> 8)); 187 | } 188 | file.put((FIT_UINT8)fields.size()); 189 | 190 | for (FIT_UINT8 i=0; i