-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
254 changed files
with
58,868 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// swift-tools-version:5.3 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Copyright 2022 Garmin International, Inc. | ||
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you | ||
// may not use this file except in compliance with the Flexible and Interoperable Data | ||
// Transfer (FIT) Protocol License. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "FIT", | ||
platforms: [ | ||
.iOS(.v13), | ||
.macOS(.v10_15), | ||
.tvOS(.v13), | ||
.watchOS(.v6), | ||
], | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "FIT", | ||
targets: ["SwiftFIT","ObjcFIT"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
.target( | ||
name: "cppfit", | ||
dependencies: [], | ||
resources: [ | ||
.copy("include")], | ||
cSettings: [ | ||
.headerSearchPath("./include/")]), | ||
.target( | ||
name: "ObjcFIT", | ||
dependencies: ["cppfit"], | ||
cSettings: [ | ||
.headerSearchPath("../cppfit/include")]), | ||
.target( | ||
name: "SwiftFIT", | ||
dependencies: ["ObjcFIT"]), | ||
.testTarget( | ||
name: "FITTests", | ||
dependencies: ["SwiftFIT"]), | ||
], | ||
cxxLanguageStandard: .gnucxx11 | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,282 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Copyright 2022 Garmin International, Inc. | ||
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you | ||
// may not use this file except in compliance with the Flexible and Interoperable Data | ||
// Transfer (FIT) Protocol License. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// ****WARNING**** This file is auto-generated! Do NOT edit this file. | ||
// Profile Version = 21.94Release | ||
// Tag = production/akw/21.94.00-0-g0f668193 | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
#import "FITMessage+Internal.h" | ||
|
||
|
||
#import "FITAccelerometerDataMesg.h" | ||
|
||
@implementation FITAccelerometerDataMesg | ||
|
||
- (instancetype)init { | ||
self = [super initWithFitMesgIndex:fit::Profile::MESG_ACCELEROMETER_DATA]; | ||
|
||
return self; | ||
} | ||
|
||
// Timestamp | ||
- (BOOL)isTimestampValid { | ||
const fit::Field* field = [super getField:253]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid() == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITDate *)getTimestamp { | ||
return FITDateFromTimestamp([super getFieldUINT32ValueForField:253 forIndex:0 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setTimestamp:(FITDate *)timestamp { | ||
[super setFieldUINT32ValueForField:253 andValue:TimestampFromFITDate(timestamp) forIndex:0 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// TimestampMs | ||
- (BOOL)isTimestampMsValid { | ||
const fit::Field* field = [super getField:0]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid() == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITUInt16)getTimestampMs { | ||
return ([super getFieldUINT16ValueForField:0 forIndex:0 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setTimestampMs:(FITUInt16)timestampMs { | ||
[super setFieldUINT16ValueForField:0 andValue:(timestampMs) forIndex:0 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// SampleTimeOffset | ||
- (uint8_t)numSampleTimeOffsetValues { | ||
return [super getFieldNumValuesForField:1 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isSampleTimeOffsetValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:1]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITUInt16)getSampleTimeOffsetforIndex:(uint8_t)index { | ||
return ([super getFieldUINT16ValueForField:1 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setSampleTimeOffset:(FITUInt16)sampleTimeOffset forIndex:(uint8_t)index { | ||
[super setFieldUINT16ValueForField:1 andValue:(sampleTimeOffset) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// AccelX | ||
- (uint8_t)numAccelXValues { | ||
return [super getFieldNumValuesForField:2 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isAccelXValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:2]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITUInt16)getAccelXforIndex:(uint8_t)index { | ||
return ([super getFieldUINT16ValueForField:2 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setAccelX:(FITUInt16)accelX forIndex:(uint8_t)index { | ||
[super setFieldUINT16ValueForField:2 andValue:(accelX) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// AccelY | ||
- (uint8_t)numAccelYValues { | ||
return [super getFieldNumValuesForField:3 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isAccelYValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:3]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITUInt16)getAccelYforIndex:(uint8_t)index { | ||
return ([super getFieldUINT16ValueForField:3 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setAccelY:(FITUInt16)accelY forIndex:(uint8_t)index { | ||
[super setFieldUINT16ValueForField:3 andValue:(accelY) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// AccelZ | ||
- (uint8_t)numAccelZValues { | ||
return [super getFieldNumValuesForField:4 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isAccelZValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:4]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITUInt16)getAccelZforIndex:(uint8_t)index { | ||
return ([super getFieldUINT16ValueForField:4 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setAccelZ:(FITUInt16)accelZ forIndex:(uint8_t)index { | ||
[super setFieldUINT16ValueForField:4 andValue:(accelZ) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CalibratedAccelX | ||
- (uint8_t)numCalibratedAccelXValues { | ||
return [super getFieldNumValuesForField:5 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCalibratedAccelXValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:5]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITFloat32)getCalibratedAccelXforIndex:(uint8_t)index { | ||
return ([super getFieldFLOAT32ValueForField:5 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCalibratedAccelX:(FITFloat32)calibratedAccelX forIndex:(uint8_t)index { | ||
[super setFieldFLOAT32ValueForField:5 andValue:(calibratedAccelX) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CalibratedAccelY | ||
- (uint8_t)numCalibratedAccelYValues { | ||
return [super getFieldNumValuesForField:6 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCalibratedAccelYValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:6]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITFloat32)getCalibratedAccelYforIndex:(uint8_t)index { | ||
return ([super getFieldFLOAT32ValueForField:6 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCalibratedAccelY:(FITFloat32)calibratedAccelY forIndex:(uint8_t)index { | ||
[super setFieldFLOAT32ValueForField:6 andValue:(calibratedAccelY) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CalibratedAccelZ | ||
- (uint8_t)numCalibratedAccelZValues { | ||
return [super getFieldNumValuesForField:7 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCalibratedAccelZValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:7]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITFloat32)getCalibratedAccelZforIndex:(uint8_t)index { | ||
return ([super getFieldFLOAT32ValueForField:7 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCalibratedAccelZ:(FITFloat32)calibratedAccelZ forIndex:(uint8_t)index { | ||
[super setFieldFLOAT32ValueForField:7 andValue:(calibratedAccelZ) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CompressedCalibratedAccelX | ||
- (uint8_t)numCompressedCalibratedAccelXValues { | ||
return [super getFieldNumValuesForField:8 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCompressedCalibratedAccelXValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:8]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITSInt16)getCompressedCalibratedAccelXforIndex:(uint8_t)index { | ||
return ([super getFieldSINT16ValueForField:8 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCompressedCalibratedAccelX:(FITSInt16)compressedCalibratedAccelX forIndex:(uint8_t)index { | ||
[super setFieldSINT16ValueForField:8 andValue:(compressedCalibratedAccelX) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CompressedCalibratedAccelY | ||
- (uint8_t)numCompressedCalibratedAccelYValues { | ||
return [super getFieldNumValuesForField:9 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCompressedCalibratedAccelYValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:9]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITSInt16)getCompressedCalibratedAccelYforIndex:(uint8_t)index { | ||
return ([super getFieldSINT16ValueForField:9 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCompressedCalibratedAccelY:(FITSInt16)compressedCalibratedAccelY forIndex:(uint8_t)index { | ||
[super setFieldSINT16ValueForField:9 andValue:(compressedCalibratedAccelY) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
// CompressedCalibratedAccelZ | ||
- (uint8_t)numCompressedCalibratedAccelZValues { | ||
return [super getFieldNumValuesForField:10 andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
- (BOOL)isCompressedCalibratedAccelZValidforIndex:(uint8_t)index { | ||
const fit::Field* field = [super getField:10]; | ||
if( FIT_NULL == field ) { | ||
return FALSE; | ||
} | ||
|
||
return field->IsValueValid(index) == FIT_TRUE ? TRUE : FALSE; | ||
} | ||
|
||
- (FITSInt16)getCompressedCalibratedAccelZforIndex:(uint8_t)index { | ||
return ([super getFieldSINT16ValueForField:10 forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]); | ||
} | ||
|
||
- (void)setCompressedCalibratedAccelZ:(FITSInt16)compressedCalibratedAccelZ forIndex:(uint8_t)index { | ||
[super setFieldSINT16ValueForField:10 andValue:(compressedCalibratedAccelZ) forIndex:index andSubFieldIndex:FIT_SUBFIELD_INDEX_MAIN_FIELD]; | ||
} | ||
|
||
@end |
Oops, something went wrong.