UserProfileMesg.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  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 UserProfile profile message.
  27. /// </summary>
  28. public class UserProfileMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public UserProfileMesg() : base(Profile.GetMesg(MesgNum.UserProfile))
  34. {
  35. }
  36. public UserProfileMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the MessageIndex field</summary>
  43. /// <returns>Returns nullable ushort representing the MessageIndex field</returns>
  44. public ushort? GetMessageIndex()
  45. {
  46. return (ushort?)GetFieldValue(254, 0, Fit.SubfieldIndexMainField);
  47. }
  48. /// <summary>
  49. /// Set MessageIndex field</summary>
  50. /// <param name="messageIndex_">Nullable field value to be set</param>
  51. public void SetMessageIndex(ushort? messageIndex_)
  52. {
  53. SetFieldValue(254, 0, messageIndex_, Fit.SubfieldIndexMainField);
  54. }
  55. ///<summary>
  56. /// Retrieves the FriendlyName field</summary>
  57. /// <returns>Returns byte[] representing the FriendlyName field</returns>
  58. public byte[] GetFriendlyName()
  59. {
  60. return (byte[])GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  61. }
  62. ///<summary>
  63. /// Retrieves the FriendlyName field</summary>
  64. /// <returns>Returns String representing the FriendlyName field</returns>
  65. public String GetFriendlyNameAsString()
  66. {
  67. return Encoding.UTF8.GetString((byte[])GetFieldValue(0, 0, Fit.SubfieldIndexMainField));
  68. }
  69. ///<summary>
  70. /// Set FriendlyName field</summary>
  71. /// <param name="friendlyName_"> field value to be set</param>
  72. public void SetFriendlyName(String friendlyName_)
  73. {
  74. SetFieldValue(0, 0, System.Text.Encoding.UTF8.GetBytes(friendlyName_), Fit.SubfieldIndexMainField);
  75. }
  76. /// <summary>
  77. /// Set FriendlyName field</summary>
  78. /// <param name="friendlyName_">field value to be set</param>
  79. public void SetFriendlyName(byte[] friendlyName_)
  80. {
  81. SetFieldValue(0, 0, friendlyName_, Fit.SubfieldIndexMainField);
  82. }
  83. ///<summary>
  84. /// Retrieves the Gender field</summary>
  85. /// <returns>Returns nullable Gender enum representing the Gender field</returns>
  86. public Gender? GetGender()
  87. {
  88. object obj = GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  89. Gender? value = obj == null ? (Gender?)null : (Gender)obj;
  90. return value;
  91. }
  92. /// <summary>
  93. /// Set Gender field</summary>
  94. /// <param name="gender_">Nullable field value to be set</param>
  95. public void SetGender(Gender? gender_)
  96. {
  97. SetFieldValue(1, 0, gender_, Fit.SubfieldIndexMainField);
  98. }
  99. ///<summary>
  100. /// Retrieves the Age field
  101. /// Units: years</summary>
  102. /// <returns>Returns nullable byte representing the Age field</returns>
  103. public byte? GetAge()
  104. {
  105. return (byte?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  106. }
  107. /// <summary>
  108. /// Set Age field
  109. /// Units: years</summary>
  110. /// <param name="age_">Nullable field value to be set</param>
  111. public void SetAge(byte? age_)
  112. {
  113. SetFieldValue(2, 0, age_, Fit.SubfieldIndexMainField);
  114. }
  115. ///<summary>
  116. /// Retrieves the Height field
  117. /// Units: m</summary>
  118. /// <returns>Returns nullable float representing the Height field</returns>
  119. public float? GetHeight()
  120. {
  121. return (float?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  122. }
  123. /// <summary>
  124. /// Set Height field
  125. /// Units: m</summary>
  126. /// <param name="height_">Nullable field value to be set</param>
  127. public void SetHeight(float? height_)
  128. {
  129. SetFieldValue(3, 0, height_, Fit.SubfieldIndexMainField);
  130. }
  131. ///<summary>
  132. /// Retrieves the Weight field
  133. /// Units: kg</summary>
  134. /// <returns>Returns nullable float representing the Weight field</returns>
  135. public float? GetWeight()
  136. {
  137. return (float?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  138. }
  139. /// <summary>
  140. /// Set Weight field
  141. /// Units: kg</summary>
  142. /// <param name="weight_">Nullable field value to be set</param>
  143. public void SetWeight(float? weight_)
  144. {
  145. SetFieldValue(4, 0, weight_, Fit.SubfieldIndexMainField);
  146. }
  147. ///<summary>
  148. /// Retrieves the Language field</summary>
  149. /// <returns>Returns nullable Language enum representing the Language field</returns>
  150. public Language? GetLanguage()
  151. {
  152. object obj = GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  153. Language? value = obj == null ? (Language?)null : (Language)obj;
  154. return value;
  155. }
  156. /// <summary>
  157. /// Set Language field</summary>
  158. /// <param name="language_">Nullable field value to be set</param>
  159. public void SetLanguage(Language? language_)
  160. {
  161. SetFieldValue(5, 0, language_, Fit.SubfieldIndexMainField);
  162. }
  163. ///<summary>
  164. /// Retrieves the ElevSetting field</summary>
  165. /// <returns>Returns nullable DisplayMeasure enum representing the ElevSetting field</returns>
  166. public DisplayMeasure? GetElevSetting()
  167. {
  168. object obj = GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
  169. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  170. return value;
  171. }
  172. /// <summary>
  173. /// Set ElevSetting field</summary>
  174. /// <param name="elevSetting_">Nullable field value to be set</param>
  175. public void SetElevSetting(DisplayMeasure? elevSetting_)
  176. {
  177. SetFieldValue(6, 0, elevSetting_, Fit.SubfieldIndexMainField);
  178. }
  179. ///<summary>
  180. /// Retrieves the WeightSetting field</summary>
  181. /// <returns>Returns nullable DisplayMeasure enum representing the WeightSetting field</returns>
  182. public DisplayMeasure? GetWeightSetting()
  183. {
  184. object obj = GetFieldValue(7, 0, Fit.SubfieldIndexMainField);
  185. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  186. return value;
  187. }
  188. /// <summary>
  189. /// Set WeightSetting field</summary>
  190. /// <param name="weightSetting_">Nullable field value to be set</param>
  191. public void SetWeightSetting(DisplayMeasure? weightSetting_)
  192. {
  193. SetFieldValue(7, 0, weightSetting_, Fit.SubfieldIndexMainField);
  194. }
  195. ///<summary>
  196. /// Retrieves the RestingHeartRate field
  197. /// Units: bpm</summary>
  198. /// <returns>Returns nullable byte representing the RestingHeartRate field</returns>
  199. public byte? GetRestingHeartRate()
  200. {
  201. return (byte?)GetFieldValue(8, 0, Fit.SubfieldIndexMainField);
  202. }
  203. /// <summary>
  204. /// Set RestingHeartRate field
  205. /// Units: bpm</summary>
  206. /// <param name="restingHeartRate_">Nullable field value to be set</param>
  207. public void SetRestingHeartRate(byte? restingHeartRate_)
  208. {
  209. SetFieldValue(8, 0, restingHeartRate_, Fit.SubfieldIndexMainField);
  210. }
  211. ///<summary>
  212. /// Retrieves the DefaultMaxRunningHeartRate field
  213. /// Units: bpm</summary>
  214. /// <returns>Returns nullable byte representing the DefaultMaxRunningHeartRate field</returns>
  215. public byte? GetDefaultMaxRunningHeartRate()
  216. {
  217. return (byte?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
  218. }
  219. /// <summary>
  220. /// Set DefaultMaxRunningHeartRate field
  221. /// Units: bpm</summary>
  222. /// <param name="defaultMaxRunningHeartRate_">Nullable field value to be set</param>
  223. public void SetDefaultMaxRunningHeartRate(byte? defaultMaxRunningHeartRate_)
  224. {
  225. SetFieldValue(9, 0, defaultMaxRunningHeartRate_, Fit.SubfieldIndexMainField);
  226. }
  227. ///<summary>
  228. /// Retrieves the DefaultMaxBikingHeartRate field
  229. /// Units: bpm</summary>
  230. /// <returns>Returns nullable byte representing the DefaultMaxBikingHeartRate field</returns>
  231. public byte? GetDefaultMaxBikingHeartRate()
  232. {
  233. return (byte?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField);
  234. }
  235. /// <summary>
  236. /// Set DefaultMaxBikingHeartRate field
  237. /// Units: bpm</summary>
  238. /// <param name="defaultMaxBikingHeartRate_">Nullable field value to be set</param>
  239. public void SetDefaultMaxBikingHeartRate(byte? defaultMaxBikingHeartRate_)
  240. {
  241. SetFieldValue(10, 0, defaultMaxBikingHeartRate_, Fit.SubfieldIndexMainField);
  242. }
  243. ///<summary>
  244. /// Retrieves the DefaultMaxHeartRate field
  245. /// Units: bpm</summary>
  246. /// <returns>Returns nullable byte representing the DefaultMaxHeartRate field</returns>
  247. public byte? GetDefaultMaxHeartRate()
  248. {
  249. return (byte?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField);
  250. }
  251. /// <summary>
  252. /// Set DefaultMaxHeartRate field
  253. /// Units: bpm</summary>
  254. /// <param name="defaultMaxHeartRate_">Nullable field value to be set</param>
  255. public void SetDefaultMaxHeartRate(byte? defaultMaxHeartRate_)
  256. {
  257. SetFieldValue(11, 0, defaultMaxHeartRate_, Fit.SubfieldIndexMainField);
  258. }
  259. ///<summary>
  260. /// Retrieves the HrSetting field</summary>
  261. /// <returns>Returns nullable DisplayHeart enum representing the HrSetting field</returns>
  262. public DisplayHeart? GetHrSetting()
  263. {
  264. object obj = GetFieldValue(12, 0, Fit.SubfieldIndexMainField);
  265. DisplayHeart? value = obj == null ? (DisplayHeart?)null : (DisplayHeart)obj;
  266. return value;
  267. }
  268. /// <summary>
  269. /// Set HrSetting field</summary>
  270. /// <param name="hrSetting_">Nullable field value to be set</param>
  271. public void SetHrSetting(DisplayHeart? hrSetting_)
  272. {
  273. SetFieldValue(12, 0, hrSetting_, Fit.SubfieldIndexMainField);
  274. }
  275. ///<summary>
  276. /// Retrieves the SpeedSetting field</summary>
  277. /// <returns>Returns nullable DisplayMeasure enum representing the SpeedSetting field</returns>
  278. public DisplayMeasure? GetSpeedSetting()
  279. {
  280. object obj = GetFieldValue(13, 0, Fit.SubfieldIndexMainField);
  281. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  282. return value;
  283. }
  284. /// <summary>
  285. /// Set SpeedSetting field</summary>
  286. /// <param name="speedSetting_">Nullable field value to be set</param>
  287. public void SetSpeedSetting(DisplayMeasure? speedSetting_)
  288. {
  289. SetFieldValue(13, 0, speedSetting_, Fit.SubfieldIndexMainField);
  290. }
  291. ///<summary>
  292. /// Retrieves the DistSetting field</summary>
  293. /// <returns>Returns nullable DisplayMeasure enum representing the DistSetting field</returns>
  294. public DisplayMeasure? GetDistSetting()
  295. {
  296. object obj = GetFieldValue(14, 0, Fit.SubfieldIndexMainField);
  297. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  298. return value;
  299. }
  300. /// <summary>
  301. /// Set DistSetting field</summary>
  302. /// <param name="distSetting_">Nullable field value to be set</param>
  303. public void SetDistSetting(DisplayMeasure? distSetting_)
  304. {
  305. SetFieldValue(14, 0, distSetting_, Fit.SubfieldIndexMainField);
  306. }
  307. ///<summary>
  308. /// Retrieves the PowerSetting field</summary>
  309. /// <returns>Returns nullable DisplayPower enum representing the PowerSetting field</returns>
  310. public DisplayPower? GetPowerSetting()
  311. {
  312. object obj = GetFieldValue(16, 0, Fit.SubfieldIndexMainField);
  313. DisplayPower? value = obj == null ? (DisplayPower?)null : (DisplayPower)obj;
  314. return value;
  315. }
  316. /// <summary>
  317. /// Set PowerSetting field</summary>
  318. /// <param name="powerSetting_">Nullable field value to be set</param>
  319. public void SetPowerSetting(DisplayPower? powerSetting_)
  320. {
  321. SetFieldValue(16, 0, powerSetting_, Fit.SubfieldIndexMainField);
  322. }
  323. ///<summary>
  324. /// Retrieves the ActivityClass field</summary>
  325. /// <returns>Returns nullable ActivityClass enum representing the ActivityClass field</returns>
  326. public ActivityClass? GetActivityClass()
  327. {
  328. object obj = GetFieldValue(17, 0, Fit.SubfieldIndexMainField);
  329. ActivityClass? value = obj == null ? (ActivityClass?)null : (ActivityClass)obj;
  330. return value;
  331. }
  332. /// <summary>
  333. /// Set ActivityClass field</summary>
  334. /// <param name="activityClass_">Nullable field value to be set</param>
  335. public void SetActivityClass(ActivityClass? activityClass_)
  336. {
  337. SetFieldValue(17, 0, activityClass_, Fit.SubfieldIndexMainField);
  338. }
  339. ///<summary>
  340. /// Retrieves the PositionSetting field</summary>
  341. /// <returns>Returns nullable DisplayPosition enum representing the PositionSetting field</returns>
  342. public DisplayPosition? GetPositionSetting()
  343. {
  344. object obj = GetFieldValue(18, 0, Fit.SubfieldIndexMainField);
  345. DisplayPosition? value = obj == null ? (DisplayPosition?)null : (DisplayPosition)obj;
  346. return value;
  347. }
  348. /// <summary>
  349. /// Set PositionSetting field</summary>
  350. /// <param name="positionSetting_">Nullable field value to be set</param>
  351. public void SetPositionSetting(DisplayPosition? positionSetting_)
  352. {
  353. SetFieldValue(18, 0, positionSetting_, Fit.SubfieldIndexMainField);
  354. }
  355. ///<summary>
  356. /// Retrieves the TemperatureSetting field</summary>
  357. /// <returns>Returns nullable DisplayMeasure enum representing the TemperatureSetting field</returns>
  358. public DisplayMeasure? GetTemperatureSetting()
  359. {
  360. object obj = GetFieldValue(21, 0, Fit.SubfieldIndexMainField);
  361. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  362. return value;
  363. }
  364. /// <summary>
  365. /// Set TemperatureSetting field</summary>
  366. /// <param name="temperatureSetting_">Nullable field value to be set</param>
  367. public void SetTemperatureSetting(DisplayMeasure? temperatureSetting_)
  368. {
  369. SetFieldValue(21, 0, temperatureSetting_, Fit.SubfieldIndexMainField);
  370. }
  371. ///<summary>
  372. /// Retrieves the LocalId field</summary>
  373. /// <returns>Returns nullable ushort representing the LocalId field</returns>
  374. public ushort? GetLocalId()
  375. {
  376. return (ushort?)GetFieldValue(22, 0, Fit.SubfieldIndexMainField);
  377. }
  378. /// <summary>
  379. /// Set LocalId field</summary>
  380. /// <param name="localId_">Nullable field value to be set</param>
  381. public void SetLocalId(ushort? localId_)
  382. {
  383. SetFieldValue(22, 0, localId_, Fit.SubfieldIndexMainField);
  384. }
  385. /// <summary>
  386. ///
  387. /// </summary>
  388. /// <returns>returns number of elements in field GlobalId</returns>
  389. public int GetNumGlobalId()
  390. {
  391. return GetNumFieldValues(23, Fit.SubfieldIndexMainField);
  392. }
  393. ///<summary>
  394. /// Retrieves the GlobalId field</summary>
  395. /// <param name="index">0 based index of GlobalId element to retrieve</param>
  396. /// <returns>Returns nullable byte representing the GlobalId field</returns>
  397. public byte? GetGlobalId(int index)
  398. {
  399. return (byte?)GetFieldValue(23, index, Fit.SubfieldIndexMainField);
  400. }
  401. /// <summary>
  402. /// Set GlobalId field</summary>
  403. /// <param name="index">0 based index of global_id</param>
  404. /// <param name="globalId_">Nullable field value to be set</param>
  405. public void SetGlobalId(int index, byte? globalId_)
  406. {
  407. SetFieldValue(23, index, globalId_, Fit.SubfieldIndexMainField);
  408. }
  409. ///<summary>
  410. /// Retrieves the HeightSetting field</summary>
  411. /// <returns>Returns nullable DisplayMeasure enum representing the HeightSetting field</returns>
  412. public DisplayMeasure? GetHeightSetting()
  413. {
  414. object obj = GetFieldValue(30, 0, Fit.SubfieldIndexMainField);
  415. DisplayMeasure? value = obj == null ? (DisplayMeasure?)null : (DisplayMeasure)obj;
  416. return value;
  417. }
  418. /// <summary>
  419. /// Set HeightSetting field</summary>
  420. /// <param name="heightSetting_">Nullable field value to be set</param>
  421. public void SetHeightSetting(DisplayMeasure? heightSetting_)
  422. {
  423. SetFieldValue(30, 0, heightSetting_, Fit.SubfieldIndexMainField);
  424. }
  425. #endregion // Methods
  426. } // Class
  427. } // namespace