FileIdMesg.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. #region Copyright
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // The following FIT Protocol software provided may be used with FIT protocol
  4. // devices only and remains the copyrighted property of Dynastream Innovations Inc.
  5. // The software is being provided on an "as-is" basis and as an accommodation,
  6. // and therefore all warranties, representations, or guarantees of any kind
  7. // (whether express, implied or statutory) including, without limitation,
  8. // warranties of merchantability, non-infringement, or fitness for a particular
  9. // purpose, are specifically disclaimed.
  10. //
  11. // Copyright 2016 Dynastream Innovations Inc.
  12. ////////////////////////////////////////////////////////////////////////////////
  13. // ****WARNING**** This file is auto-generated! Do NOT edit this file.
  14. // Profile Version = 16.60Release
  15. // Tag = production-akw-16.60.00-0-g5d3d436
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #endregion
  18. using System;
  19. using System.Collections.Generic;
  20. using System.Diagnostics;
  21. using System.Text;
  22. using System.IO;
  23. namespace Dynastream.Fit
  24. {
  25. /// <summary>
  26. /// Implements the FileId profile message.
  27. /// </summary>
  28. public class FileIdMesg : Mesg
  29. {
  30. #region Fields
  31. static class ProductSubfield
  32. {
  33. public static ushort GarminProduct = 0;
  34. public static ushort Subfields = 1;
  35. public static ushort Active = Fit.SubfieldIndexActiveSubfield;
  36. public static ushort MainField = Fit.SubfieldIndexMainField;
  37. }
  38. #endregion
  39. #region Constructors
  40. public FileIdMesg() : base(Profile.GetMesg(MesgNum.FileId))
  41. {
  42. }
  43. public FileIdMesg(Mesg mesg) : base(mesg)
  44. {
  45. }
  46. #endregion // Constructors
  47. #region Methods
  48. ///<summary>
  49. /// Retrieves the Type field</summary>
  50. /// <returns>Returns nullable File enum representing the Type field</returns>
  51. new public File? GetType()
  52. {
  53. object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  54. File? value = obj == null ? (File?)null : (File)obj;
  55. return value;
  56. }
  57. /// <summary>
  58. /// Set Type field</summary>
  59. /// <param name="type_">Nullable field value to be set</param>
  60. public void SetType(File? type_)
  61. {
  62. SetFieldValue(0, 0, type_, Fit.SubfieldIndexMainField);
  63. }
  64. ///<summary>
  65. /// Retrieves the Manufacturer field</summary>
  66. /// <returns>Returns nullable ushort representing the Manufacturer field</returns>
  67. public ushort? GetManufacturer()
  68. {
  69. return (ushort?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  70. }
  71. /// <summary>
  72. /// Set Manufacturer field</summary>
  73. /// <param name="manufacturer_">Nullable field value to be set</param>
  74. public void SetManufacturer(ushort? manufacturer_)
  75. {
  76. SetFieldValue(1, 0, manufacturer_, Fit.SubfieldIndexMainField);
  77. }
  78. ///<summary>
  79. /// Retrieves the Product field</summary>
  80. /// <returns>Returns nullable ushort representing the Product field</returns>
  81. public ushort? GetProduct()
  82. {
  83. return (ushort?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  84. }
  85. /// <summary>
  86. /// Set Product field</summary>
  87. /// <param name="product_">Nullable field value to be set</param>
  88. public void SetProduct(ushort? product_)
  89. {
  90. SetFieldValue(2, 0, product_, Fit.SubfieldIndexMainField);
  91. }
  92. /// <summary>
  93. /// Retrieves the GarminProduct subfield</summary>
  94. /// <returns>Nullable ushort representing the GarminProduct subfield</returns>
  95. public ushort? GetGarminProduct()
  96. {
  97. return (ushort?)GetFieldValue(2, 0, ProductSubfield.GarminProduct);
  98. }
  99. /// <summary>
  100. ///
  101. /// Set GarminProduct subfield</summary>
  102. /// <param name="garminProduct">Subfield value to be set</param>
  103. public void SetGarminProduct(ushort? garminProduct)
  104. {
  105. SetFieldValue(2, 0, garminProduct, ProductSubfield.GarminProduct);
  106. }
  107. ///<summary>
  108. /// Retrieves the SerialNumber field</summary>
  109. /// <returns>Returns nullable uint representing the SerialNumber field</returns>
  110. public uint? GetSerialNumber()
  111. {
  112. return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  113. }
  114. /// <summary>
  115. /// Set SerialNumber field</summary>
  116. /// <param name="serialNumber_">Nullable field value to be set</param>
  117. public void SetSerialNumber(uint? serialNumber_)
  118. {
  119. SetFieldValue(3, 0, serialNumber_, Fit.SubfieldIndexMainField);
  120. }
  121. ///<summary>
  122. /// Retrieves the TimeCreated field
  123. /// Comment: Only set for files that are can be created/erased.</summary>
  124. /// <returns>Returns DateTime representing the TimeCreated field</returns>
  125. public DateTime GetTimeCreated()
  126. {
  127. return TimestampToDateTime((uint?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField));
  128. }
  129. /// <summary>
  130. /// Set TimeCreated field
  131. /// Comment: Only set for files that are can be created/erased.</summary>
  132. /// <param name="timeCreated_">Nullable field value to be set</param>
  133. public void SetTimeCreated(DateTime timeCreated_)
  134. {
  135. SetFieldValue(4, 0, timeCreated_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  136. }
  137. ///<summary>
  138. /// Retrieves the Number field
  139. /// Comment: Only set for files that are not created/erased.</summary>
  140. /// <returns>Returns nullable ushort representing the Number field</returns>
  141. public ushort? GetNumber()
  142. {
  143. return (ushort?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  144. }
  145. /// <summary>
  146. /// Set Number field
  147. /// Comment: Only set for files that are not created/erased.</summary>
  148. /// <param name="number_">Nullable field value to be set</param>
  149. public void SetNumber(ushort? number_)
  150. {
  151. SetFieldValue(5, 0, number_, Fit.SubfieldIndexMainField);
  152. }
  153. ///<summary>
  154. /// Retrieves the ProductName field
  155. /// Comment: Optional free form string to indicate the devices name or model</summary>
  156. /// <returns>Returns byte[] representing the ProductName field</returns>
  157. public byte[] GetProductName()
  158. {
  159. return (byte[])GetFieldValue(8, 0, Fit.SubfieldIndexMainField);
  160. }
  161. ///<summary>
  162. /// Retrieves the ProductName field
  163. /// Comment: Optional free form string to indicate the devices name or model</summary>
  164. /// <returns>Returns String representing the ProductName field</returns>
  165. public String GetProductNameAsString()
  166. {
  167. return Encoding.UTF8.GetString((byte[])GetFieldValue(8, 0, Fit.SubfieldIndexMainField));
  168. }
  169. ///<summary>
  170. /// Set ProductName field
  171. /// Comment: Optional free form string to indicate the devices name or model</summary>
  172. /// <param name="productName_"> field value to be set</param>
  173. public void SetProductName(String productName_)
  174. {
  175. SetFieldValue(8, 0, System.Text.Encoding.UTF8.GetBytes(productName_), Fit.SubfieldIndexMainField);
  176. }
  177. /// <summary>
  178. /// Set ProductName field
  179. /// Comment: Optional free form string to indicate the devices name or model</summary>
  180. /// <param name="productName_">field value to be set</param>
  181. public void SetProductName(byte[] productName_)
  182. {
  183. SetFieldValue(8, 0, productName_, Fit.SubfieldIndexMainField);
  184. }
  185. #endregion // Methods
  186. } // Class
  187. } // namespace