#region Copyright //////////////////////////////////////////////////////////////////////////////// // The following FIT Protocol software provided may be used with FIT protocol // devices only and remains the copyrighted property of Dynastream Innovations Inc. // The software is being provided on an "as-is" basis and as an accommodation, // and therefore all warranties, representations, or guarantees of any kind // (whether express, implied or statutory) including, without limitation, // warranties of merchantability, non-infringement, or fitness for a particular // purpose, are specifically disclaimed. // // Copyright 2016 Dynastream Innovations Inc. //////////////////////////////////////////////////////////////////////////////// // ****WARNING**** This file is auto-generated! Do NOT edit this file. // Profile Version = 16.60Release // Tag = production-akw-16.60.00-0-g5d3d436 //////////////////////////////////////////////////////////////////////////////// #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.IO; namespace Dynastream.Fit { /// /// Implements the DeviceInfo profile message. /// public class DeviceInfoMesg : Mesg { #region Fields static class DeviceTypeSubfield { public static ushort AntplusDeviceType = 0; public static ushort AntDeviceType = 1; public static ushort Subfields = 2; public static ushort Active = Fit.SubfieldIndexActiveSubfield; public static ushort MainField = Fit.SubfieldIndexMainField; } static class ProductSubfield { public static ushort GarminProduct = 0; public static ushort Subfields = 1; public static ushort Active = Fit.SubfieldIndexActiveSubfield; public static ushort MainField = Fit.SubfieldIndexMainField; } #endregion #region Constructors public DeviceInfoMesg() : base(Profile.GetMesg(MesgNum.DeviceInfo)) { } public DeviceInfoMesg(Mesg mesg) : base(mesg) { } #endregion // Constructors #region Methods /// /// Retrieves the Timestamp field /// Units: s /// Returns DateTime representing the Timestamp field public DateTime GetTimestamp() { return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField)); } /// /// Set Timestamp field /// Units: s /// Nullable field value to be set public void SetTimestamp(DateTime timestamp_) { SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField); } /// /// Retrieves the DeviceIndex field /// Returns nullable byte representing the DeviceIndex field public byte? GetDeviceIndex() { return (byte?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField); } /// /// Set DeviceIndex field /// Nullable field value to be set public void SetDeviceIndex(byte? deviceIndex_) { SetFieldValue(0, 0, deviceIndex_, Fit.SubfieldIndexMainField); } /// /// Retrieves the DeviceType field /// Returns nullable byte representing the DeviceType field public byte? GetDeviceType() { return (byte?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField); } /// /// Set DeviceType field /// Nullable field value to be set public void SetDeviceType(byte? deviceType_) { SetFieldValue(1, 0, deviceType_, Fit.SubfieldIndexMainField); } /// /// Retrieves the AntplusDeviceType subfield /// Nullable byte representing the AntplusDeviceType subfield public byte? GetAntplusDeviceType() { return (byte?)GetFieldValue(1, 0, DeviceTypeSubfield.AntplusDeviceType); } /// /// /// Set AntplusDeviceType subfield /// Subfield value to be set public void SetAntplusDeviceType(byte? antplusDeviceType) { SetFieldValue(1, 0, antplusDeviceType, DeviceTypeSubfield.AntplusDeviceType); } /// /// Retrieves the AntDeviceType subfield /// Nullable byte representing the AntDeviceType subfield public byte? GetAntDeviceType() { return (byte?)GetFieldValue(1, 0, DeviceTypeSubfield.AntDeviceType); } /// /// /// Set AntDeviceType subfield /// Subfield value to be set public void SetAntDeviceType(byte? antDeviceType) { SetFieldValue(1, 0, antDeviceType, DeviceTypeSubfield.AntDeviceType); } /// /// Retrieves the Manufacturer field /// Returns nullable ushort representing the Manufacturer field public ushort? GetManufacturer() { return (ushort?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField); } /// /// Set Manufacturer field /// Nullable field value to be set public void SetManufacturer(ushort? manufacturer_) { SetFieldValue(2, 0, manufacturer_, Fit.SubfieldIndexMainField); } /// /// Retrieves the SerialNumber field /// Returns nullable uint representing the SerialNumber field public uint? GetSerialNumber() { return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField); } /// /// Set SerialNumber field /// Nullable field value to be set public void SetSerialNumber(uint? serialNumber_) { SetFieldValue(3, 0, serialNumber_, Fit.SubfieldIndexMainField); } /// /// Retrieves the Product field /// Returns nullable ushort representing the Product field public ushort? GetProduct() { return (ushort?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField); } /// /// Set Product field /// Nullable field value to be set public void SetProduct(ushort? product_) { SetFieldValue(4, 0, product_, Fit.SubfieldIndexMainField); } /// /// Retrieves the GarminProduct subfield /// Nullable ushort representing the GarminProduct subfield public ushort? GetGarminProduct() { return (ushort?)GetFieldValue(4, 0, ProductSubfield.GarminProduct); } /// /// /// Set GarminProduct subfield /// Subfield value to be set public void SetGarminProduct(ushort? garminProduct) { SetFieldValue(4, 0, garminProduct, ProductSubfield.GarminProduct); } /// /// Retrieves the SoftwareVersion field /// Returns nullable float representing the SoftwareVersion field public float? GetSoftwareVersion() { return (float?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField); } /// /// Set SoftwareVersion field /// Nullable field value to be set public void SetSoftwareVersion(float? softwareVersion_) { SetFieldValue(5, 0, softwareVersion_, Fit.SubfieldIndexMainField); } /// /// Retrieves the HardwareVersion field /// Returns nullable byte representing the HardwareVersion field public byte? GetHardwareVersion() { return (byte?)GetFieldValue(6, 0, Fit.SubfieldIndexMainField); } /// /// Set HardwareVersion field /// Nullable field value to be set public void SetHardwareVersion(byte? hardwareVersion_) { SetFieldValue(6, 0, hardwareVersion_, Fit.SubfieldIndexMainField); } /// /// Retrieves the CumOperatingTime field /// Units: s /// Comment: Reset by new battery or charge. /// Returns nullable uint representing the CumOperatingTime field public uint? GetCumOperatingTime() { return (uint?)GetFieldValue(7, 0, Fit.SubfieldIndexMainField); } /// /// Set CumOperatingTime field /// Units: s /// Comment: Reset by new battery or charge. /// Nullable field value to be set public void SetCumOperatingTime(uint? cumOperatingTime_) { SetFieldValue(7, 0, cumOperatingTime_, Fit.SubfieldIndexMainField); } /// /// Retrieves the BatteryVoltage field /// Units: V /// Returns nullable float representing the BatteryVoltage field public float? GetBatteryVoltage() { return (float?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField); } /// /// Set BatteryVoltage field /// Units: V /// Nullable field value to be set public void SetBatteryVoltage(float? batteryVoltage_) { SetFieldValue(10, 0, batteryVoltage_, Fit.SubfieldIndexMainField); } /// /// Retrieves the BatteryStatus field /// Returns nullable byte representing the BatteryStatus field public byte? GetBatteryStatus() { return (byte?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField); } /// /// Set BatteryStatus field /// Nullable field value to be set public void SetBatteryStatus(byte? batteryStatus_) { SetFieldValue(11, 0, batteryStatus_, Fit.SubfieldIndexMainField); } /// /// Retrieves the SensorPosition field /// Comment: Indicates the location of the sensor /// Returns nullable BodyLocation enum representing the SensorPosition field public BodyLocation? GetSensorPosition() { object obj = GetFieldValue(18, 0, Fit.SubfieldIndexMainField); BodyLocation? value = obj == null ? (BodyLocation?)null : (BodyLocation)obj; return value; } /// /// Set SensorPosition field /// Comment: Indicates the location of the sensor /// Nullable field value to be set public void SetSensorPosition(BodyLocation? sensorPosition_) { SetFieldValue(18, 0, sensorPosition_, Fit.SubfieldIndexMainField); } /// /// Retrieves the Descriptor field /// Comment: Used to describe the sensor or location /// Returns byte[] representing the Descriptor field public byte[] GetDescriptor() { return (byte[])GetFieldValue(19, 0, Fit.SubfieldIndexMainField); } /// /// Retrieves the Descriptor field /// Comment: Used to describe the sensor or location /// Returns String representing the Descriptor field public String GetDescriptorAsString() { return Encoding.UTF8.GetString((byte[])GetFieldValue(19, 0, Fit.SubfieldIndexMainField)); } /// /// Set Descriptor field /// Comment: Used to describe the sensor or location /// field value to be set public void SetDescriptor(String descriptor_) { SetFieldValue(19, 0, System.Text.Encoding.UTF8.GetBytes(descriptor_), Fit.SubfieldIndexMainField); } /// /// Set Descriptor field /// Comment: Used to describe the sensor or location /// field value to be set public void SetDescriptor(byte[] descriptor_) { SetFieldValue(19, 0, descriptor_, Fit.SubfieldIndexMainField); } /// /// Retrieves the AntTransmissionType field /// Returns nullable byte representing the AntTransmissionType field public byte? GetAntTransmissionType() { return (byte?)GetFieldValue(20, 0, Fit.SubfieldIndexMainField); } /// /// Set AntTransmissionType field /// Nullable field value to be set public void SetAntTransmissionType(byte? antTransmissionType_) { SetFieldValue(20, 0, antTransmissionType_, Fit.SubfieldIndexMainField); } /// /// Retrieves the AntDeviceNumber field /// Returns nullable ushort representing the AntDeviceNumber field public ushort? GetAntDeviceNumber() { return (ushort?)GetFieldValue(21, 0, Fit.SubfieldIndexMainField); } /// /// Set AntDeviceNumber field /// Nullable field value to be set public void SetAntDeviceNumber(ushort? antDeviceNumber_) { SetFieldValue(21, 0, antDeviceNumber_, Fit.SubfieldIndexMainField); } /// /// Retrieves the AntNetwork field /// Returns nullable AntNetwork enum representing the AntNetwork field public AntNetwork? GetAntNetwork() { object obj = GetFieldValue(22, 0, Fit.SubfieldIndexMainField); AntNetwork? value = obj == null ? (AntNetwork?)null : (AntNetwork)obj; return value; } /// /// Set AntNetwork field /// Nullable field value to be set public void SetAntNetwork(AntNetwork? antNetwork_) { SetFieldValue(22, 0, antNetwork_, Fit.SubfieldIndexMainField); } /// /// Retrieves the SourceType field /// Returns nullable SourceType enum representing the SourceType field public SourceType? GetSourceType() { object obj = GetFieldValue(25, 0, Fit.SubfieldIndexMainField); SourceType? value = obj == null ? (SourceType?)null : (SourceType)obj; return value; } /// /// Set SourceType field /// Nullable field value to be set public void SetSourceType(SourceType? sourceType_) { SetFieldValue(25, 0, sourceType_, Fit.SubfieldIndexMainField); } /// /// Retrieves the ProductName field /// Comment: Optional free form string to indicate the devices name or model /// Returns byte[] representing the ProductName field public byte[] GetProductName() { return (byte[])GetFieldValue(27, 0, Fit.SubfieldIndexMainField); } /// /// Retrieves the ProductName field /// Comment: Optional free form string to indicate the devices name or model /// Returns String representing the ProductName field public String GetProductNameAsString() { return Encoding.UTF8.GetString((byte[])GetFieldValue(27, 0, Fit.SubfieldIndexMainField)); } /// /// Set ProductName field /// Comment: Optional free form string to indicate the devices name or model /// field value to be set public void SetProductName(String productName_) { SetFieldValue(27, 0, System.Text.Encoding.UTF8.GetBytes(productName_), Fit.SubfieldIndexMainField); } /// /// Set ProductName field /// Comment: Optional free form string to indicate the devices name or model /// field value to be set public void SetProductName(byte[] productName_) { SetFieldValue(27, 0, productName_, Fit.SubfieldIndexMainField); } #endregion // Methods } // Class } // namespace