static void OnUserProfileMesg(object sender, MesgEventArgs e) { Console.WriteLine("UserProfileHandler: Received {1} Mesg, it has global ID#{0}", e.mesg.Num, e.mesg.Name); UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg; string friendlyName; try { try { friendlyName = myUserProfile.GetFriendlyNameAsString(); } catch (ArgumentNullException) { //There is no FriendlyName property friendlyName = ""; } Console.WriteLine("\tFriendlyName \"{0}\"", friendlyName); Console.WriteLine("\tGender {0}", myUserProfile.GetGender().ToString()); Console.WriteLine("\tAge {0}", myUserProfile.GetAge()); Console.WriteLine("\tWeight {0}", myUserProfile.GetWeight()); } catch (FitException exception) { Console.WriteLine("\tOnUserProfileMesg Error {0}", exception.Message); Console.WriteLine("\t{0}", exception.InnerException); } }
public FitUserProfile(UserProfileMesg msg) { ActivityClass = msg.GetActivityClass(); Age = msg.GetAge(); DefaultMaxBikingHeartRate = msg.GetDefaultMaxBikingHeartRate(); DefaultMaxHeartRate = msg.GetDefaultMaxHeartRate(); DefaultMaxRunningHeartRate = msg.GetDefaultMaxRunningHeartRate(); DiveCount = msg.GetDiveCount(); FriendlyName = msg.GetFriendlyNameAsString(); Gender = msg.GetGender(); //msg.GetGlobalId(); Height = msg.GetHeight(); Language = msg.GetLanguage(); LocalId = msg.GetLocalId(); //NumGlobalId = msg.GetNumGlobalId(); RestingHeartRate = msg.GetRestingHeartRate(); SleepTime = msg.GetSleepTime(); UserRunningStepLength = msg.GetUserRunningStepLength(); UserWalkingStepLength = msg.GetUserWalkingStepLength(); WakeTime = msg.GetWakeTime(); Weight = msg.GetWeight(); DepthSetting = msg.GetDepthSetting(); DistSetting = msg.GetDistSetting(); ElevSetting = msg.GetElevSetting(); HeightSetting = msg.GetHeightSetting(); HrSetting = msg.GetHrSetting(); PositionSetting = msg.GetPositionSetting(); PowerSetting = msg.GetPowerSetting(); SpeedSetting = msg.GetSpeedSetting(); TemperatureSetting = msg.GetTemperatureSetting(); WeightSetting = msg.GetWeightSetting(); }
static void OnUserProfileMesg(object sender, MesgEventArgs e) { Console.WriteLine("UserProfileHandler: Received {1} Mesg, it has global ID#{0}", e.mesg.Num, e.mesg.Name); UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg; try { Console.WriteLine("\tType {0}", myUserProfile.GetFriendlyName()); Console.WriteLine("\tGender {0}", myUserProfile.GetGender().ToString()); Console.WriteLine("\tAge {0}", myUserProfile.GetAge()); Console.WriteLine("\tWeight {0}", myUserProfile.GetWeight()); } catch (FitException exception) { Console.WriteLine("\tOnUserProfileMesg Error {0}", exception.Message); Console.WriteLine("\t{0}", exception.InnerException); } }
void OnUserProfileMesg(object sender, MesgEventArgs e) { logger.Trace("UserProfileHandler: Received {1} Mesg, it has global ID#{0}", e.mesg.Num, e.mesg.Name); UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg; try { logger.Trace("\tFriendlyName \"{0}\"", Encoding.UTF8.GetString(myUserProfile.GetFriendlyName())); logger.Trace("\tGender {0}", myUserProfile.GetGender().ToString()); logger.Trace("\tAge {0}", myUserProfile.GetAge()); logger.Trace("\tWeight {0}", myUserProfile.GetWeight()); } catch (FitException exception) { logger.Trace("\tOnUserProfileMesg Error {0}", exception.Message); logger.Trace("\t{0}", exception.InnerException); } }
void OnUserProfileMesg(object sender, MesgEventArgs e) { UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg; try { tGender.Text = myUserProfile.GetGender().ToString(); tAge.Text = myUserProfile.GetAge().ToString(); tHeight.Text = myUserProfile.GetHeight().ToString() + " m"; tWeightKg.Text = myUserProfile.GetWeight().ToString() + " kg"; tHeartResting.Text = myUserProfile.GetRestingHeartRate().ToString() + " bpm"; tHeartMax.Text = myUserProfile.GetDefaultMaxBikingHeartRate().ToString() + " bpm"; } catch (FitException exception) { Debug.WriteLine(string.Format("\tOnUserProfileMesg Error {0}", exception.Message)); Debug.WriteLine(string.Format("\t{0}", exception.InnerException)); } }