Skip to content

Commit

Permalink
Upgraded to fit sdk version 21.94
Browse files Browse the repository at this point in the history
  • Loading branch information
roznet committed Jan 15, 2023
1 parent 639146f commit a508053
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 37 deletions.
77 changes: 59 additions & 18 deletions Sources/FitFileParser/rzfit_swift_map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import FitFileParserObjc

extension FitFile {
public static let sdkVersion = "21.89"
public static let sdkVersion = "21.94"
}

//MARK: - Module Entry Point Functions
Expand Down Expand Up @@ -2690,6 +2690,8 @@ fileprivate func rzfit_swift_string_from_manufacturer(_ input : FIT_UINT16) -> S
case 317: return "race_republic"
case 318: return "fazua"
case 319: return "oreka_training"
case 320: return "isec"
case 321: return "lululemon_studio"
case 5759: return "actigraphcorp"
default: return "manufacturer_\(input)"
}
Expand Down Expand Up @@ -2905,6 +2907,7 @@ fileprivate func rzfit_swift_string_from_garmin_product(_ input : FIT_UINT16) ->
case 2769: return "foretrex_601_701"
case 2772: return "vivo_move_hr"
case 2713: return "edge_1030"
case 2727: return "fr35_sea"
case 2787: return "vector_3"
case 2796: return "fenix5_asia"
case 2797: return "fenix5s_asia"
Expand Down Expand Up @@ -3031,6 +3034,7 @@ fileprivate func rzfit_swift_string_from_garmin_product(_ input : FIT_UINT16) ->
case 3823: return "approach_s12"
case 3872: return "enduro_asia"
case 3837: return "venusq_asia"
case 3843: return "edge_1040"
case 3850: return "marq_golfer_asia"
case 3851: return "venu2_plus"
case 3869: return "fr55"
Expand All @@ -3049,6 +3053,7 @@ fileprivate func rzfit_swift_string_from_garmin_product(_ input : FIT_UINT16) ->
case 3949: return "venu2s_asia"
case 3950: return "venu2_asia"
case 3978: return "fr945_lte_asia"
case 3982: return "vivo_move_sport"
case 3986: return "approach_S12_asia"
case 3990: return "fr255_music"
case 3991: return "fr255_small_music"
Expand All @@ -3062,9 +3067,12 @@ fileprivate func rzfit_swift_string_from_garmin_product(_ input : FIT_UINT16) ->
case 4033: return "fr55_asia"
case 4063: return "vivosmart_5"
case 4071: return "instinct_2_asia"
case 4115: return "venusq2"
case 4116: return "venusq2music"
case 4125: return "d2_air_x10"
case 4130: return "hrm_pro_plus"
case 4132: return "descent_g1_asia"
case 4135: return "tactix7"
case 4169: return "edge_explore2"
case 4265: return "tacx_neo_smart"
case 4266: return "tacx_neo2_smart"
Expand All @@ -3078,7 +3086,8 @@ fileprivate func rzfit_swift_string_from_garmin_product(_ input : FIT_UINT16) ->
case 4274: return "tacx_flux_flux_s_smart"
case 4275: return "tacx_flux2_smart"
case 4276: return "tacx_magnum"
case 4135: return "tactix7"
case 4305: return "edge_1040_asia"
case 4341: return "enduro2"
case 10007: return "sdm4"
case 10014: return "edge_remote"
case 20533: return "tacx_training_app_win"
Expand Down Expand Up @@ -3216,6 +3225,11 @@ fileprivate func rzfit_swift_string_from_workout_hr(_ input : FIT_UINT32) -> Str
}
}

fileprivate func rzfit_swift_value_from_workout_hr(_ input : FIT_UINT32) -> Double
{
let offset : Double = 100
return Double( input ) - offset
}
fileprivate func rzfit_swift_string_from_workout_power(_ input : FIT_UINT32) -> String
{
switch input {
Expand All @@ -3224,6 +3238,11 @@ fileprivate func rzfit_swift_string_from_workout_power(_ input : FIT_UINT32) ->
}
}

fileprivate func rzfit_swift_value_from_workout_power(_ input : FIT_UINT32) -> Double
{
let offset : Double = 1000
return Double( input ) - offset
}
fileprivate func rzfit_swift_string_from_bp_status(_ input : FIT_ENUM) -> String
{
switch input {
Expand Down Expand Up @@ -11416,6 +11435,10 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
}else if x.duration_type == 1 { // distance
let val : Double = Double(x.duration_value)
rv[ "duration_distance" ] = val
}else if x.duration_type == 2 { // hr_less_than
rv[ "duration_hr" ] = rzfit_swift_value_from_workout_hr(x.duration_value)
}else if x.duration_type == 3 { // hr_greater_than
rv[ "duration_hr" ] = rzfit_swift_value_from_workout_hr(x.duration_value)
}else if x.duration_type == 4 { // calories
let val : Double = Double(x.duration_value)
rv[ "duration_calories" ] = val
Expand Down Expand Up @@ -11443,13 +11466,14 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
}else if x.duration_type == 13 { // repeat_until_power_greater_than
let val : Double = Double(x.duration_value)
rv[ "duration_step" ] = val
}else if x.duration_type == 14 { // power_less_than
rv[ "duration_power" ] = rzfit_swift_value_from_workout_power(x.duration_value)
}else if x.duration_type == 15 { // power_greater_than
rv[ "duration_power" ] = rzfit_swift_value_from_workout_power(x.duration_value)
}else if x.duration_type == 29 { // reps
let val : Double = Double(x.duration_value)
rv[ "duration_reps" ] = val
}else if x.duration_type != 2 /* hr_less_than */ &&
x.duration_type != 3 /* hr_greater_than */ &&
x.duration_type != 14 /* power_less_than */ &&
x.duration_type != 15 /* power_greater_than */ {
}else{
let val : Double = Double(x.duration_value)
rv[ "duration_value" ] = val
}
Expand Down Expand Up @@ -11479,10 +11503,15 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
}else if x.duration_type == 9 { // repeat_until_calories
let val : Double = Double(x.target_value)
rv[ "repeat_calories" ] = val
}else if x.duration_type != 10 /* repeat_until_hr_less_than */ &&
x.duration_type != 11 /* repeat_until_hr_greater_than */ &&
x.duration_type != 12 /* repeat_until_power_less_than */ &&
x.duration_type != 13 /* repeat_until_power_greater_than */ &&
}else if x.duration_type == 10 { // repeat_until_hr_less_than
rv[ "repeat_hr" ] = rzfit_swift_value_from_workout_hr(x.target_value)
}else if x.duration_type == 11 { // repeat_until_hr_greater_than
rv[ "repeat_hr" ] = rzfit_swift_value_from_workout_hr(x.target_value)
}else if x.duration_type == 12 { // repeat_until_power_less_than
rv[ "repeat_power" ] = rzfit_swift_value_from_workout_power(x.target_value)
}else if x.duration_type == 13 { // repeat_until_power_greater_than
rv[ "repeat_power" ] = rzfit_swift_value_from_workout_power(x.target_value)
}else if x.target_type != 11 /* swim_stroke */ &&
x.target_type != 11 /* swim_stroke */ {
let val : Double = Double(x.target_value)
rv[ "target_value" ] = val
Expand All @@ -11492,11 +11521,14 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
if x.target_type == 0 { // speed
let val : Double = Double(x.custom_target_value_low)
rv[ "custom_target_speed_low" ] = val
}else if x.target_type == 1 { // heart_rate
rv[ "custom_target_heart_rate_low" ] = rzfit_swift_value_from_workout_hr(x.custom_target_value_low)
}else if x.target_type == 3 { // cadence
let val : Double = Double(x.custom_target_value_low)
rv[ "custom_target_cadence_low" ] = val
}else if x.target_type != 1 /* heart_rate */ &&
x.target_type != 4 /* power */ {
}else if x.target_type == 4 { // power
rv[ "custom_target_power_low" ] = rzfit_swift_value_from_workout_power(x.custom_target_value_low)
}else{
let val : Double = Double(x.custom_target_value_low)
rv[ "custom_target_value_low" ] = val
}
Expand All @@ -11505,11 +11537,14 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
if x.target_type == 0 { // speed
let val : Double = Double(x.custom_target_value_high)
rv[ "custom_target_speed_high" ] = val
}else if x.target_type == 1 { // heart_rate
rv[ "custom_target_heart_rate_high" ] = rzfit_swift_value_from_workout_hr(x.custom_target_value_high)
}else if x.target_type == 3 { // cadence
let val : Double = Double(x.custom_target_value_high)
rv[ "custom_target_cadence_high" ] = val
}else if x.target_type != 1 /* heart_rate */ &&
x.target_type != 4 /* power */ {
}else if x.target_type == 4 { // power
rv[ "custom_target_power_high" ] = rzfit_swift_value_from_workout_power(x.custom_target_value_high)
}else{
let val : Double = Double(x.custom_target_value_high)
rv[ "custom_target_value_high" ] = val
}
Expand Down Expand Up @@ -11537,11 +11572,14 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
if x.secondary_target_type == 0 { // speed
let val : Double = Double(x.secondary_custom_target_value_low)
rv[ "secondary_custom_target_speed_low" ] = val
}else if x.secondary_target_type == 1 { // heart_rate
rv[ "secondary_custom_target_heart_rate_low" ] = rzfit_swift_value_from_workout_hr(x.secondary_custom_target_value_low)
}else if x.secondary_target_type == 3 { // cadence
let val : Double = Double(x.secondary_custom_target_value_low)
rv[ "secondary_custom_target_cadence_low" ] = val
}else if x.secondary_target_type != 1 /* heart_rate */ &&
x.secondary_target_type != 4 /* power */ {
}else if x.secondary_target_type == 4 { // power
rv[ "secondary_custom_target_power_low" ] = rzfit_swift_value_from_workout_power(x.secondary_custom_target_value_low)
}else{
let val : Double = Double(x.secondary_custom_target_value_low)
rv[ "secondary_custom_target_value_low" ] = val
}
Expand All @@ -11550,11 +11588,14 @@ fileprivate func rzfit_swift_value_dict_for_workout_step( ptr : UnsafePointer<FI
if x.secondary_target_type == 0 { // speed
let val : Double = Double(x.secondary_custom_target_value_high)
rv[ "secondary_custom_target_speed_high" ] = val
}else if x.secondary_target_type == 1 { // heart_rate
rv[ "secondary_custom_target_heart_rate_high" ] = rzfit_swift_value_from_workout_hr(x.secondary_custom_target_value_high)
}else if x.secondary_target_type == 3 { // cadence
let val : Double = Double(x.secondary_custom_target_value_high)
rv[ "secondary_custom_target_cadence_high" ] = val
}else if x.secondary_target_type != 1 /* heart_rate */ &&
x.secondary_target_type != 4 /* power */ {
}else if x.secondary_target_type == 4 { // power
rv[ "secondary_custom_target_power_high" ] = rzfit_swift_value_from_workout_power(x.secondary_custom_target_value_high)
}else{
let val : Double = Double(x.secondary_custom_target_value_high)
rv[ "secondary_custom_target_value_high" ] = val
}
Expand Down
22 changes: 20 additions & 2 deletions Sources/FitFileParser/rzfit_swift_reverse_map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6496,6 +6496,10 @@ fileprivate func rzfit_swift_reverse_value_manufacturer(value : String) -> RzFit
case "fazua": return .string("318")
case "319": return .string("oreka_training")
case "oreka_training": return .string("319")
case "320": return .string("isec")
case "isec": return .string("320")
case "321": return .string("lululemon_studio")
case "lululemon_studio": return .string("321")
case "5759": return .string("actigraphcorp")
case "actigraphcorp": return .string("5759")
default: return .unknown
Expand Down Expand Up @@ -6919,6 +6923,8 @@ fileprivate func rzfit_swift_reverse_value_garmin_product(value : String) -> RzF
case "vivo_move_hr": return .string("2772")
case "2713": return .string("edge_1030")
case "edge_1030": return .string("2713")
case "2727": return .string("fr35_sea")
case "fr35_sea": return .string("2727")
case "2787": return .string("vector_3")
case "vector_3": return .string("2787")
case "2796": return .string("fenix5_asia")
Expand Down Expand Up @@ -7171,6 +7177,8 @@ fileprivate func rzfit_swift_reverse_value_garmin_product(value : String) -> RzF
case "enduro_asia": return .string("3872")
case "3837": return .string("venusq_asia")
case "venusq_asia": return .string("3837")
case "3843": return .string("edge_1040")
case "edge_1040": return .string("3843")
case "3850": return .string("marq_golfer_asia")
case "marq_golfer_asia": return .string("3850")
case "3851": return .string("venu2_plus")
Expand Down Expand Up @@ -7207,6 +7215,8 @@ fileprivate func rzfit_swift_reverse_value_garmin_product(value : String) -> RzF
case "venu2_asia": return .string("3950")
case "3978": return .string("fr945_lte_asia")
case "fr945_lte_asia": return .string("3978")
case "3982": return .string("vivo_move_sport")
case "vivo_move_sport": return .string("3982")
case "3986": return .string("approach_S12_asia")
case "approach_S12_asia": return .string("3986")
case "3990": return .string("fr255_music")
Expand All @@ -7233,12 +7243,18 @@ fileprivate func rzfit_swift_reverse_value_garmin_product(value : String) -> RzF
case "vivosmart_5": return .string("4063")
case "4071": return .string("instinct_2_asia")
case "instinct_2_asia": return .string("4071")
case "4115": return .string("venusq2")
case "venusq2": return .string("4115")
case "4116": return .string("venusq2music")
case "venusq2music": return .string("4116")
case "4125": return .string("d2_air_x10")
case "d2_air_x10": return .string("4125")
case "4130": return .string("hrm_pro_plus")
case "hrm_pro_plus": return .string("4130")
case "4132": return .string("descent_g1_asia")
case "descent_g1_asia": return .string("4132")
case "4135": return .string("tactix7")
case "tactix7": return .string("4135")
case "4169": return .string("edge_explore2")
case "edge_explore2": return .string("4169")
case "4265": return .string("tacx_neo_smart")
Expand All @@ -7265,8 +7281,10 @@ fileprivate func rzfit_swift_reverse_value_garmin_product(value : String) -> RzF
case "tacx_flux2_smart": return .string("4275")
case "4276": return .string("tacx_magnum")
case "tacx_magnum": return .string("4276")
case "4135": return .string("tactix7")
case "tactix7": return .string("4135")
case "4305": return .string("edge_1040_asia")
case "edge_1040_asia": return .string("4305")
case "4341": return .string("enduro2")
case "enduro2": return .string("4341")
case "10007": return .string("sdm4")
case "sdm4": return .string("10007")
case "10014": return .string("edge_remote")
Expand Down
6 changes: 3 additions & 3 deletions Sources/FitFileParserObjc/fit.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -60,7 +60,7 @@
#define FIT_PROTOCOL_VERSION_MAX FIT_PROTOCOL_VERSION_20

#define FIT_PROFILE_VERSION_MAJOR 21
#define FIT_PROFILE_VERSION_MINOR 89
#define FIT_PROFILE_VERSION_MINOR 94
#define FIT_PROFILE_VERSION_SCALE 100
#define FIT_PROFILE_VERSION ((FIT_UINT16) (FIT_PROFILE_VERSION_MAJOR * 100 + FIT_PROFILE_VERSION_MINOR))
#endif // !defined(FIT_CPP_INCLUDE_C)
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit_convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit_convert.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit_crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit_crc.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions Sources/FitFileParserObjc/fit_product.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.89Release
// Tag = production/akw/21.89.00-0-g487f2ed0
// Profile Version = 21.94Release
// Tag = production/akw/21.94.00-0-g0f668193
// Product = EXAMPLE
// Alignment = 4 bytes, padding disabled.
////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit a508053

Please sign in to comment.