1
0

Profile.cs 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558
  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. /// Represents the Fit Profile including message, field and type definition.
  27. /// </summary>
  28. public static class Profile
  29. {
  30. #region Fields
  31. [Obsolete("This field will be made private in version 18.00; Use GetMesg() instead;")]
  32. public static List<Mesg> mesgs = new List<Mesg>();
  33. private static readonly Dictionary<ushort, Mesg> m_mesgLookup = new Dictionary<ushort, Mesg>();
  34. #region Profile Mesg Indices
  35. // These are the indices into the mesgs array
  36. public readonly static ushort FileIdIndex;
  37. public readonly static ushort FileCreatorIndex;
  38. public readonly static ushort TimestampCorrelationIndex;
  39. public readonly static ushort SoftwareIndex;
  40. public readonly static ushort SlaveDeviceIndex;
  41. public readonly static ushort CapabilitiesIndex;
  42. public readonly static ushort FileCapabilitiesIndex;
  43. public readonly static ushort MesgCapabilitiesIndex;
  44. public readonly static ushort FieldCapabilitiesIndex;
  45. public readonly static ushort DeviceSettingsIndex;
  46. public readonly static ushort UserProfileIndex;
  47. public readonly static ushort HrmProfileIndex;
  48. public readonly static ushort SdmProfileIndex;
  49. public readonly static ushort BikeProfileIndex;
  50. public readonly static ushort ZonesTargetIndex;
  51. public readonly static ushort SportIndex;
  52. public readonly static ushort HrZoneIndex;
  53. public readonly static ushort SpeedZoneIndex;
  54. public readonly static ushort CadenceZoneIndex;
  55. public readonly static ushort PowerZoneIndex;
  56. public readonly static ushort MetZoneIndex;
  57. public readonly static ushort GoalIndex;
  58. public readonly static ushort ActivityIndex;
  59. public readonly static ushort SessionIndex;
  60. public readonly static ushort LapIndex;
  61. public readonly static ushort LengthIndex;
  62. public readonly static ushort RecordIndex;
  63. public readonly static ushort EventIndex;
  64. public readonly static ushort DeviceInfoIndex;
  65. public readonly static ushort TrainingFileIndex;
  66. public readonly static ushort HrvIndex;
  67. public readonly static ushort CameraEventIndex;
  68. public readonly static ushort GyroscopeDataIndex;
  69. public readonly static ushort AccelerometerDataIndex;
  70. public readonly static ushort ThreeDSensorCalibrationIndex;
  71. public readonly static ushort VideoFrameIndex;
  72. public readonly static ushort ObdiiDataIndex;
  73. public readonly static ushort NmeaSentenceIndex;
  74. public readonly static ushort AviationAttitudeIndex;
  75. public readonly static ushort VideoIndex;
  76. public readonly static ushort VideoTitleIndex;
  77. public readonly static ushort VideoDescriptionIndex;
  78. public readonly static ushort VideoClipIndex;
  79. public readonly static ushort CourseIndex;
  80. public readonly static ushort CoursePointIndex;
  81. public readonly static ushort SegmentIdIndex;
  82. public readonly static ushort SegmentLeaderboardEntryIndex;
  83. public readonly static ushort SegmentPointIndex;
  84. public readonly static ushort SegmentLapIndex;
  85. public readonly static ushort SegmentFileIndex;
  86. public readonly static ushort WorkoutIndex;
  87. public readonly static ushort WorkoutStepIndex;
  88. public readonly static ushort ScheduleIndex;
  89. public readonly static ushort TotalsIndex;
  90. public readonly static ushort WeightScaleIndex;
  91. public readonly static ushort BloodPressureIndex;
  92. public readonly static ushort MonitoringInfoIndex;
  93. public readonly static ushort MonitoringIndex;
  94. public readonly static ushort HrIndex;
  95. public readonly static ushort MemoGlobIndex;
  96. public readonly static ushort AntChannelIdIndex;
  97. public readonly static ushort AntRxIndex;
  98. public readonly static ushort AntTxIndex;
  99. public readonly static ushort PadIndex;
  100. //public readonly static ushort InvalidIndex;
  101. #endregion// Profile Mesg Indices
  102. #endregion // Fields
  103. #region Properties
  104. #endregion
  105. #region Constructors
  106. /// <summary>
  107. /// Static constructor to build the profile object
  108. /// </summary>
  109. static Profile()
  110. {
  111. // Disable the Obsolete Warning that is raised by using mesgs
  112. #pragma warning disable 0618
  113. ushort mesgIndex = 0;
  114. ushort fieldIndex, subfieldIndex;
  115. // FileId
  116. Mesg fileIdMesg = new Mesg("FileId", MesgNum.FileId);
  117. fieldIndex = 0;
  118. fileIdMesg.SetField(new Field("Type", 0, 0, 1, 0, "", false));
  119. fieldIndex++;
  120. fileIdMesg.SetField(new Field("Manufacturer", 1, 132, 1, 0, "", false));
  121. fieldIndex++;
  122. fileIdMesg.SetField(new Field("Product", 2, 132, 1, 0, "", false));
  123. subfieldIndex = 0;
  124. fileIdMesg.fields[fieldIndex].subfields.Add(new Subfield("GarminProduct", 132, 1, 0, ""));
  125. fileIdMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 1);
  126. fileIdMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 15);
  127. fileIdMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 13);
  128. subfieldIndex++;
  129. fieldIndex++;
  130. fileIdMesg.SetField(new Field("SerialNumber", 3, 140, 1, 0, "", false));
  131. fieldIndex++;
  132. fileIdMesg.SetField(new Field("TimeCreated", 4, 134, 1, 0, "", false));
  133. fieldIndex++;
  134. fileIdMesg.SetField(new Field("Number", 5, 132, 1, 0, "", false));
  135. fieldIndex++;
  136. fileIdMesg.SetField(new Field("ProductName", 8, 7, 1, 0, "", false));
  137. fieldIndex++;
  138. mesgs.Add(fileIdMesg);
  139. FileIdIndex = mesgIndex;
  140. m_mesgLookup.Add(MesgNum.FileId, fileIdMesg);
  141. mesgIndex++;
  142. // FileCreator
  143. Mesg fileCreatorMesg = new Mesg("FileCreator", MesgNum.FileCreator);
  144. fieldIndex = 0;
  145. fileCreatorMesg.SetField(new Field("SoftwareVersion", 0, 132, 1, 0, "", false));
  146. fieldIndex++;
  147. fileCreatorMesg.SetField(new Field("HardwareVersion", 1, 2, 1, 0, "", false));
  148. fieldIndex++;
  149. mesgs.Add(fileCreatorMesg);
  150. FileCreatorIndex = mesgIndex;
  151. m_mesgLookup.Add(MesgNum.FileCreator, fileCreatorMesg);
  152. mesgIndex++;
  153. // TimestampCorrelation
  154. Mesg timestampCorrelationMesg = new Mesg("TimestampCorrelation", MesgNum.TimestampCorrelation);
  155. fieldIndex = 0;
  156. timestampCorrelationMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  157. fieldIndex++;
  158. timestampCorrelationMesg.SetField(new Field("FractionalTimestamp", 0, 132, 32768, 0, "s", false));
  159. fieldIndex++;
  160. timestampCorrelationMesg.SetField(new Field("SystemTimestamp", 1, 134, 1, 0, "s", false));
  161. fieldIndex++;
  162. timestampCorrelationMesg.SetField(new Field("FractionalSystemTimestamp", 2, 132, 32768, 0, "s", false));
  163. fieldIndex++;
  164. timestampCorrelationMesg.SetField(new Field("LocalTimestamp", 3, 134, 1, 0, "s", false));
  165. fieldIndex++;
  166. timestampCorrelationMesg.SetField(new Field("TimestampMs", 4, 132, 1, 0, "ms", false));
  167. fieldIndex++;
  168. timestampCorrelationMesg.SetField(new Field("SystemTimestampMs", 5, 132, 1, 0, "ms", false));
  169. fieldIndex++;
  170. mesgs.Add(timestampCorrelationMesg);
  171. TimestampCorrelationIndex = mesgIndex;
  172. m_mesgLookup.Add(MesgNum.TimestampCorrelation, timestampCorrelationMesg);
  173. mesgIndex++;
  174. // Software
  175. Mesg softwareMesg = new Mesg("Software", MesgNum.Software);
  176. fieldIndex = 0;
  177. softwareMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  178. fieldIndex++;
  179. softwareMesg.SetField(new Field("Version", 3, 132, 100, 0, "", false));
  180. fieldIndex++;
  181. softwareMesg.SetField(new Field("PartNumber", 5, 7, 1, 0, "", false));
  182. fieldIndex++;
  183. mesgs.Add(softwareMesg);
  184. SoftwareIndex = mesgIndex;
  185. m_mesgLookup.Add(MesgNum.Software, softwareMesg);
  186. mesgIndex++;
  187. // SlaveDevice
  188. Mesg slaveDeviceMesg = new Mesg("SlaveDevice", MesgNum.SlaveDevice);
  189. fieldIndex = 0;
  190. slaveDeviceMesg.SetField(new Field("Manufacturer", 0, 132, 1, 0, "", false));
  191. fieldIndex++;
  192. slaveDeviceMesg.SetField(new Field("Product", 1, 132, 1, 0, "", false));
  193. subfieldIndex = 0;
  194. slaveDeviceMesg.fields[fieldIndex].subfields.Add(new Subfield("GarminProduct", 132, 1, 0, ""));
  195. slaveDeviceMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 1);
  196. slaveDeviceMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 15);
  197. slaveDeviceMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 13);
  198. subfieldIndex++;
  199. fieldIndex++;
  200. mesgs.Add(slaveDeviceMesg);
  201. SlaveDeviceIndex = mesgIndex;
  202. m_mesgLookup.Add(MesgNum.SlaveDevice, slaveDeviceMesg);
  203. mesgIndex++;
  204. // Capabilities
  205. Mesg capabilitiesMesg = new Mesg("Capabilities", MesgNum.Capabilities);
  206. fieldIndex = 0;
  207. capabilitiesMesg.SetField(new Field("Languages", 0, 10, 1, 0, "", false));
  208. fieldIndex++;
  209. capabilitiesMesg.SetField(new Field("Sports", 1, 10, 1, 0, "", false));
  210. fieldIndex++;
  211. capabilitiesMesg.SetField(new Field("WorkoutsSupported", 21, 140, 1, 0, "", false));
  212. fieldIndex++;
  213. capabilitiesMesg.SetField(new Field("ConnectivitySupported", 23, 140, 1, 0, "", false));
  214. fieldIndex++;
  215. mesgs.Add(capabilitiesMesg);
  216. CapabilitiesIndex = mesgIndex;
  217. m_mesgLookup.Add(MesgNum.Capabilities, capabilitiesMesg);
  218. mesgIndex++;
  219. // FileCapabilities
  220. Mesg fileCapabilitiesMesg = new Mesg("FileCapabilities", MesgNum.FileCapabilities);
  221. fieldIndex = 0;
  222. fileCapabilitiesMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  223. fieldIndex++;
  224. fileCapabilitiesMesg.SetField(new Field("Type", 0, 0, 1, 0, "", false));
  225. fieldIndex++;
  226. fileCapabilitiesMesg.SetField(new Field("Flags", 1, 10, 1, 0, "", false));
  227. fieldIndex++;
  228. fileCapabilitiesMesg.SetField(new Field("Directory", 2, 7, 1, 0, "", false));
  229. fieldIndex++;
  230. fileCapabilitiesMesg.SetField(new Field("MaxCount", 3, 132, 1, 0, "", false));
  231. fieldIndex++;
  232. fileCapabilitiesMesg.SetField(new Field("MaxSize", 4, 134, 1, 0, "bytes", false));
  233. fieldIndex++;
  234. mesgs.Add(fileCapabilitiesMesg);
  235. FileCapabilitiesIndex = mesgIndex;
  236. m_mesgLookup.Add(MesgNum.FileCapabilities, fileCapabilitiesMesg);
  237. mesgIndex++;
  238. // MesgCapabilities
  239. Mesg mesgCapabilitiesMesg = new Mesg("MesgCapabilities", MesgNum.MesgCapabilities);
  240. fieldIndex = 0;
  241. mesgCapabilitiesMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  242. fieldIndex++;
  243. mesgCapabilitiesMesg.SetField(new Field("File", 0, 0, 1, 0, "", false));
  244. fieldIndex++;
  245. mesgCapabilitiesMesg.SetField(new Field("MesgNum", 1, 132, 1, 0, "", false));
  246. fieldIndex++;
  247. mesgCapabilitiesMesg.SetField(new Field("CountType", 2, 0, 1, 0, "", false));
  248. fieldIndex++;
  249. mesgCapabilitiesMesg.SetField(new Field("Count", 3, 132, 1, 0, "", false));
  250. subfieldIndex = 0;
  251. mesgCapabilitiesMesg.fields[fieldIndex].subfields.Add(new Subfield("NumPerFile", 132, 1, 0, ""));
  252. mesgCapabilitiesMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 0);
  253. subfieldIndex++;
  254. mesgCapabilitiesMesg.fields[fieldIndex].subfields.Add(new Subfield("MaxPerFile", 132, 1, 0, ""));
  255. mesgCapabilitiesMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 1);
  256. subfieldIndex++;
  257. mesgCapabilitiesMesg.fields[fieldIndex].subfields.Add(new Subfield("MaxPerFileType", 132, 1, 0, ""));
  258. mesgCapabilitiesMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 2);
  259. subfieldIndex++;
  260. fieldIndex++;
  261. mesgs.Add(mesgCapabilitiesMesg);
  262. MesgCapabilitiesIndex = mesgIndex;
  263. m_mesgLookup.Add(MesgNum.MesgCapabilities, mesgCapabilitiesMesg);
  264. mesgIndex++;
  265. // FieldCapabilities
  266. Mesg fieldCapabilitiesMesg = new Mesg("FieldCapabilities", MesgNum.FieldCapabilities);
  267. fieldIndex = 0;
  268. fieldCapabilitiesMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  269. fieldIndex++;
  270. fieldCapabilitiesMesg.SetField(new Field("File", 0, 0, 1, 0, "", false));
  271. fieldIndex++;
  272. fieldCapabilitiesMesg.SetField(new Field("MesgNum", 1, 132, 1, 0, "", false));
  273. fieldIndex++;
  274. fieldCapabilitiesMesg.SetField(new Field("FieldNum", 2, 2, 1, 0, "", false));
  275. fieldIndex++;
  276. fieldCapabilitiesMesg.SetField(new Field("Count", 3, 132, 1, 0, "", false));
  277. fieldIndex++;
  278. mesgs.Add(fieldCapabilitiesMesg);
  279. FieldCapabilitiesIndex = mesgIndex;
  280. m_mesgLookup.Add(MesgNum.FieldCapabilities, fieldCapabilitiesMesg);
  281. mesgIndex++;
  282. // DeviceSettings
  283. Mesg deviceSettingsMesg = new Mesg("DeviceSettings", MesgNum.DeviceSettings);
  284. fieldIndex = 0;
  285. deviceSettingsMesg.SetField(new Field("ActiveTimeZone", 0, 2, 1, 0, "", false));
  286. fieldIndex++;
  287. deviceSettingsMesg.SetField(new Field("UtcOffset", 1, 134, 1, 0, "", false));
  288. fieldIndex++;
  289. deviceSettingsMesg.SetField(new Field("TimeOffset", 2, 134, 1, 0, "s", false));
  290. fieldIndex++;
  291. deviceSettingsMesg.SetField(new Field("TimeZoneOffset", 5, 1, 4, 0, "hr", false));
  292. fieldIndex++;
  293. mesgs.Add(deviceSettingsMesg);
  294. DeviceSettingsIndex = mesgIndex;
  295. m_mesgLookup.Add(MesgNum.DeviceSettings, deviceSettingsMesg);
  296. mesgIndex++;
  297. // UserProfile
  298. Mesg userProfileMesg = new Mesg("UserProfile", MesgNum.UserProfile);
  299. fieldIndex = 0;
  300. userProfileMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  301. fieldIndex++;
  302. userProfileMesg.SetField(new Field("FriendlyName", 0, 7, 1, 0, "", false));
  303. fieldIndex++;
  304. userProfileMesg.SetField(new Field("Gender", 1, 0, 1, 0, "", false));
  305. fieldIndex++;
  306. userProfileMesg.SetField(new Field("Age", 2, 2, 1, 0, "years", false));
  307. fieldIndex++;
  308. userProfileMesg.SetField(new Field("Height", 3, 2, 100, 0, "m", false));
  309. fieldIndex++;
  310. userProfileMesg.SetField(new Field("Weight", 4, 132, 10, 0, "kg", false));
  311. fieldIndex++;
  312. userProfileMesg.SetField(new Field("Language", 5, 0, 1, 0, "", false));
  313. fieldIndex++;
  314. userProfileMesg.SetField(new Field("ElevSetting", 6, 0, 1, 0, "", false));
  315. fieldIndex++;
  316. userProfileMesg.SetField(new Field("WeightSetting", 7, 0, 1, 0, "", false));
  317. fieldIndex++;
  318. userProfileMesg.SetField(new Field("RestingHeartRate", 8, 2, 1, 0, "bpm", false));
  319. fieldIndex++;
  320. userProfileMesg.SetField(new Field("DefaultMaxRunningHeartRate", 9, 2, 1, 0, "bpm", false));
  321. fieldIndex++;
  322. userProfileMesg.SetField(new Field("DefaultMaxBikingHeartRate", 10, 2, 1, 0, "bpm", false));
  323. fieldIndex++;
  324. userProfileMesg.SetField(new Field("DefaultMaxHeartRate", 11, 2, 1, 0, "bpm", false));
  325. fieldIndex++;
  326. userProfileMesg.SetField(new Field("HrSetting", 12, 0, 1, 0, "", false));
  327. fieldIndex++;
  328. userProfileMesg.SetField(new Field("SpeedSetting", 13, 0, 1, 0, "", false));
  329. fieldIndex++;
  330. userProfileMesg.SetField(new Field("DistSetting", 14, 0, 1, 0, "", false));
  331. fieldIndex++;
  332. userProfileMesg.SetField(new Field("PowerSetting", 16, 0, 1, 0, "", false));
  333. fieldIndex++;
  334. userProfileMesg.SetField(new Field("ActivityClass", 17, 0, 1, 0, "", false));
  335. fieldIndex++;
  336. userProfileMesg.SetField(new Field("PositionSetting", 18, 0, 1, 0, "", false));
  337. fieldIndex++;
  338. userProfileMesg.SetField(new Field("TemperatureSetting", 21, 0, 1, 0, "", false));
  339. fieldIndex++;
  340. userProfileMesg.SetField(new Field("LocalId", 22, 132, 1, 0, "", false));
  341. fieldIndex++;
  342. userProfileMesg.SetField(new Field("GlobalId", 23, 13, 1, 0, "", false));
  343. fieldIndex++;
  344. userProfileMesg.SetField(new Field("HeightSetting", 30, 0, 1, 0, "", false));
  345. fieldIndex++;
  346. mesgs.Add(userProfileMesg);
  347. UserProfileIndex = mesgIndex;
  348. m_mesgLookup.Add(MesgNum.UserProfile, userProfileMesg);
  349. mesgIndex++;
  350. // HrmProfile
  351. Mesg hrmProfileMesg = new Mesg("HrmProfile", MesgNum.HrmProfile);
  352. fieldIndex = 0;
  353. hrmProfileMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  354. fieldIndex++;
  355. hrmProfileMesg.SetField(new Field("Enabled", 0, 0, 1, 0, "", false));
  356. fieldIndex++;
  357. hrmProfileMesg.SetField(new Field("HrmAntId", 1, 139, 1, 0, "", false));
  358. fieldIndex++;
  359. hrmProfileMesg.SetField(new Field("LogHrv", 2, 0, 1, 0, "", false));
  360. fieldIndex++;
  361. hrmProfileMesg.SetField(new Field("HrmAntIdTransType", 3, 10, 1, 0, "", false));
  362. fieldIndex++;
  363. mesgs.Add(hrmProfileMesg);
  364. HrmProfileIndex = mesgIndex;
  365. m_mesgLookup.Add(MesgNum.HrmProfile, hrmProfileMesg);
  366. mesgIndex++;
  367. // SdmProfile
  368. Mesg sdmProfileMesg = new Mesg("SdmProfile", MesgNum.SdmProfile);
  369. fieldIndex = 0;
  370. sdmProfileMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  371. fieldIndex++;
  372. sdmProfileMesg.SetField(new Field("Enabled", 0, 0, 1, 0, "", false));
  373. fieldIndex++;
  374. sdmProfileMesg.SetField(new Field("SdmAntId", 1, 139, 1, 0, "", false));
  375. fieldIndex++;
  376. sdmProfileMesg.SetField(new Field("SdmCalFactor", 2, 132, 10, 0, "%", false));
  377. fieldIndex++;
  378. sdmProfileMesg.SetField(new Field("Odometer", 3, 134, 100, 0, "m", false));
  379. fieldIndex++;
  380. sdmProfileMesg.SetField(new Field("SpeedSource", 4, 0, 1, 0, "", false));
  381. fieldIndex++;
  382. sdmProfileMesg.SetField(new Field("SdmAntIdTransType", 5, 10, 1, 0, "", false));
  383. fieldIndex++;
  384. sdmProfileMesg.SetField(new Field("OdometerRollover", 7, 2, 1, 0, "", false));
  385. fieldIndex++;
  386. mesgs.Add(sdmProfileMesg);
  387. SdmProfileIndex = mesgIndex;
  388. m_mesgLookup.Add(MesgNum.SdmProfile, sdmProfileMesg);
  389. mesgIndex++;
  390. // BikeProfile
  391. Mesg bikeProfileMesg = new Mesg("BikeProfile", MesgNum.BikeProfile);
  392. fieldIndex = 0;
  393. bikeProfileMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  394. fieldIndex++;
  395. bikeProfileMesg.SetField(new Field("Name", 0, 7, 1, 0, "", false));
  396. fieldIndex++;
  397. bikeProfileMesg.SetField(new Field("Sport", 1, 0, 1, 0, "", false));
  398. fieldIndex++;
  399. bikeProfileMesg.SetField(new Field("SubSport", 2, 0, 1, 0, "", false));
  400. fieldIndex++;
  401. bikeProfileMesg.SetField(new Field("Odometer", 3, 134, 100, 0, "m", false));
  402. fieldIndex++;
  403. bikeProfileMesg.SetField(new Field("BikeSpdAntId", 4, 139, 1, 0, "", false));
  404. fieldIndex++;
  405. bikeProfileMesg.SetField(new Field("BikeCadAntId", 5, 139, 1, 0, "", false));
  406. fieldIndex++;
  407. bikeProfileMesg.SetField(new Field("BikeSpdcadAntId", 6, 139, 1, 0, "", false));
  408. fieldIndex++;
  409. bikeProfileMesg.SetField(new Field("BikePowerAntId", 7, 139, 1, 0, "", false));
  410. fieldIndex++;
  411. bikeProfileMesg.SetField(new Field("CustomWheelsize", 8, 132, 1000, 0, "m", false));
  412. fieldIndex++;
  413. bikeProfileMesg.SetField(new Field("AutoWheelsize", 9, 132, 1000, 0, "m", false));
  414. fieldIndex++;
  415. bikeProfileMesg.SetField(new Field("BikeWeight", 10, 132, 10, 0, "kg", false));
  416. fieldIndex++;
  417. bikeProfileMesg.SetField(new Field("PowerCalFactor", 11, 132, 10, 0, "%", false));
  418. fieldIndex++;
  419. bikeProfileMesg.SetField(new Field("AutoWheelCal", 12, 0, 1, 0, "", false));
  420. fieldIndex++;
  421. bikeProfileMesg.SetField(new Field("AutoPowerZero", 13, 0, 1, 0, "", false));
  422. fieldIndex++;
  423. bikeProfileMesg.SetField(new Field("Id", 14, 2, 1, 0, "", false));
  424. fieldIndex++;
  425. bikeProfileMesg.SetField(new Field("SpdEnabled", 15, 0, 1, 0, "", false));
  426. fieldIndex++;
  427. bikeProfileMesg.SetField(new Field("CadEnabled", 16, 0, 1, 0, "", false));
  428. fieldIndex++;
  429. bikeProfileMesg.SetField(new Field("SpdcadEnabled", 17, 0, 1, 0, "", false));
  430. fieldIndex++;
  431. bikeProfileMesg.SetField(new Field("PowerEnabled", 18, 0, 1, 0, "", false));
  432. fieldIndex++;
  433. bikeProfileMesg.SetField(new Field("CrankLength", 19, 2, 2, -110, "mm", false));
  434. fieldIndex++;
  435. bikeProfileMesg.SetField(new Field("Enabled", 20, 0, 1, 0, "", false));
  436. fieldIndex++;
  437. bikeProfileMesg.SetField(new Field("BikeSpdAntIdTransType", 21, 10, 1, 0, "", false));
  438. fieldIndex++;
  439. bikeProfileMesg.SetField(new Field("BikeCadAntIdTransType", 22, 10, 1, 0, "", false));
  440. fieldIndex++;
  441. bikeProfileMesg.SetField(new Field("BikeSpdcadAntIdTransType", 23, 10, 1, 0, "", false));
  442. fieldIndex++;
  443. bikeProfileMesg.SetField(new Field("BikePowerAntIdTransType", 24, 10, 1, 0, "", false));
  444. fieldIndex++;
  445. bikeProfileMesg.SetField(new Field("OdometerRollover", 37, 2, 1, 0, "", false));
  446. fieldIndex++;
  447. bikeProfileMesg.SetField(new Field("FrontGearNum", 38, 10, 1, 0, "", false));
  448. fieldIndex++;
  449. bikeProfileMesg.SetField(new Field("FrontGear", 39, 10, 1, 0, "", false));
  450. fieldIndex++;
  451. bikeProfileMesg.SetField(new Field("RearGearNum", 40, 10, 1, 0, "", false));
  452. fieldIndex++;
  453. bikeProfileMesg.SetField(new Field("RearGear", 41, 10, 1, 0, "", false));
  454. fieldIndex++;
  455. bikeProfileMesg.SetField(new Field("ShimanoDi2Enabled", 44, 0, 1, 0, "", false));
  456. fieldIndex++;
  457. mesgs.Add(bikeProfileMesg);
  458. BikeProfileIndex = mesgIndex;
  459. m_mesgLookup.Add(MesgNum.BikeProfile, bikeProfileMesg);
  460. mesgIndex++;
  461. // ZonesTarget
  462. Mesg zonesTargetMesg = new Mesg("ZonesTarget", MesgNum.ZonesTarget);
  463. fieldIndex = 0;
  464. zonesTargetMesg.SetField(new Field("MaxHeartRate", 1, 2, 1, 0, "", false));
  465. fieldIndex++;
  466. zonesTargetMesg.SetField(new Field("ThresholdHeartRate", 2, 2, 1, 0, "", false));
  467. fieldIndex++;
  468. zonesTargetMesg.SetField(new Field("FunctionalThresholdPower", 3, 132, 1, 0, "", false));
  469. fieldIndex++;
  470. zonesTargetMesg.SetField(new Field("HrCalcType", 5, 0, 1, 0, "", false));
  471. fieldIndex++;
  472. zonesTargetMesg.SetField(new Field("PwrCalcType", 7, 0, 1, 0, "", false));
  473. fieldIndex++;
  474. mesgs.Add(zonesTargetMesg);
  475. ZonesTargetIndex = mesgIndex;
  476. m_mesgLookup.Add(MesgNum.ZonesTarget, zonesTargetMesg);
  477. mesgIndex++;
  478. // Sport
  479. Mesg sportMesg = new Mesg("Sport", MesgNum.Sport);
  480. fieldIndex = 0;
  481. sportMesg.SetField(new Field("Sport", 0, 0, 1, 0, "", false));
  482. fieldIndex++;
  483. sportMesg.SetField(new Field("SubSport", 1, 0, 1, 0, "", false));
  484. fieldIndex++;
  485. sportMesg.SetField(new Field("Name", 3, 7, 1, 0, "", false));
  486. fieldIndex++;
  487. mesgs.Add(sportMesg);
  488. SportIndex = mesgIndex;
  489. m_mesgLookup.Add(MesgNum.Sport, sportMesg);
  490. mesgIndex++;
  491. // HrZone
  492. Mesg hrZoneMesg = new Mesg("HrZone", MesgNum.HrZone);
  493. fieldIndex = 0;
  494. hrZoneMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  495. fieldIndex++;
  496. hrZoneMesg.SetField(new Field("HighBpm", 1, 2, 1, 0, "bpm", false));
  497. fieldIndex++;
  498. hrZoneMesg.SetField(new Field("Name", 2, 7, 1, 0, "", false));
  499. fieldIndex++;
  500. mesgs.Add(hrZoneMesg);
  501. HrZoneIndex = mesgIndex;
  502. m_mesgLookup.Add(MesgNum.HrZone, hrZoneMesg);
  503. mesgIndex++;
  504. // SpeedZone
  505. Mesg speedZoneMesg = new Mesg("SpeedZone", MesgNum.SpeedZone);
  506. fieldIndex = 0;
  507. speedZoneMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  508. fieldIndex++;
  509. speedZoneMesg.SetField(new Field("HighValue", 0, 132, 1000, 0, "m/s", false));
  510. fieldIndex++;
  511. speedZoneMesg.SetField(new Field("Name", 1, 7, 1, 0, "", false));
  512. fieldIndex++;
  513. mesgs.Add(speedZoneMesg);
  514. SpeedZoneIndex = mesgIndex;
  515. m_mesgLookup.Add(MesgNum.SpeedZone, speedZoneMesg);
  516. mesgIndex++;
  517. // CadenceZone
  518. Mesg cadenceZoneMesg = new Mesg("CadenceZone", MesgNum.CadenceZone);
  519. fieldIndex = 0;
  520. cadenceZoneMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  521. fieldIndex++;
  522. cadenceZoneMesg.SetField(new Field("HighValue", 0, 2, 1, 0, "rpm", false));
  523. fieldIndex++;
  524. cadenceZoneMesg.SetField(new Field("Name", 1, 7, 1, 0, "", false));
  525. fieldIndex++;
  526. mesgs.Add(cadenceZoneMesg);
  527. CadenceZoneIndex = mesgIndex;
  528. m_mesgLookup.Add(MesgNum.CadenceZone, cadenceZoneMesg);
  529. mesgIndex++;
  530. // PowerZone
  531. Mesg powerZoneMesg = new Mesg("PowerZone", MesgNum.PowerZone);
  532. fieldIndex = 0;
  533. powerZoneMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  534. fieldIndex++;
  535. powerZoneMesg.SetField(new Field("HighValue", 1, 132, 1, 0, "watts", false));
  536. fieldIndex++;
  537. powerZoneMesg.SetField(new Field("Name", 2, 7, 1, 0, "", false));
  538. fieldIndex++;
  539. mesgs.Add(powerZoneMesg);
  540. PowerZoneIndex = mesgIndex;
  541. m_mesgLookup.Add(MesgNum.PowerZone, powerZoneMesg);
  542. mesgIndex++;
  543. // MetZone
  544. Mesg metZoneMesg = new Mesg("MetZone", MesgNum.MetZone);
  545. fieldIndex = 0;
  546. metZoneMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  547. fieldIndex++;
  548. metZoneMesg.SetField(new Field("HighBpm", 1, 2, 1, 0, "", false));
  549. fieldIndex++;
  550. metZoneMesg.SetField(new Field("Calories", 2, 132, 10, 0, "kcal / min", false));
  551. fieldIndex++;
  552. metZoneMesg.SetField(new Field("FatCalories", 3, 2, 10, 0, "kcal / min", false));
  553. fieldIndex++;
  554. mesgs.Add(metZoneMesg);
  555. MetZoneIndex = mesgIndex;
  556. m_mesgLookup.Add(MesgNum.MetZone, metZoneMesg);
  557. mesgIndex++;
  558. // Goal
  559. Mesg goalMesg = new Mesg("Goal", MesgNum.Goal);
  560. fieldIndex = 0;
  561. goalMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  562. fieldIndex++;
  563. goalMesg.SetField(new Field("Sport", 0, 0, 1, 0, "", false));
  564. fieldIndex++;
  565. goalMesg.SetField(new Field("SubSport", 1, 0, 1, 0, "", false));
  566. fieldIndex++;
  567. goalMesg.SetField(new Field("StartDate", 2, 134, 1, 0, "", false));
  568. fieldIndex++;
  569. goalMesg.SetField(new Field("EndDate", 3, 134, 1, 0, "", false));
  570. fieldIndex++;
  571. goalMesg.SetField(new Field("Type", 4, 0, 1, 0, "", false));
  572. fieldIndex++;
  573. goalMesg.SetField(new Field("Value", 5, 134, 1, 0, "", false));
  574. fieldIndex++;
  575. goalMesg.SetField(new Field("Repeat", 6, 0, 1, 0, "", false));
  576. fieldIndex++;
  577. goalMesg.SetField(new Field("TargetValue", 7, 134, 1, 0, "", false));
  578. fieldIndex++;
  579. goalMesg.SetField(new Field("Recurrence", 8, 0, 1, 0, "", false));
  580. fieldIndex++;
  581. goalMesg.SetField(new Field("RecurrenceValue", 9, 132, 1, 0, "", false));
  582. fieldIndex++;
  583. goalMesg.SetField(new Field("Enabled", 10, 0, 1, 0, "", false));
  584. fieldIndex++;
  585. mesgs.Add(goalMesg);
  586. GoalIndex = mesgIndex;
  587. m_mesgLookup.Add(MesgNum.Goal, goalMesg);
  588. mesgIndex++;
  589. // Activity
  590. Mesg activityMesg = new Mesg("Activity", MesgNum.Activity);
  591. fieldIndex = 0;
  592. activityMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "", false));
  593. fieldIndex++;
  594. activityMesg.SetField(new Field("TotalTimerTime", 0, 134, 1000, 0, "s", false));
  595. fieldIndex++;
  596. activityMesg.SetField(new Field("NumSessions", 1, 132, 1, 0, "", false));
  597. fieldIndex++;
  598. activityMesg.SetField(new Field("Type", 2, 0, 1, 0, "", false));
  599. fieldIndex++;
  600. activityMesg.SetField(new Field("Event", 3, 0, 1, 0, "", false));
  601. fieldIndex++;
  602. activityMesg.SetField(new Field("EventType", 4, 0, 1, 0, "", false));
  603. fieldIndex++;
  604. activityMesg.SetField(new Field("LocalTimestamp", 5, 134, 1, 0, "", false));
  605. fieldIndex++;
  606. activityMesg.SetField(new Field("EventGroup", 6, 2, 1, 0, "", false));
  607. fieldIndex++;
  608. mesgs.Add(activityMesg);
  609. ActivityIndex = mesgIndex;
  610. m_mesgLookup.Add(MesgNum.Activity, activityMesg);
  611. mesgIndex++;
  612. // Session
  613. Mesg sessionMesg = new Mesg("Session", MesgNum.Session);
  614. fieldIndex = 0;
  615. sessionMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  616. fieldIndex++;
  617. sessionMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  618. fieldIndex++;
  619. sessionMesg.SetField(new Field("Event", 0, 0, 1, 0, "", false));
  620. fieldIndex++;
  621. sessionMesg.SetField(new Field("EventType", 1, 0, 1, 0, "", false));
  622. fieldIndex++;
  623. sessionMesg.SetField(new Field("StartTime", 2, 134, 1, 0, "", false));
  624. fieldIndex++;
  625. sessionMesg.SetField(new Field("StartPositionLat", 3, 133, 1, 0, "semicircles", false));
  626. fieldIndex++;
  627. sessionMesg.SetField(new Field("StartPositionLong", 4, 133, 1, 0, "semicircles", false));
  628. fieldIndex++;
  629. sessionMesg.SetField(new Field("Sport", 5, 0, 1, 0, "", false));
  630. fieldIndex++;
  631. sessionMesg.SetField(new Field("SubSport", 6, 0, 1, 0, "", false));
  632. fieldIndex++;
  633. sessionMesg.SetField(new Field("TotalElapsedTime", 7, 134, 1000, 0, "s", false));
  634. fieldIndex++;
  635. sessionMesg.SetField(new Field("TotalTimerTime", 8, 134, 1000, 0, "s", false));
  636. fieldIndex++;
  637. sessionMesg.SetField(new Field("TotalDistance", 9, 134, 100, 0, "m", false));
  638. fieldIndex++;
  639. sessionMesg.SetField(new Field("TotalCycles", 10, 134, 1, 0, "cycles", false));
  640. subfieldIndex = 0;
  641. sessionMesg.fields[fieldIndex].subfields.Add(new Subfield("TotalStrides", 134, 1, 0, "strides"));
  642. sessionMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 1);
  643. sessionMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 11);
  644. subfieldIndex++;
  645. fieldIndex++;
  646. sessionMesg.SetField(new Field("TotalCalories", 11, 132, 1, 0, "kcal", false));
  647. fieldIndex++;
  648. sessionMesg.SetField(new Field("TotalFatCalories", 13, 132, 1, 0, "kcal", false));
  649. fieldIndex++;
  650. sessionMesg.SetField(new Field("AvgSpeed", 14, 132, 1000, 0, "m/s", false));
  651. sessionMesg.fields[fieldIndex].components.Add(new FieldComponent(124, false, 16, 1000, 0)); // enhanced_avg_speed
  652. fieldIndex++;
  653. sessionMesg.SetField(new Field("MaxSpeed", 15, 132, 1000, 0, "m/s", false));
  654. sessionMesg.fields[fieldIndex].components.Add(new FieldComponent(125, false, 16, 1000, 0)); // enhanced_max_speed
  655. fieldIndex++;
  656. sessionMesg.SetField(new Field("AvgHeartRate", 16, 2, 1, 0, "bpm", false));
  657. fieldIndex++;
  658. sessionMesg.SetField(new Field("MaxHeartRate", 17, 2, 1, 0, "bpm", false));
  659. fieldIndex++;
  660. sessionMesg.SetField(new Field("AvgCadence", 18, 2, 1, 0, "rpm", false));
  661. subfieldIndex = 0;
  662. sessionMesg.fields[fieldIndex].subfields.Add(new Subfield("AvgRunningCadence", 2, 1, 0, "strides/min"));
  663. sessionMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 1);
  664. subfieldIndex++;
  665. fieldIndex++;
  666. sessionMesg.SetField(new Field("MaxCadence", 19, 2, 1, 0, "rpm", false));
  667. subfieldIndex = 0;
  668. sessionMesg.fields[fieldIndex].subfields.Add(new Subfield("MaxRunningCadence", 2, 1, 0, "strides/min"));
  669. sessionMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 1);
  670. subfieldIndex++;
  671. fieldIndex++;
  672. sessionMesg.SetField(new Field("AvgPower", 20, 132, 1, 0, "watts", false));
  673. fieldIndex++;
  674. sessionMesg.SetField(new Field("MaxPower", 21, 132, 1, 0, "watts", false));
  675. fieldIndex++;
  676. sessionMesg.SetField(new Field("TotalAscent", 22, 132, 1, 0, "m", false));
  677. fieldIndex++;
  678. sessionMesg.SetField(new Field("TotalDescent", 23, 132, 1, 0, "m", false));
  679. fieldIndex++;
  680. sessionMesg.SetField(new Field("TotalTrainingEffect", 24, 2, 10, 0, "", false));
  681. fieldIndex++;
  682. sessionMesg.SetField(new Field("FirstLapIndex", 25, 132, 1, 0, "", false));
  683. fieldIndex++;
  684. sessionMesg.SetField(new Field("NumLaps", 26, 132, 1, 0, "", false));
  685. fieldIndex++;
  686. sessionMesg.SetField(new Field("EventGroup", 27, 2, 1, 0, "", false));
  687. fieldIndex++;
  688. sessionMesg.SetField(new Field("Trigger", 28, 0, 1, 0, "", false));
  689. fieldIndex++;
  690. sessionMesg.SetField(new Field("NecLat", 29, 133, 1, 0, "semicircles", false));
  691. fieldIndex++;
  692. sessionMesg.SetField(new Field("NecLong", 30, 133, 1, 0, "semicircles", false));
  693. fieldIndex++;
  694. sessionMesg.SetField(new Field("SwcLat", 31, 133, 1, 0, "semicircles", false));
  695. fieldIndex++;
  696. sessionMesg.SetField(new Field("SwcLong", 32, 133, 1, 0, "semicircles", false));
  697. fieldIndex++;
  698. sessionMesg.SetField(new Field("NormalizedPower", 34, 132, 1, 0, "watts", false));
  699. fieldIndex++;
  700. sessionMesg.SetField(new Field("TrainingStressScore", 35, 132, 10, 0, "tss", false));
  701. fieldIndex++;
  702. sessionMesg.SetField(new Field("IntensityFactor", 36, 132, 1000, 0, "if", false));
  703. fieldIndex++;
  704. sessionMesg.SetField(new Field("LeftRightBalance", 37, 132, 1, 0, "", false));
  705. fieldIndex++;
  706. sessionMesg.SetField(new Field("AvgStrokeCount", 41, 134, 10, 0, "strokes/lap", false));
  707. fieldIndex++;
  708. sessionMesg.SetField(new Field("AvgStrokeDistance", 42, 132, 100, 0, "m", false));
  709. fieldIndex++;
  710. sessionMesg.SetField(new Field("SwimStroke", 43, 0, 1, 0, "swim_stroke", false));
  711. fieldIndex++;
  712. sessionMesg.SetField(new Field("PoolLength", 44, 132, 100, 0, "m", false));
  713. fieldIndex++;
  714. sessionMesg.SetField(new Field("ThresholdPower", 45, 132, 1, 0, "watts", false));
  715. fieldIndex++;
  716. sessionMesg.SetField(new Field("PoolLengthUnit", 46, 0, 1, 0, "", false));
  717. fieldIndex++;
  718. sessionMesg.SetField(new Field("NumActiveLengths", 47, 132, 1, 0, "lengths", false));
  719. fieldIndex++;
  720. sessionMesg.SetField(new Field("TotalWork", 48, 134, 1, 0, "J", false));
  721. fieldIndex++;
  722. sessionMesg.SetField(new Field("AvgAltitude", 49, 132, 5, 500, "m", false));
  723. sessionMesg.fields[fieldIndex].components.Add(new FieldComponent(126, false, 16, 5, 500)); // enhanced_avg_altitude
  724. fieldIndex++;
  725. sessionMesg.SetField(new Field("MaxAltitude", 50, 132, 5, 500, "m", false));
  726. sessionMesg.fields[fieldIndex].components.Add(new FieldComponent(128, false, 16, 5, 500)); // enhanced_max_altitude
  727. fieldIndex++;
  728. sessionMesg.SetField(new Field("GpsAccuracy", 51, 2, 1, 0, "m", false));
  729. fieldIndex++;
  730. sessionMesg.SetField(new Field("AvgGrade", 52, 131, 100, 0, "%", false));
  731. fieldIndex++;
  732. sessionMesg.SetField(new Field("AvgPosGrade", 53, 131, 100, 0, "%", false));
  733. fieldIndex++;
  734. sessionMesg.SetField(new Field("AvgNegGrade", 54, 131, 100, 0, "%", false));
  735. fieldIndex++;
  736. sessionMesg.SetField(new Field("MaxPosGrade", 55, 131, 100, 0, "%", false));
  737. fieldIndex++;
  738. sessionMesg.SetField(new Field("MaxNegGrade", 56, 131, 100, 0, "%", false));
  739. fieldIndex++;
  740. sessionMesg.SetField(new Field("AvgTemperature", 57, 1, 1, 0, "C", false));
  741. fieldIndex++;
  742. sessionMesg.SetField(new Field("MaxTemperature", 58, 1, 1, 0, "C", false));
  743. fieldIndex++;
  744. sessionMesg.SetField(new Field("TotalMovingTime", 59, 134, 1000, 0, "s", false));
  745. fieldIndex++;
  746. sessionMesg.SetField(new Field("AvgPosVerticalSpeed", 60, 131, 1000, 0, "m/s", false));
  747. fieldIndex++;
  748. sessionMesg.SetField(new Field("AvgNegVerticalSpeed", 61, 131, 1000, 0, "m/s", false));
  749. fieldIndex++;
  750. sessionMesg.SetField(new Field("MaxPosVerticalSpeed", 62, 131, 1000, 0, "m/s", false));
  751. fieldIndex++;
  752. sessionMesg.SetField(new Field("MaxNegVerticalSpeed", 63, 131, 1000, 0, "m/s", false));
  753. fieldIndex++;
  754. sessionMesg.SetField(new Field("MinHeartRate", 64, 2, 1, 0, "bpm", false));
  755. fieldIndex++;
  756. sessionMesg.SetField(new Field("TimeInHrZone", 65, 134, 1000, 0, "s", false));
  757. fieldIndex++;
  758. sessionMesg.SetField(new Field("TimeInSpeedZone", 66, 134, 1000, 0, "s", false));
  759. fieldIndex++;
  760. sessionMesg.SetField(new Field("TimeInCadenceZone", 67, 134, 1000, 0, "s", false));
  761. fieldIndex++;
  762. sessionMesg.SetField(new Field("TimeInPowerZone", 68, 134, 1000, 0, "s", false));
  763. fieldIndex++;
  764. sessionMesg.SetField(new Field("AvgLapTime", 69, 134, 1000, 0, "s", false));
  765. fieldIndex++;
  766. sessionMesg.SetField(new Field("BestLapIndex", 70, 132, 1, 0, "", false));
  767. fieldIndex++;
  768. sessionMesg.SetField(new Field("MinAltitude", 71, 132, 5, 500, "m", false));
  769. sessionMesg.fields[fieldIndex].components.Add(new FieldComponent(127, false, 16, 5, 500)); // enhanced_min_altitude
  770. fieldIndex++;
  771. sessionMesg.SetField(new Field("PlayerScore", 82, 132, 1, 0, "", false));
  772. fieldIndex++;
  773. sessionMesg.SetField(new Field("OpponentScore", 83, 132, 1, 0, "", false));
  774. fieldIndex++;
  775. sessionMesg.SetField(new Field("OpponentName", 84, 7, 1, 0, "", false));
  776. fieldIndex++;
  777. sessionMesg.SetField(new Field("StrokeCount", 85, 132, 1, 0, "counts", false));
  778. fieldIndex++;
  779. sessionMesg.SetField(new Field("ZoneCount", 86, 132, 1, 0, "counts", false));
  780. fieldIndex++;
  781. sessionMesg.SetField(new Field("MaxBallSpeed", 87, 132, 100, 0, "m/s", false));
  782. fieldIndex++;
  783. sessionMesg.SetField(new Field("AvgBallSpeed", 88, 132, 100, 0, "m/s", false));
  784. fieldIndex++;
  785. sessionMesg.SetField(new Field("AvgVerticalOscillation", 89, 132, 10, 0, "mm", false));
  786. fieldIndex++;
  787. sessionMesg.SetField(new Field("AvgStanceTimePercent", 90, 132, 100, 0, "percent", false));
  788. fieldIndex++;
  789. sessionMesg.SetField(new Field("AvgStanceTime", 91, 132, 10, 0, "ms", false));
  790. fieldIndex++;
  791. sessionMesg.SetField(new Field("AvgFractionalCadence", 92, 2, 128, 0, "rpm", false));
  792. fieldIndex++;
  793. sessionMesg.SetField(new Field("MaxFractionalCadence", 93, 2, 128, 0, "rpm", false));
  794. fieldIndex++;
  795. sessionMesg.SetField(new Field("TotalFractionalCycles", 94, 2, 128, 0, "cycles", false));
  796. fieldIndex++;
  797. sessionMesg.SetField(new Field("AvgTotalHemoglobinConc", 95, 132, 100, 0, "g/dL", false));
  798. fieldIndex++;
  799. sessionMesg.SetField(new Field("MinTotalHemoglobinConc", 96, 132, 100, 0, "g/dL", false));
  800. fieldIndex++;
  801. sessionMesg.SetField(new Field("MaxTotalHemoglobinConc", 97, 132, 100, 0, "g/dL", false));
  802. fieldIndex++;
  803. sessionMesg.SetField(new Field("AvgSaturatedHemoglobinPercent", 98, 132, 10, 0, "%", false));
  804. fieldIndex++;
  805. sessionMesg.SetField(new Field("MinSaturatedHemoglobinPercent", 99, 132, 10, 0, "%", false));
  806. fieldIndex++;
  807. sessionMesg.SetField(new Field("MaxSaturatedHemoglobinPercent", 100, 132, 10, 0, "%", false));
  808. fieldIndex++;
  809. sessionMesg.SetField(new Field("AvgLeftTorqueEffectiveness", 101, 2, 2, 0, "percent", false));
  810. fieldIndex++;
  811. sessionMesg.SetField(new Field("AvgRightTorqueEffectiveness", 102, 2, 2, 0, "percent", false));
  812. fieldIndex++;
  813. sessionMesg.SetField(new Field("AvgLeftPedalSmoothness", 103, 2, 2, 0, "percent", false));
  814. fieldIndex++;
  815. sessionMesg.SetField(new Field("AvgRightPedalSmoothness", 104, 2, 2, 0, "percent", false));
  816. fieldIndex++;
  817. sessionMesg.SetField(new Field("AvgCombinedPedalSmoothness", 105, 2, 2, 0, "percent", false));
  818. fieldIndex++;
  819. sessionMesg.SetField(new Field("SportIndex", 111, 2, 1, 0, "", false));
  820. fieldIndex++;
  821. sessionMesg.SetField(new Field("TimeStanding", 112, 134, 1000, 0, "s", false));
  822. fieldIndex++;
  823. sessionMesg.SetField(new Field("StandCount", 113, 132, 1, 0, "", false));
  824. fieldIndex++;
  825. sessionMesg.SetField(new Field("AvgLeftPco", 114, 1, 1, 0, "mm", false));
  826. fieldIndex++;
  827. sessionMesg.SetField(new Field("AvgRightPco", 115, 1, 1, 0, "mm", false));
  828. fieldIndex++;
  829. sessionMesg.SetField(new Field("AvgLeftPowerPhase", 116, 2, 1, 0, "degrees", false));
  830. fieldIndex++;
  831. sessionMesg.SetField(new Field("AvgLeftPowerPhasePeak", 117, 2, 1, 0, "degrees", false));
  832. fieldIndex++;
  833. sessionMesg.SetField(new Field("AvgRightPowerPhase", 118, 2, 1, 0, "degrees", false));
  834. fieldIndex++;
  835. sessionMesg.SetField(new Field("AvgRightPowerPhasePeak", 119, 2, 1, 0, "degrees", false));
  836. fieldIndex++;
  837. sessionMesg.SetField(new Field("AvgPowerPosition", 120, 132, 1, 0, "watts", false));
  838. fieldIndex++;
  839. sessionMesg.SetField(new Field("MaxPowerPosition", 121, 132, 1, 0, "watts", false));
  840. fieldIndex++;
  841. sessionMesg.SetField(new Field("AvgCadencePosition", 122, 2, 1, 0, "rpm", false));
  842. fieldIndex++;
  843. sessionMesg.SetField(new Field("MaxCadencePosition", 123, 2, 1, 0, "rpm", false));
  844. fieldIndex++;
  845. sessionMesg.SetField(new Field("EnhancedAvgSpeed", 124, 134, 1000, 0, "m/s", false));
  846. fieldIndex++;
  847. sessionMesg.SetField(new Field("EnhancedMaxSpeed", 125, 134, 1000, 0, "m/s", false));
  848. fieldIndex++;
  849. sessionMesg.SetField(new Field("EnhancedAvgAltitude", 126, 134, 5, 500, "m", false));
  850. fieldIndex++;
  851. sessionMesg.SetField(new Field("EnhancedMinAltitude", 127, 134, 5, 500, "m", false));
  852. fieldIndex++;
  853. sessionMesg.SetField(new Field("EnhancedMaxAltitude", 128, 134, 5, 500, "m", false));
  854. fieldIndex++;
  855. sessionMesg.SetField(new Field("AvgLevMotorPower", 129, 132, 1, 0, "watts", false));
  856. fieldIndex++;
  857. sessionMesg.SetField(new Field("MaxLevMotorPower", 130, 132, 1, 0, "watts", false));
  858. fieldIndex++;
  859. sessionMesg.SetField(new Field("LevBatteryConsumption", 131, 2, 2, 0, "percent", false));
  860. fieldIndex++;
  861. mesgs.Add(sessionMesg);
  862. SessionIndex = mesgIndex;
  863. m_mesgLookup.Add(MesgNum.Session, sessionMesg);
  864. mesgIndex++;
  865. // Lap
  866. Mesg lapMesg = new Mesg("Lap", MesgNum.Lap);
  867. fieldIndex = 0;
  868. lapMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  869. fieldIndex++;
  870. lapMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  871. fieldIndex++;
  872. lapMesg.SetField(new Field("Event", 0, 0, 1, 0, "", false));
  873. fieldIndex++;
  874. lapMesg.SetField(new Field("EventType", 1, 0, 1, 0, "", false));
  875. fieldIndex++;
  876. lapMesg.SetField(new Field("StartTime", 2, 134, 1, 0, "", false));
  877. fieldIndex++;
  878. lapMesg.SetField(new Field("StartPositionLat", 3, 133, 1, 0, "semicircles", false));
  879. fieldIndex++;
  880. lapMesg.SetField(new Field("StartPositionLong", 4, 133, 1, 0, "semicircles", false));
  881. fieldIndex++;
  882. lapMesg.SetField(new Field("EndPositionLat", 5, 133, 1, 0, "semicircles", false));
  883. fieldIndex++;
  884. lapMesg.SetField(new Field("EndPositionLong", 6, 133, 1, 0, "semicircles", false));
  885. fieldIndex++;
  886. lapMesg.SetField(new Field("TotalElapsedTime", 7, 134, 1000, 0, "s", false));
  887. fieldIndex++;
  888. lapMesg.SetField(new Field("TotalTimerTime", 8, 134, 1000, 0, "s", false));
  889. fieldIndex++;
  890. lapMesg.SetField(new Field("TotalDistance", 9, 134, 100, 0, "m", false));
  891. fieldIndex++;
  892. lapMesg.SetField(new Field("TotalCycles", 10, 134, 1, 0, "cycles", false));
  893. subfieldIndex = 0;
  894. lapMesg.fields[fieldIndex].subfields.Add(new Subfield("TotalStrides", 134, 1, 0, "strides"));
  895. lapMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 1);
  896. lapMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 11);
  897. subfieldIndex++;
  898. fieldIndex++;
  899. lapMesg.SetField(new Field("TotalCalories", 11, 132, 1, 0, "kcal", false));
  900. fieldIndex++;
  901. lapMesg.SetField(new Field("TotalFatCalories", 12, 132, 1, 0, "kcal", false));
  902. fieldIndex++;
  903. lapMesg.SetField(new Field("AvgSpeed", 13, 132, 1000, 0, "m/s", false));
  904. lapMesg.fields[fieldIndex].components.Add(new FieldComponent(110, false, 16, 1000, 0)); // enhanced_avg_speed
  905. fieldIndex++;
  906. lapMesg.SetField(new Field("MaxSpeed", 14, 132, 1000, 0, "m/s", false));
  907. lapMesg.fields[fieldIndex].components.Add(new FieldComponent(111, false, 16, 1000, 0)); // enhanced_max_speed
  908. fieldIndex++;
  909. lapMesg.SetField(new Field("AvgHeartRate", 15, 2, 1, 0, "bpm", false));
  910. fieldIndex++;
  911. lapMesg.SetField(new Field("MaxHeartRate", 16, 2, 1, 0, "bpm", false));
  912. fieldIndex++;
  913. lapMesg.SetField(new Field("AvgCadence", 17, 2, 1, 0, "rpm", false));
  914. subfieldIndex = 0;
  915. lapMesg.fields[fieldIndex].subfields.Add(new Subfield("AvgRunningCadence", 2, 1, 0, "strides/min"));
  916. lapMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 1);
  917. subfieldIndex++;
  918. fieldIndex++;
  919. lapMesg.SetField(new Field("MaxCadence", 18, 2, 1, 0, "rpm", false));
  920. subfieldIndex = 0;
  921. lapMesg.fields[fieldIndex].subfields.Add(new Subfield("MaxRunningCadence", 2, 1, 0, "strides/min"));
  922. lapMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 1);
  923. subfieldIndex++;
  924. fieldIndex++;
  925. lapMesg.SetField(new Field("AvgPower", 19, 132, 1, 0, "watts", false));
  926. fieldIndex++;
  927. lapMesg.SetField(new Field("MaxPower", 20, 132, 1, 0, "watts", false));
  928. fieldIndex++;
  929. lapMesg.SetField(new Field("TotalAscent", 21, 132, 1, 0, "m", false));
  930. fieldIndex++;
  931. lapMesg.SetField(new Field("TotalDescent", 22, 132, 1, 0, "m", false));
  932. fieldIndex++;
  933. lapMesg.SetField(new Field("Intensity", 23, 0, 1, 0, "", false));
  934. fieldIndex++;
  935. lapMesg.SetField(new Field("LapTrigger", 24, 0, 1, 0, "", false));
  936. fieldIndex++;
  937. lapMesg.SetField(new Field("Sport", 25, 0, 1, 0, "", false));
  938. fieldIndex++;
  939. lapMesg.SetField(new Field("EventGroup", 26, 2, 1, 0, "", false));
  940. fieldIndex++;
  941. lapMesg.SetField(new Field("NumLengths", 32, 132, 1, 0, "lengths", false));
  942. fieldIndex++;
  943. lapMesg.SetField(new Field("NormalizedPower", 33, 132, 1, 0, "watts", false));
  944. fieldIndex++;
  945. lapMesg.SetField(new Field("LeftRightBalance", 34, 132, 1, 0, "", false));
  946. fieldIndex++;
  947. lapMesg.SetField(new Field("FirstLengthIndex", 35, 132, 1, 0, "", false));
  948. fieldIndex++;
  949. lapMesg.SetField(new Field("AvgStrokeDistance", 37, 132, 100, 0, "m", false));
  950. fieldIndex++;
  951. lapMesg.SetField(new Field("SwimStroke", 38, 0, 1, 0, "", false));
  952. fieldIndex++;
  953. lapMesg.SetField(new Field("SubSport", 39, 0, 1, 0, "", false));
  954. fieldIndex++;
  955. lapMesg.SetField(new Field("NumActiveLengths", 40, 132, 1, 0, "lengths", false));
  956. fieldIndex++;
  957. lapMesg.SetField(new Field("TotalWork", 41, 134, 1, 0, "J", false));
  958. fieldIndex++;
  959. lapMesg.SetField(new Field("AvgAltitude", 42, 132, 5, 500, "m", false));
  960. lapMesg.fields[fieldIndex].components.Add(new FieldComponent(112, false, 16, 5, 500)); // enhanced_avg_altitude
  961. fieldIndex++;
  962. lapMesg.SetField(new Field("MaxAltitude", 43, 132, 5, 500, "m", false));
  963. lapMesg.fields[fieldIndex].components.Add(new FieldComponent(114, false, 16, 5, 500)); // enhanced_max_altitude
  964. fieldIndex++;
  965. lapMesg.SetField(new Field("GpsAccuracy", 44, 2, 1, 0, "m", false));
  966. fieldIndex++;
  967. lapMesg.SetField(new Field("AvgGrade", 45, 131, 100, 0, "%", false));
  968. fieldIndex++;
  969. lapMesg.SetField(new Field("AvgPosGrade", 46, 131, 100, 0, "%", false));
  970. fieldIndex++;
  971. lapMesg.SetField(new Field("AvgNegGrade", 47, 131, 100, 0, "%", false));
  972. fieldIndex++;
  973. lapMesg.SetField(new Field("MaxPosGrade", 48, 131, 100, 0, "%", false));
  974. fieldIndex++;
  975. lapMesg.SetField(new Field("MaxNegGrade", 49, 131, 100, 0, "%", false));
  976. fieldIndex++;
  977. lapMesg.SetField(new Field("AvgTemperature", 50, 1, 1, 0, "C", false));
  978. fieldIndex++;
  979. lapMesg.SetField(new Field("MaxTemperature", 51, 1, 1, 0, "C", false));
  980. fieldIndex++;
  981. lapMesg.SetField(new Field("TotalMovingTime", 52, 134, 1000, 0, "s", false));
  982. fieldIndex++;
  983. lapMesg.SetField(new Field("AvgPosVerticalSpeed", 53, 131, 1000, 0, "m/s", false));
  984. fieldIndex++;
  985. lapMesg.SetField(new Field("AvgNegVerticalSpeed", 54, 131, 1000, 0, "m/s", false));
  986. fieldIndex++;
  987. lapMesg.SetField(new Field("MaxPosVerticalSpeed", 55, 131, 1000, 0, "m/s", false));
  988. fieldIndex++;
  989. lapMesg.SetField(new Field("MaxNegVerticalSpeed", 56, 131, 1000, 0, "m/s", false));
  990. fieldIndex++;
  991. lapMesg.SetField(new Field("TimeInHrZone", 57, 134, 1000, 0, "s", false));
  992. fieldIndex++;
  993. lapMesg.SetField(new Field("TimeInSpeedZone", 58, 134, 1000, 0, "s", false));
  994. fieldIndex++;
  995. lapMesg.SetField(new Field("TimeInCadenceZone", 59, 134, 1000, 0, "s", false));
  996. fieldIndex++;
  997. lapMesg.SetField(new Field("TimeInPowerZone", 60, 134, 1000, 0, "s", false));
  998. fieldIndex++;
  999. lapMesg.SetField(new Field("RepetitionNum", 61, 132, 1, 0, "", false));
  1000. fieldIndex++;
  1001. lapMesg.SetField(new Field("MinAltitude", 62, 132, 5, 500, "m", false));
  1002. lapMesg.fields[fieldIndex].components.Add(new FieldComponent(113, false, 16, 5, 500)); // enhanced_min_altitude
  1003. fieldIndex++;
  1004. lapMesg.SetField(new Field("MinHeartRate", 63, 2, 1, 0, "bpm", false));
  1005. fieldIndex++;
  1006. lapMesg.SetField(new Field("WktStepIndex", 71, 132, 1, 0, "", false));
  1007. fieldIndex++;
  1008. lapMesg.SetField(new Field("OpponentScore", 74, 132, 1, 0, "", false));
  1009. fieldIndex++;
  1010. lapMesg.SetField(new Field("StrokeCount", 75, 132, 1, 0, "counts", false));
  1011. fieldIndex++;
  1012. lapMesg.SetField(new Field("ZoneCount", 76, 132, 1, 0, "counts", false));
  1013. fieldIndex++;
  1014. lapMesg.SetField(new Field("AvgVerticalOscillation", 77, 132, 10, 0, "mm", false));
  1015. fieldIndex++;
  1016. lapMesg.SetField(new Field("AvgStanceTimePercent", 78, 132, 100, 0, "percent", false));
  1017. fieldIndex++;
  1018. lapMesg.SetField(new Field("AvgStanceTime", 79, 132, 10, 0, "ms", false));
  1019. fieldIndex++;
  1020. lapMesg.SetField(new Field("AvgFractionalCadence", 80, 2, 128, 0, "rpm", false));
  1021. fieldIndex++;
  1022. lapMesg.SetField(new Field("MaxFractionalCadence", 81, 2, 128, 0, "rpm", false));
  1023. fieldIndex++;
  1024. lapMesg.SetField(new Field("TotalFractionalCycles", 82, 2, 128, 0, "cycles", false));
  1025. fieldIndex++;
  1026. lapMesg.SetField(new Field("PlayerScore", 83, 132, 1, 0, "", false));
  1027. fieldIndex++;
  1028. lapMesg.SetField(new Field("AvgTotalHemoglobinConc", 84, 132, 100, 0, "g/dL", false));
  1029. fieldIndex++;
  1030. lapMesg.SetField(new Field("MinTotalHemoglobinConc", 85, 132, 100, 0, "g/dL", false));
  1031. fieldIndex++;
  1032. lapMesg.SetField(new Field("MaxTotalHemoglobinConc", 86, 132, 100, 0, "g/dL", false));
  1033. fieldIndex++;
  1034. lapMesg.SetField(new Field("AvgSaturatedHemoglobinPercent", 87, 132, 10, 0, "%", false));
  1035. fieldIndex++;
  1036. lapMesg.SetField(new Field("MinSaturatedHemoglobinPercent", 88, 132, 10, 0, "%", false));
  1037. fieldIndex++;
  1038. lapMesg.SetField(new Field("MaxSaturatedHemoglobinPercent", 89, 132, 10, 0, "%", false));
  1039. fieldIndex++;
  1040. lapMesg.SetField(new Field("AvgLeftTorqueEffectiveness", 91, 2, 2, 0, "percent", false));
  1041. fieldIndex++;
  1042. lapMesg.SetField(new Field("AvgRightTorqueEffectiveness", 92, 2, 2, 0, "percent", false));
  1043. fieldIndex++;
  1044. lapMesg.SetField(new Field("AvgLeftPedalSmoothness", 93, 2, 2, 0, "percent", false));
  1045. fieldIndex++;
  1046. lapMesg.SetField(new Field("AvgRightPedalSmoothness", 94, 2, 2, 0, "percent", false));
  1047. fieldIndex++;
  1048. lapMesg.SetField(new Field("AvgCombinedPedalSmoothness", 95, 2, 2, 0, "percent", false));
  1049. fieldIndex++;
  1050. lapMesg.SetField(new Field("TimeStanding", 98, 134, 1000, 0, "s", false));
  1051. fieldIndex++;
  1052. lapMesg.SetField(new Field("StandCount", 99, 132, 1, 0, "", false));
  1053. fieldIndex++;
  1054. lapMesg.SetField(new Field("AvgLeftPco", 100, 1, 1, 0, "mm", false));
  1055. fieldIndex++;
  1056. lapMesg.SetField(new Field("AvgRightPco", 101, 1, 1, 0, "mm", false));
  1057. fieldIndex++;
  1058. lapMesg.SetField(new Field("AvgLeftPowerPhase", 102, 2, 1, 0, "degrees", false));
  1059. fieldIndex++;
  1060. lapMesg.SetField(new Field("AvgLeftPowerPhasePeak", 103, 2, 1, 0, "degrees", false));
  1061. fieldIndex++;
  1062. lapMesg.SetField(new Field("AvgRightPowerPhase", 104, 2, 1, 0, "degrees", false));
  1063. fieldIndex++;
  1064. lapMesg.SetField(new Field("AvgRightPowerPhasePeak", 105, 2, 1, 0, "degrees", false));
  1065. fieldIndex++;
  1066. lapMesg.SetField(new Field("AvgPowerPosition", 106, 132, 1, 0, "watts", false));
  1067. fieldIndex++;
  1068. lapMesg.SetField(new Field("MaxPowerPosition", 107, 132, 1, 0, "watts", false));
  1069. fieldIndex++;
  1070. lapMesg.SetField(new Field("AvgCadencePosition", 108, 2, 1, 0, "rpm", false));
  1071. fieldIndex++;
  1072. lapMesg.SetField(new Field("MaxCadencePosition", 109, 2, 1, 0, "rpm", false));
  1073. fieldIndex++;
  1074. lapMesg.SetField(new Field("EnhancedAvgSpeed", 110, 134, 1000, 0, "m/s", false));
  1075. fieldIndex++;
  1076. lapMesg.SetField(new Field("EnhancedMaxSpeed", 111, 134, 1000, 0, "m/s", false));
  1077. fieldIndex++;
  1078. lapMesg.SetField(new Field("EnhancedAvgAltitude", 112, 134, 5, 500, "m", false));
  1079. fieldIndex++;
  1080. lapMesg.SetField(new Field("EnhancedMinAltitude", 113, 134, 5, 500, "m", false));
  1081. fieldIndex++;
  1082. lapMesg.SetField(new Field("EnhancedMaxAltitude", 114, 134, 5, 500, "m", false));
  1083. fieldIndex++;
  1084. lapMesg.SetField(new Field("AvgLevMotorPower", 115, 132, 1, 0, "watts", false));
  1085. fieldIndex++;
  1086. lapMesg.SetField(new Field("MaxLevMotorPower", 116, 132, 1, 0, "watts", false));
  1087. fieldIndex++;
  1088. lapMesg.SetField(new Field("LevBatteryConsumption", 117, 2, 2, 0, "percent", false));
  1089. fieldIndex++;
  1090. mesgs.Add(lapMesg);
  1091. LapIndex = mesgIndex;
  1092. m_mesgLookup.Add(MesgNum.Lap, lapMesg);
  1093. mesgIndex++;
  1094. // Length
  1095. Mesg lengthMesg = new Mesg("Length", MesgNum.Length);
  1096. fieldIndex = 0;
  1097. lengthMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1098. fieldIndex++;
  1099. lengthMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "", false));
  1100. fieldIndex++;
  1101. lengthMesg.SetField(new Field("Event", 0, 0, 1, 0, "", false));
  1102. fieldIndex++;
  1103. lengthMesg.SetField(new Field("EventType", 1, 0, 1, 0, "", false));
  1104. fieldIndex++;
  1105. lengthMesg.SetField(new Field("StartTime", 2, 134, 1, 0, "", false));
  1106. fieldIndex++;
  1107. lengthMesg.SetField(new Field("TotalElapsedTime", 3, 134, 1000, 0, "s", false));
  1108. fieldIndex++;
  1109. lengthMesg.SetField(new Field("TotalTimerTime", 4, 134, 1000, 0, "s", false));
  1110. fieldIndex++;
  1111. lengthMesg.SetField(new Field("TotalStrokes", 5, 132, 1, 0, "strokes", false));
  1112. fieldIndex++;
  1113. lengthMesg.SetField(new Field("AvgSpeed", 6, 132, 1000, 0, "m/s", false));
  1114. fieldIndex++;
  1115. lengthMesg.SetField(new Field("SwimStroke", 7, 0, 1, 0, "swim_stroke", false));
  1116. fieldIndex++;
  1117. lengthMesg.SetField(new Field("AvgSwimmingCadence", 9, 2, 1, 0, "strokes/min", false));
  1118. fieldIndex++;
  1119. lengthMesg.SetField(new Field("EventGroup", 10, 2, 1, 0, "", false));
  1120. fieldIndex++;
  1121. lengthMesg.SetField(new Field("TotalCalories", 11, 132, 1, 0, "kcal", false));
  1122. fieldIndex++;
  1123. lengthMesg.SetField(new Field("LengthType", 12, 0, 1, 0, "", false));
  1124. fieldIndex++;
  1125. lengthMesg.SetField(new Field("PlayerScore", 18, 132, 1, 0, "", false));
  1126. fieldIndex++;
  1127. lengthMesg.SetField(new Field("OpponentScore", 19, 132, 1, 0, "", false));
  1128. fieldIndex++;
  1129. lengthMesg.SetField(new Field("StrokeCount", 20, 132, 1, 0, "counts", false));
  1130. fieldIndex++;
  1131. lengthMesg.SetField(new Field("ZoneCount", 21, 132, 1, 0, "counts", false));
  1132. fieldIndex++;
  1133. mesgs.Add(lengthMesg);
  1134. LengthIndex = mesgIndex;
  1135. m_mesgLookup.Add(MesgNum.Length, lengthMesg);
  1136. mesgIndex++;
  1137. // Record
  1138. Mesg recordMesg = new Mesg("Record", MesgNum.Record);
  1139. fieldIndex = 0;
  1140. recordMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1141. fieldIndex++;
  1142. recordMesg.SetField(new Field("PositionLat", 0, 133, 1, 0, "semicircles", false));
  1143. fieldIndex++;
  1144. recordMesg.SetField(new Field("PositionLong", 1, 133, 1, 0, "semicircles", false));
  1145. fieldIndex++;
  1146. recordMesg.SetField(new Field("Altitude", 2, 132, 5, 500, "m", false));
  1147. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(78, false, 16, 5, 500)); // enhanced_altitude
  1148. fieldIndex++;
  1149. recordMesg.SetField(new Field("HeartRate", 3, 2, 1, 0, "bpm", false));
  1150. fieldIndex++;
  1151. recordMesg.SetField(new Field("Cadence", 4, 2, 1, 0, "rpm", false));
  1152. fieldIndex++;
  1153. recordMesg.SetField(new Field("Distance", 5, 134, 100, 0, "m", true));
  1154. fieldIndex++;
  1155. recordMesg.SetField(new Field("Speed", 6, 132, 1000, 0, "m/s", false));
  1156. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(73, false, 16, 1000, 0)); // enhanced_speed
  1157. fieldIndex++;
  1158. recordMesg.SetField(new Field("Power", 7, 132, 1, 0, "watts", false));
  1159. fieldIndex++;
  1160. recordMesg.SetField(new Field("CompressedSpeedDistance", 8, 13, 1, 0, "", false));
  1161. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(6, false, 12, 100, 0)); // speed
  1162. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(5, true, 12, 16, 0)); // distance
  1163. fieldIndex++;
  1164. recordMesg.SetField(new Field("Grade", 9, 131, 100, 0, "%", false));
  1165. fieldIndex++;
  1166. recordMesg.SetField(new Field("Resistance", 10, 2, 1, 0, "", false));
  1167. fieldIndex++;
  1168. recordMesg.SetField(new Field("TimeFromCourse", 11, 133, 1000, 0, "s", false));
  1169. fieldIndex++;
  1170. recordMesg.SetField(new Field("CycleLength", 12, 2, 100, 0, "m", false));
  1171. fieldIndex++;
  1172. recordMesg.SetField(new Field("Temperature", 13, 1, 1, 0, "C", false));
  1173. fieldIndex++;
  1174. recordMesg.SetField(new Field("Speed1s", 17, 2, 16, 0, "m/s", false));
  1175. fieldIndex++;
  1176. recordMesg.SetField(new Field("Cycles", 18, 2, 1, 0, "cycles", false));
  1177. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(19, true, 8, 1, 0)); // total_cycles
  1178. fieldIndex++;
  1179. recordMesg.SetField(new Field("TotalCycles", 19, 134, 1, 0, "cycles", true));
  1180. fieldIndex++;
  1181. recordMesg.SetField(new Field("CompressedAccumulatedPower", 28, 132, 1, 0, "watts", false));
  1182. recordMesg.fields[fieldIndex].components.Add(new FieldComponent(29, true, 16, 1, 0)); // accumulated_power
  1183. fieldIndex++;
  1184. recordMesg.SetField(new Field("AccumulatedPower", 29, 134, 1, 0, "watts", true));
  1185. fieldIndex++;
  1186. recordMesg.SetField(new Field("LeftRightBalance", 30, 2, 1, 0, "", false));
  1187. fieldIndex++;
  1188. recordMesg.SetField(new Field("GpsAccuracy", 31, 2, 1, 0, "m", false));
  1189. fieldIndex++;
  1190. recordMesg.SetField(new Field("VerticalSpeed", 32, 131, 1000, 0, "m/s", false));
  1191. fieldIndex++;
  1192. recordMesg.SetField(new Field("Calories", 33, 132, 1, 0, "kcal", false));
  1193. fieldIndex++;
  1194. recordMesg.SetField(new Field("VerticalOscillation", 39, 132, 10, 0, "mm", false));
  1195. fieldIndex++;
  1196. recordMesg.SetField(new Field("StanceTimePercent", 40, 132, 100, 0, "percent", false));
  1197. fieldIndex++;
  1198. recordMesg.SetField(new Field("StanceTime", 41, 132, 10, 0, "ms", false));
  1199. fieldIndex++;
  1200. recordMesg.SetField(new Field("ActivityType", 42, 0, 1, 0, "", false));
  1201. fieldIndex++;
  1202. recordMesg.SetField(new Field("LeftTorqueEffectiveness", 43, 2, 2, 0, "percent", false));
  1203. fieldIndex++;
  1204. recordMesg.SetField(new Field("RightTorqueEffectiveness", 44, 2, 2, 0, "percent", false));
  1205. fieldIndex++;
  1206. recordMesg.SetField(new Field("LeftPedalSmoothness", 45, 2, 2, 0, "percent", false));
  1207. fieldIndex++;
  1208. recordMesg.SetField(new Field("RightPedalSmoothness", 46, 2, 2, 0, "percent", false));
  1209. fieldIndex++;
  1210. recordMesg.SetField(new Field("CombinedPedalSmoothness", 47, 2, 2, 0, "percent", false));
  1211. fieldIndex++;
  1212. recordMesg.SetField(new Field("Time128", 48, 2, 128, 0, "s", false));
  1213. fieldIndex++;
  1214. recordMesg.SetField(new Field("StrokeType", 49, 0, 1, 0, "", false));
  1215. fieldIndex++;
  1216. recordMesg.SetField(new Field("Zone", 50, 2, 1, 0, "", false));
  1217. fieldIndex++;
  1218. recordMesg.SetField(new Field("BallSpeed", 51, 132, 100, 0, "m/s", false));
  1219. fieldIndex++;
  1220. recordMesg.SetField(new Field("Cadence256", 52, 132, 256, 0, "rpm", false));
  1221. fieldIndex++;
  1222. recordMesg.SetField(new Field("FractionalCadence", 53, 2, 128, 0, "rpm", false));
  1223. fieldIndex++;
  1224. recordMesg.SetField(new Field("TotalHemoglobinConc", 54, 132, 100, 0, "g/dL", false));
  1225. fieldIndex++;
  1226. recordMesg.SetField(new Field("TotalHemoglobinConcMin", 55, 132, 100, 0, "g/dL", false));
  1227. fieldIndex++;
  1228. recordMesg.SetField(new Field("TotalHemoglobinConcMax", 56, 132, 100, 0, "g/dL", false));
  1229. fieldIndex++;
  1230. recordMesg.SetField(new Field("SaturatedHemoglobinPercent", 57, 132, 10, 0, "%", false));
  1231. fieldIndex++;
  1232. recordMesg.SetField(new Field("SaturatedHemoglobinPercentMin", 58, 132, 10, 0, "%", false));
  1233. fieldIndex++;
  1234. recordMesg.SetField(new Field("SaturatedHemoglobinPercentMax", 59, 132, 10, 0, "%", false));
  1235. fieldIndex++;
  1236. recordMesg.SetField(new Field("DeviceIndex", 62, 2, 1, 0, "", false));
  1237. fieldIndex++;
  1238. recordMesg.SetField(new Field("LeftPco", 67, 1, 1, 0, "mm", false));
  1239. fieldIndex++;
  1240. recordMesg.SetField(new Field("RightPco", 68, 1, 1, 0, "mm", false));
  1241. fieldIndex++;
  1242. recordMesg.SetField(new Field("LeftPowerPhase", 69, 2, 1, 0, "degrees", false));
  1243. fieldIndex++;
  1244. recordMesg.SetField(new Field("LeftPowerPhasePeak", 70, 2, 1, 0, "degrees", false));
  1245. fieldIndex++;
  1246. recordMesg.SetField(new Field("RightPowerPhase", 71, 2, 1, 0, "degrees", false));
  1247. fieldIndex++;
  1248. recordMesg.SetField(new Field("RightPowerPhasePeak", 72, 2, 1, 0, "degrees", false));
  1249. fieldIndex++;
  1250. recordMesg.SetField(new Field("EnhancedSpeed", 73, 134, 1000, 0, "m/s", false));
  1251. fieldIndex++;
  1252. recordMesg.SetField(new Field("EnhancedAltitude", 78, 134, 5, 500, "m", false));
  1253. fieldIndex++;
  1254. recordMesg.SetField(new Field("BatterySoc", 81, 2, 2, 0, "percent", false));
  1255. fieldIndex++;
  1256. recordMesg.SetField(new Field("MotorPower", 82, 132, 1, 0, "watts", false));
  1257. fieldIndex++;
  1258. mesgs.Add(recordMesg);
  1259. RecordIndex = mesgIndex;
  1260. m_mesgLookup.Add(MesgNum.Record, recordMesg);
  1261. mesgIndex++;
  1262. // Event
  1263. Mesg eventMesg = new Mesg("Event", MesgNum.Event);
  1264. fieldIndex = 0;
  1265. eventMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1266. fieldIndex++;
  1267. eventMesg.SetField(new Field("Event", 0, 0, 1, 0, "", false));
  1268. fieldIndex++;
  1269. eventMesg.SetField(new Field("EventType", 1, 0, 1, 0, "", false));
  1270. fieldIndex++;
  1271. eventMesg.SetField(new Field("Data16", 2, 132, 1, 0, "", false));
  1272. eventMesg.fields[fieldIndex].components.Add(new FieldComponent(3, false, 16, 1, 0)); // data
  1273. fieldIndex++;
  1274. eventMesg.SetField(new Field("Data", 3, 134, 1, 0, "", false));
  1275. subfieldIndex = 0;
  1276. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("TimerTrigger", 0, 1, 0, ""));
  1277. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 0);
  1278. subfieldIndex++;
  1279. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("CoursePointIndex", 132, 1, 0, ""));
  1280. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 10);
  1281. subfieldIndex++;
  1282. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("BatteryLevel", 132, 1000, 0, "V"));
  1283. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 11);
  1284. subfieldIndex++;
  1285. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("VirtualPartnerSpeed", 132, 1000, 0, "m/s"));
  1286. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 12);
  1287. subfieldIndex++;
  1288. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("HrHighAlert", 2, 1, 0, "bpm"));
  1289. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 13);
  1290. subfieldIndex++;
  1291. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("HrLowAlert", 2, 1, 0, "bpm"));
  1292. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 14);
  1293. subfieldIndex++;
  1294. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("SpeedHighAlert", 134, 1000, 0, "m/s"));
  1295. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 15);
  1296. subfieldIndex++;
  1297. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("SpeedLowAlert", 134, 1000, 0, "m/s"));
  1298. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 16);
  1299. subfieldIndex++;
  1300. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("CadHighAlert", 132, 1, 0, "rpm"));
  1301. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 17);
  1302. subfieldIndex++;
  1303. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("CadLowAlert", 132, 1, 0, "rpm"));
  1304. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 18);
  1305. subfieldIndex++;
  1306. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("PowerHighAlert", 132, 1, 0, "watts"));
  1307. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 19);
  1308. subfieldIndex++;
  1309. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("PowerLowAlert", 132, 1, 0, "watts"));
  1310. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 20);
  1311. subfieldIndex++;
  1312. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("TimeDurationAlert", 134, 1000, 0, "s"));
  1313. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 23);
  1314. subfieldIndex++;
  1315. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("DistanceDurationAlert", 134, 100, 0, "m"));
  1316. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 24);
  1317. subfieldIndex++;
  1318. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("CalorieDurationAlert", 134, 1, 0, "calories"));
  1319. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 25);
  1320. subfieldIndex++;
  1321. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("FitnessEquipmentState", 0, 1, 0, ""));
  1322. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 27);
  1323. subfieldIndex++;
  1324. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("SportPoint", 134, 1, 0, ""));
  1325. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 33);
  1326. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(7, false, 16, 1, 0)); // score
  1327. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(8, false, 16, 1, 0)); // opponent_score
  1328. subfieldIndex++;
  1329. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("GearChangeData", 134, 1, 0, ""));
  1330. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 42);
  1331. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 43);
  1332. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(11, false, 8, 1, 0)); // rear_gear_num
  1333. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(12, false, 8, 1, 0)); // rear_gear
  1334. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(9, false, 8, 1, 0)); // front_gear_num
  1335. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddComponent(new FieldComponent(10, false, 8, 1, 0)); // front_gear
  1336. subfieldIndex++;
  1337. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("RiderPosition", 0, 1, 0, ""));
  1338. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 44);
  1339. subfieldIndex++;
  1340. eventMesg.fields[fieldIndex].subfields.Add(new Subfield("CommTimeout", 132, 1, 0, ""));
  1341. eventMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 47);
  1342. subfieldIndex++;
  1343. fieldIndex++;
  1344. eventMesg.SetField(new Field("EventGroup", 4, 2, 1, 0, "", false));
  1345. fieldIndex++;
  1346. eventMesg.SetField(new Field("Score", 7, 132, 1, 0, "", false));
  1347. fieldIndex++;
  1348. eventMesg.SetField(new Field("OpponentScore", 8, 132, 1, 0, "", false));
  1349. fieldIndex++;
  1350. eventMesg.SetField(new Field("FrontGearNum", 9, 10, 1, 0, "", false));
  1351. fieldIndex++;
  1352. eventMesg.SetField(new Field("FrontGear", 10, 10, 1, 0, "", false));
  1353. fieldIndex++;
  1354. eventMesg.SetField(new Field("RearGearNum", 11, 10, 1, 0, "", false));
  1355. fieldIndex++;
  1356. eventMesg.SetField(new Field("RearGear", 12, 10, 1, 0, "", false));
  1357. fieldIndex++;
  1358. eventMesg.SetField(new Field("DeviceIndex", 13, 2, 1, 0, "", false));
  1359. fieldIndex++;
  1360. mesgs.Add(eventMesg);
  1361. EventIndex = mesgIndex;
  1362. m_mesgLookup.Add(MesgNum.Event, eventMesg);
  1363. mesgIndex++;
  1364. // DeviceInfo
  1365. Mesg deviceInfoMesg = new Mesg("DeviceInfo", MesgNum.DeviceInfo);
  1366. fieldIndex = 0;
  1367. deviceInfoMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1368. fieldIndex++;
  1369. deviceInfoMesg.SetField(new Field("DeviceIndex", 0, 2, 1, 0, "", false));
  1370. fieldIndex++;
  1371. deviceInfoMesg.SetField(new Field("DeviceType", 1, 2, 1, 0, "", false));
  1372. subfieldIndex = 0;
  1373. deviceInfoMesg.fields[fieldIndex].subfields.Add(new Subfield("AntplusDeviceType", 2, 1, 0, ""));
  1374. deviceInfoMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 1);
  1375. subfieldIndex++;
  1376. deviceInfoMesg.fields[fieldIndex].subfields.Add(new Subfield("AntDeviceType", 2, 1, 0, ""));
  1377. deviceInfoMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(25, 0);
  1378. subfieldIndex++;
  1379. fieldIndex++;
  1380. deviceInfoMesg.SetField(new Field("Manufacturer", 2, 132, 1, 0, "", false));
  1381. fieldIndex++;
  1382. deviceInfoMesg.SetField(new Field("SerialNumber", 3, 140, 1, 0, "", false));
  1383. fieldIndex++;
  1384. deviceInfoMesg.SetField(new Field("Product", 4, 132, 1, 0, "", false));
  1385. subfieldIndex = 0;
  1386. deviceInfoMesg.fields[fieldIndex].subfields.Add(new Subfield("GarminProduct", 132, 1, 0, ""));
  1387. deviceInfoMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 1);
  1388. deviceInfoMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 15);
  1389. deviceInfoMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(2, 13);
  1390. subfieldIndex++;
  1391. fieldIndex++;
  1392. deviceInfoMesg.SetField(new Field("SoftwareVersion", 5, 132, 100, 0, "", false));
  1393. fieldIndex++;
  1394. deviceInfoMesg.SetField(new Field("HardwareVersion", 6, 2, 1, 0, "", false));
  1395. fieldIndex++;
  1396. deviceInfoMesg.SetField(new Field("CumOperatingTime", 7, 134, 1, 0, "s", false));
  1397. fieldIndex++;
  1398. deviceInfoMesg.SetField(new Field("BatteryVoltage", 10, 132, 256, 0, "V", false));
  1399. fieldIndex++;
  1400. deviceInfoMesg.SetField(new Field("BatteryStatus", 11, 2, 1, 0, "", false));
  1401. fieldIndex++;
  1402. deviceInfoMesg.SetField(new Field("SensorPosition", 18, 0, 1, 0, "", false));
  1403. fieldIndex++;
  1404. deviceInfoMesg.SetField(new Field("Descriptor", 19, 7, 1, 0, "", false));
  1405. fieldIndex++;
  1406. deviceInfoMesg.SetField(new Field("AntTransmissionType", 20, 10, 1, 0, "", false));
  1407. fieldIndex++;
  1408. deviceInfoMesg.SetField(new Field("AntDeviceNumber", 21, 139, 1, 0, "", false));
  1409. fieldIndex++;
  1410. deviceInfoMesg.SetField(new Field("AntNetwork", 22, 0, 1, 0, "", false));
  1411. fieldIndex++;
  1412. deviceInfoMesg.SetField(new Field("SourceType", 25, 0, 1, 0, "", false));
  1413. fieldIndex++;
  1414. deviceInfoMesg.SetField(new Field("ProductName", 27, 7, 1, 0, "", false));
  1415. fieldIndex++;
  1416. mesgs.Add(deviceInfoMesg);
  1417. DeviceInfoIndex = mesgIndex;
  1418. m_mesgLookup.Add(MesgNum.DeviceInfo, deviceInfoMesg);
  1419. mesgIndex++;
  1420. // TrainingFile
  1421. Mesg trainingFileMesg = new Mesg("TrainingFile", MesgNum.TrainingFile);
  1422. fieldIndex = 0;
  1423. trainingFileMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "", false));
  1424. fieldIndex++;
  1425. trainingFileMesg.SetField(new Field("Type", 0, 0, 1, 0, "", false));
  1426. fieldIndex++;
  1427. trainingFileMesg.SetField(new Field("Manufacturer", 1, 132, 1, 0, "", false));
  1428. fieldIndex++;
  1429. trainingFileMesg.SetField(new Field("Product", 2, 132, 1, 0, "", false));
  1430. subfieldIndex = 0;
  1431. trainingFileMesg.fields[fieldIndex].subfields.Add(new Subfield("GarminProduct", 132, 1, 0, ""));
  1432. trainingFileMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 1);
  1433. trainingFileMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 15);
  1434. trainingFileMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 13);
  1435. subfieldIndex++;
  1436. fieldIndex++;
  1437. trainingFileMesg.SetField(new Field("SerialNumber", 3, 140, 1, 0, "", false));
  1438. fieldIndex++;
  1439. trainingFileMesg.SetField(new Field("TimeCreated", 4, 134, 1, 0, "", false));
  1440. fieldIndex++;
  1441. mesgs.Add(trainingFileMesg);
  1442. TrainingFileIndex = mesgIndex;
  1443. m_mesgLookup.Add(MesgNum.TrainingFile, trainingFileMesg);
  1444. mesgIndex++;
  1445. // Hrv
  1446. Mesg hrvMesg = new Mesg("Hrv", MesgNum.Hrv);
  1447. fieldIndex = 0;
  1448. hrvMesg.SetField(new Field("Time", 0, 132, 1000, 0, "s", false));
  1449. fieldIndex++;
  1450. mesgs.Add(hrvMesg);
  1451. HrvIndex = mesgIndex;
  1452. m_mesgLookup.Add(MesgNum.Hrv, hrvMesg);
  1453. mesgIndex++;
  1454. // CameraEvent
  1455. Mesg cameraEventMesg = new Mesg("CameraEvent", MesgNum.CameraEvent);
  1456. fieldIndex = 0;
  1457. cameraEventMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1458. fieldIndex++;
  1459. cameraEventMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1460. fieldIndex++;
  1461. cameraEventMesg.SetField(new Field("CameraEventType", 1, 0, 1, 0, "", false));
  1462. fieldIndex++;
  1463. cameraEventMesg.SetField(new Field("CameraFileUuid", 2, 7, 1, 0, "", false));
  1464. fieldIndex++;
  1465. cameraEventMesg.SetField(new Field("CameraOrientation", 3, 0, 1, 0, "", false));
  1466. fieldIndex++;
  1467. mesgs.Add(cameraEventMesg);
  1468. CameraEventIndex = mesgIndex;
  1469. m_mesgLookup.Add(MesgNum.CameraEvent, cameraEventMesg);
  1470. mesgIndex++;
  1471. // GyroscopeData
  1472. Mesg gyroscopeDataMesg = new Mesg("GyroscopeData", MesgNum.GyroscopeData);
  1473. fieldIndex = 0;
  1474. gyroscopeDataMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1475. fieldIndex++;
  1476. gyroscopeDataMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1477. fieldIndex++;
  1478. gyroscopeDataMesg.SetField(new Field("SampleTimeOffset", 1, 132, 1, 0, "ms", false));
  1479. fieldIndex++;
  1480. gyroscopeDataMesg.SetField(new Field("GyroX", 2, 132, 1, 0, "counts", false));
  1481. fieldIndex++;
  1482. gyroscopeDataMesg.SetField(new Field("GyroY", 3, 132, 1, 0, "counts", false));
  1483. fieldIndex++;
  1484. gyroscopeDataMesg.SetField(new Field("GyroZ", 4, 132, 1, 0, "counts", false));
  1485. fieldIndex++;
  1486. gyroscopeDataMesg.SetField(new Field("CalibratedGyroX", 5, 136, 1, 0, "deg/s", false));
  1487. fieldIndex++;
  1488. gyroscopeDataMesg.SetField(new Field("CalibratedGyroY", 6, 136, 1, 0, "deg/s", false));
  1489. fieldIndex++;
  1490. gyroscopeDataMesg.SetField(new Field("CalibratedGyroZ", 7, 136, 1, 0, "deg/s", false));
  1491. fieldIndex++;
  1492. mesgs.Add(gyroscopeDataMesg);
  1493. GyroscopeDataIndex = mesgIndex;
  1494. m_mesgLookup.Add(MesgNum.GyroscopeData, gyroscopeDataMesg);
  1495. mesgIndex++;
  1496. // AccelerometerData
  1497. Mesg accelerometerDataMesg = new Mesg("AccelerometerData", MesgNum.AccelerometerData);
  1498. fieldIndex = 0;
  1499. accelerometerDataMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1500. fieldIndex++;
  1501. accelerometerDataMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1502. fieldIndex++;
  1503. accelerometerDataMesg.SetField(new Field("SampleTimeOffset", 1, 132, 1, 0, "ms", false));
  1504. fieldIndex++;
  1505. accelerometerDataMesg.SetField(new Field("AccelX", 2, 132, 1, 0, "counts", false));
  1506. fieldIndex++;
  1507. accelerometerDataMesg.SetField(new Field("AccelY", 3, 132, 1, 0, "counts", false));
  1508. fieldIndex++;
  1509. accelerometerDataMesg.SetField(new Field("AccelZ", 4, 132, 1, 0, "counts", false));
  1510. fieldIndex++;
  1511. accelerometerDataMesg.SetField(new Field("CalibratedAccelX", 5, 136, 1, 0, "g", false));
  1512. fieldIndex++;
  1513. accelerometerDataMesg.SetField(new Field("CalibratedAccelY", 6, 136, 1, 0, "g", false));
  1514. fieldIndex++;
  1515. accelerometerDataMesg.SetField(new Field("CalibratedAccelZ", 7, 136, 1, 0, "g", false));
  1516. fieldIndex++;
  1517. mesgs.Add(accelerometerDataMesg);
  1518. AccelerometerDataIndex = mesgIndex;
  1519. m_mesgLookup.Add(MesgNum.AccelerometerData, accelerometerDataMesg);
  1520. mesgIndex++;
  1521. // ThreeDSensorCalibration
  1522. Mesg threeDSensorCalibrationMesg = new Mesg("ThreeDSensorCalibration", MesgNum.ThreeDSensorCalibration);
  1523. fieldIndex = 0;
  1524. threeDSensorCalibrationMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1525. fieldIndex++;
  1526. threeDSensorCalibrationMesg.SetField(new Field("SensorType", 0, 0, 1, 0, "", false));
  1527. fieldIndex++;
  1528. threeDSensorCalibrationMesg.SetField(new Field("CalibrationFactor", 1, 134, 1, 0, "", false));
  1529. subfieldIndex = 0;
  1530. threeDSensorCalibrationMesg.fields[fieldIndex].subfields.Add(new Subfield("AccelCalFactor", 134, 1, 0, "g"));
  1531. threeDSensorCalibrationMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 0);
  1532. subfieldIndex++;
  1533. threeDSensorCalibrationMesg.fields[fieldIndex].subfields.Add(new Subfield("GyroCalFactor", 134, 1, 0, "deg/s"));
  1534. threeDSensorCalibrationMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 1);
  1535. subfieldIndex++;
  1536. fieldIndex++;
  1537. threeDSensorCalibrationMesg.SetField(new Field("CalibrationDivisor", 2, 134, 1, 0, "counts", false));
  1538. fieldIndex++;
  1539. threeDSensorCalibrationMesg.SetField(new Field("LevelShift", 3, 134, 1, 0, "", false));
  1540. fieldIndex++;
  1541. threeDSensorCalibrationMesg.SetField(new Field("OffsetCal", 4, 133, 1, 0, "", false));
  1542. fieldIndex++;
  1543. threeDSensorCalibrationMesg.SetField(new Field("OrientationMatrix", 5, 133, 65535, 0, "", false));
  1544. fieldIndex++;
  1545. mesgs.Add(threeDSensorCalibrationMesg);
  1546. ThreeDSensorCalibrationIndex = mesgIndex;
  1547. m_mesgLookup.Add(MesgNum.ThreeDSensorCalibration, threeDSensorCalibrationMesg);
  1548. mesgIndex++;
  1549. // VideoFrame
  1550. Mesg videoFrameMesg = new Mesg("VideoFrame", MesgNum.VideoFrame);
  1551. fieldIndex = 0;
  1552. videoFrameMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1553. fieldIndex++;
  1554. videoFrameMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1555. fieldIndex++;
  1556. videoFrameMesg.SetField(new Field("FrameNumber", 1, 134, 1, 0, "", false));
  1557. fieldIndex++;
  1558. mesgs.Add(videoFrameMesg);
  1559. VideoFrameIndex = mesgIndex;
  1560. m_mesgLookup.Add(MesgNum.VideoFrame, videoFrameMesg);
  1561. mesgIndex++;
  1562. // ObdiiData
  1563. Mesg obdiiDataMesg = new Mesg("ObdiiData", MesgNum.ObdiiData);
  1564. fieldIndex = 0;
  1565. obdiiDataMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1566. fieldIndex++;
  1567. obdiiDataMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1568. fieldIndex++;
  1569. obdiiDataMesg.SetField(new Field("TimeOffset", 1, 132, 1, 0, "ms", false));
  1570. fieldIndex++;
  1571. obdiiDataMesg.SetField(new Field("Pid", 2, 13, 1, 0, "", false));
  1572. fieldIndex++;
  1573. obdiiDataMesg.SetField(new Field("RawData", 3, 13, 1, 0, "", false));
  1574. fieldIndex++;
  1575. obdiiDataMesg.SetField(new Field("PidDataSize", 4, 2, 1, 0, "", false));
  1576. fieldIndex++;
  1577. obdiiDataMesg.SetField(new Field("SystemTime", 5, 134, 1, 0, "", false));
  1578. fieldIndex++;
  1579. obdiiDataMesg.SetField(new Field("StartTimestamp", 6, 134, 1, 0, "", false));
  1580. fieldIndex++;
  1581. obdiiDataMesg.SetField(new Field("StartTimestampMs", 7, 132, 1, 0, "ms", false));
  1582. fieldIndex++;
  1583. mesgs.Add(obdiiDataMesg);
  1584. ObdiiDataIndex = mesgIndex;
  1585. m_mesgLookup.Add(MesgNum.ObdiiData, obdiiDataMesg);
  1586. mesgIndex++;
  1587. // NmeaSentence
  1588. Mesg nmeaSentenceMesg = new Mesg("NmeaSentence", MesgNum.NmeaSentence);
  1589. fieldIndex = 0;
  1590. nmeaSentenceMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1591. fieldIndex++;
  1592. nmeaSentenceMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1593. fieldIndex++;
  1594. nmeaSentenceMesg.SetField(new Field("Sentence", 1, 7, 1, 0, "", false));
  1595. fieldIndex++;
  1596. mesgs.Add(nmeaSentenceMesg);
  1597. NmeaSentenceIndex = mesgIndex;
  1598. m_mesgLookup.Add(MesgNum.NmeaSentence, nmeaSentenceMesg);
  1599. mesgIndex++;
  1600. // AviationAttitude
  1601. Mesg aviationAttitudeMesg = new Mesg("AviationAttitude", MesgNum.AviationAttitude);
  1602. fieldIndex = 0;
  1603. aviationAttitudeMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1604. fieldIndex++;
  1605. aviationAttitudeMesg.SetField(new Field("TimestampMs", 0, 132, 1, 0, "ms", false));
  1606. fieldIndex++;
  1607. aviationAttitudeMesg.SetField(new Field("SystemTime", 1, 134, 1, 0, "ms", false));
  1608. fieldIndex++;
  1609. aviationAttitudeMesg.SetField(new Field("Pitch", 2, 131, 1, 0, "radians", false));
  1610. fieldIndex++;
  1611. aviationAttitudeMesg.SetField(new Field("Roll", 3, 131, 1, 0, "radians", false));
  1612. fieldIndex++;
  1613. aviationAttitudeMesg.SetField(new Field("AccelLateral", 4, 131, 100, 0, "m/s^2", false));
  1614. fieldIndex++;
  1615. aviationAttitudeMesg.SetField(new Field("AccelNormal", 5, 131, 100, 0, "m/s^2", false));
  1616. fieldIndex++;
  1617. aviationAttitudeMesg.SetField(new Field("TurnRate", 6, 131, 1024, 0, "radians/second", false));
  1618. fieldIndex++;
  1619. aviationAttitudeMesg.SetField(new Field("Stage", 7, 0, 1, 0, "", false));
  1620. fieldIndex++;
  1621. aviationAttitudeMesg.SetField(new Field("AttitudeStageComplete", 8, 2, 1, 0, "%", false));
  1622. fieldIndex++;
  1623. aviationAttitudeMesg.SetField(new Field("Track", 9, 132, 1, 0, "radians", false));
  1624. fieldIndex++;
  1625. aviationAttitudeMesg.SetField(new Field("Validity", 10, 132, 1, 0, "", false));
  1626. fieldIndex++;
  1627. mesgs.Add(aviationAttitudeMesg);
  1628. AviationAttitudeIndex = mesgIndex;
  1629. m_mesgLookup.Add(MesgNum.AviationAttitude, aviationAttitudeMesg);
  1630. mesgIndex++;
  1631. // Video
  1632. Mesg videoMesg = new Mesg("Video", MesgNum.Video);
  1633. fieldIndex = 0;
  1634. videoMesg.SetField(new Field("Url", 0, 7, 1, 0, "", false));
  1635. fieldIndex++;
  1636. videoMesg.SetField(new Field("HostingProvider", 1, 7, 1, 0, "", false));
  1637. fieldIndex++;
  1638. videoMesg.SetField(new Field("Duration", 2, 134, 1, 0, "ms", false));
  1639. fieldIndex++;
  1640. mesgs.Add(videoMesg);
  1641. VideoIndex = mesgIndex;
  1642. m_mesgLookup.Add(MesgNum.Video, videoMesg);
  1643. mesgIndex++;
  1644. // VideoTitle
  1645. Mesg videoTitleMesg = new Mesg("VideoTitle", MesgNum.VideoTitle);
  1646. fieldIndex = 0;
  1647. videoTitleMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1648. fieldIndex++;
  1649. videoTitleMesg.SetField(new Field("MessageCount", 0, 132, 1, 0, "", false));
  1650. fieldIndex++;
  1651. videoTitleMesg.SetField(new Field("Text", 1, 7, 1, 0, "", false));
  1652. fieldIndex++;
  1653. mesgs.Add(videoTitleMesg);
  1654. VideoTitleIndex = mesgIndex;
  1655. m_mesgLookup.Add(MesgNum.VideoTitle, videoTitleMesg);
  1656. mesgIndex++;
  1657. // VideoDescription
  1658. Mesg videoDescriptionMesg = new Mesg("VideoDescription", MesgNum.VideoDescription);
  1659. fieldIndex = 0;
  1660. videoDescriptionMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1661. fieldIndex++;
  1662. videoDescriptionMesg.SetField(new Field("MessageCount", 0, 132, 1, 0, "", false));
  1663. fieldIndex++;
  1664. videoDescriptionMesg.SetField(new Field("Text", 1, 7, 1, 0, "", false));
  1665. fieldIndex++;
  1666. mesgs.Add(videoDescriptionMesg);
  1667. VideoDescriptionIndex = mesgIndex;
  1668. m_mesgLookup.Add(MesgNum.VideoDescription, videoDescriptionMesg);
  1669. mesgIndex++;
  1670. // VideoClip
  1671. Mesg videoClipMesg = new Mesg("VideoClip", MesgNum.VideoClip);
  1672. fieldIndex = 0;
  1673. videoClipMesg.SetField(new Field("ClipNumber", 0, 132, 1, 0, "", false));
  1674. fieldIndex++;
  1675. videoClipMesg.SetField(new Field("StartTimestamp", 1, 134, 1, 0, "", false));
  1676. fieldIndex++;
  1677. videoClipMesg.SetField(new Field("StartTimestampMs", 2, 132, 1, 0, "", false));
  1678. fieldIndex++;
  1679. videoClipMesg.SetField(new Field("EndTimestamp", 3, 134, 1, 0, "", false));
  1680. fieldIndex++;
  1681. videoClipMesg.SetField(new Field("EndTimestampMs", 4, 132, 1, 0, "", false));
  1682. fieldIndex++;
  1683. videoClipMesg.SetField(new Field("ClipStart", 6, 134, 1, 0, "ms", false));
  1684. fieldIndex++;
  1685. videoClipMesg.SetField(new Field("ClipEnd", 7, 134, 1, 0, "ms", false));
  1686. fieldIndex++;
  1687. mesgs.Add(videoClipMesg);
  1688. VideoClipIndex = mesgIndex;
  1689. m_mesgLookup.Add(MesgNum.VideoClip, videoClipMesg);
  1690. mesgIndex++;
  1691. // Course
  1692. Mesg courseMesg = new Mesg("Course", MesgNum.Course);
  1693. fieldIndex = 0;
  1694. courseMesg.SetField(new Field("Sport", 4, 0, 1, 0, "", false));
  1695. fieldIndex++;
  1696. courseMesg.SetField(new Field("Name", 5, 7, 1, 0, "", false));
  1697. fieldIndex++;
  1698. courseMesg.SetField(new Field("Capabilities", 6, 140, 1, 0, "", false));
  1699. fieldIndex++;
  1700. mesgs.Add(courseMesg);
  1701. CourseIndex = mesgIndex;
  1702. m_mesgLookup.Add(MesgNum.Course, courseMesg);
  1703. mesgIndex++;
  1704. // CoursePoint
  1705. Mesg coursePointMesg = new Mesg("CoursePoint", MesgNum.CoursePoint);
  1706. fieldIndex = 0;
  1707. coursePointMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1708. fieldIndex++;
  1709. coursePointMesg.SetField(new Field("Timestamp", 1, 134, 1, 0, "", false));
  1710. fieldIndex++;
  1711. coursePointMesg.SetField(new Field("PositionLat", 2, 133, 1, 0, "semicircles", false));
  1712. fieldIndex++;
  1713. coursePointMesg.SetField(new Field("PositionLong", 3, 133, 1, 0, "semicircles", false));
  1714. fieldIndex++;
  1715. coursePointMesg.SetField(new Field("Distance", 4, 134, 100, 0, "m", false));
  1716. fieldIndex++;
  1717. coursePointMesg.SetField(new Field("Type", 5, 0, 1, 0, "", false));
  1718. fieldIndex++;
  1719. coursePointMesg.SetField(new Field("Name", 6, 7, 1, 0, "", false));
  1720. fieldIndex++;
  1721. coursePointMesg.SetField(new Field("Favorite", 8, 0, 1, 0, "", false));
  1722. fieldIndex++;
  1723. mesgs.Add(coursePointMesg);
  1724. CoursePointIndex = mesgIndex;
  1725. m_mesgLookup.Add(MesgNum.CoursePoint, coursePointMesg);
  1726. mesgIndex++;
  1727. // SegmentId
  1728. Mesg segmentIdMesg = new Mesg("SegmentId", MesgNum.SegmentId);
  1729. fieldIndex = 0;
  1730. segmentIdMesg.SetField(new Field("Name", 0, 7, 1, 0, "", false));
  1731. fieldIndex++;
  1732. segmentIdMesg.SetField(new Field("Uuid", 1, 7, 1, 0, "", false));
  1733. fieldIndex++;
  1734. segmentIdMesg.SetField(new Field("Sport", 2, 0, 1, 0, "", false));
  1735. fieldIndex++;
  1736. segmentIdMesg.SetField(new Field("Enabled", 3, 0, 1, 0, "", false));
  1737. fieldIndex++;
  1738. segmentIdMesg.SetField(new Field("UserProfilePrimaryKey", 4, 134, 1, 0, "", false));
  1739. fieldIndex++;
  1740. segmentIdMesg.SetField(new Field("DeviceId", 5, 134, 1, 0, "", false));
  1741. fieldIndex++;
  1742. segmentIdMesg.SetField(new Field("DefaultRaceLeader", 6, 2, 1, 0, "", false));
  1743. fieldIndex++;
  1744. segmentIdMesg.SetField(new Field("DeleteStatus", 7, 0, 1, 0, "", false));
  1745. fieldIndex++;
  1746. segmentIdMesg.SetField(new Field("SelectionType", 8, 0, 1, 0, "", false));
  1747. fieldIndex++;
  1748. mesgs.Add(segmentIdMesg);
  1749. SegmentIdIndex = mesgIndex;
  1750. m_mesgLookup.Add(MesgNum.SegmentId, segmentIdMesg);
  1751. mesgIndex++;
  1752. // SegmentLeaderboardEntry
  1753. Mesg segmentLeaderboardEntryMesg = new Mesg("SegmentLeaderboardEntry", MesgNum.SegmentLeaderboardEntry);
  1754. fieldIndex = 0;
  1755. segmentLeaderboardEntryMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1756. fieldIndex++;
  1757. segmentLeaderboardEntryMesg.SetField(new Field("Name", 0, 7, 1, 0, "", false));
  1758. fieldIndex++;
  1759. segmentLeaderboardEntryMesg.SetField(new Field("Type", 1, 0, 1, 0, "", false));
  1760. fieldIndex++;
  1761. segmentLeaderboardEntryMesg.SetField(new Field("GroupPrimaryKey", 2, 134, 1, 0, "", false));
  1762. fieldIndex++;
  1763. segmentLeaderboardEntryMesg.SetField(new Field("ActivityId", 3, 134, 1, 0, "", false));
  1764. fieldIndex++;
  1765. segmentLeaderboardEntryMesg.SetField(new Field("SegmentTime", 4, 134, 1000, 0, "s", false));
  1766. fieldIndex++;
  1767. segmentLeaderboardEntryMesg.SetField(new Field("ActivityIdString", 5, 7, 1, 0, "", false));
  1768. fieldIndex++;
  1769. mesgs.Add(segmentLeaderboardEntryMesg);
  1770. SegmentLeaderboardEntryIndex = mesgIndex;
  1771. m_mesgLookup.Add(MesgNum.SegmentLeaderboardEntry, segmentLeaderboardEntryMesg);
  1772. mesgIndex++;
  1773. // SegmentPoint
  1774. Mesg segmentPointMesg = new Mesg("SegmentPoint", MesgNum.SegmentPoint);
  1775. fieldIndex = 0;
  1776. segmentPointMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1777. fieldIndex++;
  1778. segmentPointMesg.SetField(new Field("PositionLat", 1, 133, 1, 0, "semicircles", false));
  1779. fieldIndex++;
  1780. segmentPointMesg.SetField(new Field("PositionLong", 2, 133, 1, 0, "semicircles", false));
  1781. fieldIndex++;
  1782. segmentPointMesg.SetField(new Field("Distance", 3, 134, 100, 0, "m", false));
  1783. fieldIndex++;
  1784. segmentPointMesg.SetField(new Field("Altitude", 4, 132, 5, 500, "m", false));
  1785. fieldIndex++;
  1786. segmentPointMesg.SetField(new Field("LeaderTime", 5, 134, 1000, 0, "s", false));
  1787. fieldIndex++;
  1788. mesgs.Add(segmentPointMesg);
  1789. SegmentPointIndex = mesgIndex;
  1790. m_mesgLookup.Add(MesgNum.SegmentPoint, segmentPointMesg);
  1791. mesgIndex++;
  1792. // SegmentLap
  1793. Mesg segmentLapMesg = new Mesg("SegmentLap", MesgNum.SegmentLap);
  1794. fieldIndex = 0;
  1795. segmentLapMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1796. fieldIndex++;
  1797. segmentLapMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  1798. fieldIndex++;
  1799. segmentLapMesg.SetField(new Field("Event", 0, 0, 1, 0, "", false));
  1800. fieldIndex++;
  1801. segmentLapMesg.SetField(new Field("EventType", 1, 0, 1, 0, "", false));
  1802. fieldIndex++;
  1803. segmentLapMesg.SetField(new Field("StartTime", 2, 134, 1, 0, "", false));
  1804. fieldIndex++;
  1805. segmentLapMesg.SetField(new Field("StartPositionLat", 3, 133, 1, 0, "semicircles", false));
  1806. fieldIndex++;
  1807. segmentLapMesg.SetField(new Field("StartPositionLong", 4, 133, 1, 0, "semicircles", false));
  1808. fieldIndex++;
  1809. segmentLapMesg.SetField(new Field("EndPositionLat", 5, 133, 1, 0, "semicircles", false));
  1810. fieldIndex++;
  1811. segmentLapMesg.SetField(new Field("EndPositionLong", 6, 133, 1, 0, "semicircles", false));
  1812. fieldIndex++;
  1813. segmentLapMesg.SetField(new Field("TotalElapsedTime", 7, 134, 1000, 0, "s", false));
  1814. fieldIndex++;
  1815. segmentLapMesg.SetField(new Field("TotalTimerTime", 8, 134, 1000, 0, "s", false));
  1816. fieldIndex++;
  1817. segmentLapMesg.SetField(new Field("TotalDistance", 9, 134, 100, 0, "m", false));
  1818. fieldIndex++;
  1819. segmentLapMesg.SetField(new Field("TotalCycles", 10, 134, 1, 0, "cycles", false));
  1820. subfieldIndex = 0;
  1821. segmentLapMesg.fields[fieldIndex].subfields.Add(new Subfield("TotalStrokes", 134, 1, 0, "strokes"));
  1822. segmentLapMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(23, 2);
  1823. subfieldIndex++;
  1824. fieldIndex++;
  1825. segmentLapMesg.SetField(new Field("TotalCalories", 11, 132, 1, 0, "kcal", false));
  1826. fieldIndex++;
  1827. segmentLapMesg.SetField(new Field("TotalFatCalories", 12, 132, 1, 0, "kcal", false));
  1828. fieldIndex++;
  1829. segmentLapMesg.SetField(new Field("AvgSpeed", 13, 132, 1000, 0, "m/s", false));
  1830. fieldIndex++;
  1831. segmentLapMesg.SetField(new Field("MaxSpeed", 14, 132, 1000, 0, "m/s", false));
  1832. fieldIndex++;
  1833. segmentLapMesg.SetField(new Field("AvgHeartRate", 15, 2, 1, 0, "bpm", false));
  1834. fieldIndex++;
  1835. segmentLapMesg.SetField(new Field("MaxHeartRate", 16, 2, 1, 0, "bpm", false));
  1836. fieldIndex++;
  1837. segmentLapMesg.SetField(new Field("AvgCadence", 17, 2, 1, 0, "rpm", false));
  1838. fieldIndex++;
  1839. segmentLapMesg.SetField(new Field("MaxCadence", 18, 2, 1, 0, "rpm", false));
  1840. fieldIndex++;
  1841. segmentLapMesg.SetField(new Field("AvgPower", 19, 132, 1, 0, "watts", false));
  1842. fieldIndex++;
  1843. segmentLapMesg.SetField(new Field("MaxPower", 20, 132, 1, 0, "watts", false));
  1844. fieldIndex++;
  1845. segmentLapMesg.SetField(new Field("TotalAscent", 21, 132, 1, 0, "m", false));
  1846. fieldIndex++;
  1847. segmentLapMesg.SetField(new Field("TotalDescent", 22, 132, 1, 0, "m", false));
  1848. fieldIndex++;
  1849. segmentLapMesg.SetField(new Field("Sport", 23, 0, 1, 0, "", false));
  1850. fieldIndex++;
  1851. segmentLapMesg.SetField(new Field("EventGroup", 24, 2, 1, 0, "", false));
  1852. fieldIndex++;
  1853. segmentLapMesg.SetField(new Field("NecLat", 25, 133, 1, 0, "semicircles", false));
  1854. fieldIndex++;
  1855. segmentLapMesg.SetField(new Field("NecLong", 26, 133, 1, 0, "semicircles", false));
  1856. fieldIndex++;
  1857. segmentLapMesg.SetField(new Field("SwcLat", 27, 133, 1, 0, "semicircles", false));
  1858. fieldIndex++;
  1859. segmentLapMesg.SetField(new Field("SwcLong", 28, 133, 1, 0, "semicircles", false));
  1860. fieldIndex++;
  1861. segmentLapMesg.SetField(new Field("Name", 29, 7, 1, 0, "", false));
  1862. fieldIndex++;
  1863. segmentLapMesg.SetField(new Field("NormalizedPower", 30, 132, 1, 0, "watts", false));
  1864. fieldIndex++;
  1865. segmentLapMesg.SetField(new Field("LeftRightBalance", 31, 132, 1, 0, "", false));
  1866. fieldIndex++;
  1867. segmentLapMesg.SetField(new Field("SubSport", 32, 0, 1, 0, "", false));
  1868. fieldIndex++;
  1869. segmentLapMesg.SetField(new Field("TotalWork", 33, 134, 1, 0, "J", false));
  1870. fieldIndex++;
  1871. segmentLapMesg.SetField(new Field("AvgAltitude", 34, 132, 5, 500, "m", false));
  1872. fieldIndex++;
  1873. segmentLapMesg.SetField(new Field("MaxAltitude", 35, 132, 5, 500, "m", false));
  1874. fieldIndex++;
  1875. segmentLapMesg.SetField(new Field("GpsAccuracy", 36, 2, 1, 0, "m", false));
  1876. fieldIndex++;
  1877. segmentLapMesg.SetField(new Field("AvgGrade", 37, 131, 100, 0, "%", false));
  1878. fieldIndex++;
  1879. segmentLapMesg.SetField(new Field("AvgPosGrade", 38, 131, 100, 0, "%", false));
  1880. fieldIndex++;
  1881. segmentLapMesg.SetField(new Field("AvgNegGrade", 39, 131, 100, 0, "%", false));
  1882. fieldIndex++;
  1883. segmentLapMesg.SetField(new Field("MaxPosGrade", 40, 131, 100, 0, "%", false));
  1884. fieldIndex++;
  1885. segmentLapMesg.SetField(new Field("MaxNegGrade", 41, 131, 100, 0, "%", false));
  1886. fieldIndex++;
  1887. segmentLapMesg.SetField(new Field("AvgTemperature", 42, 1, 1, 0, "C", false));
  1888. fieldIndex++;
  1889. segmentLapMesg.SetField(new Field("MaxTemperature", 43, 1, 1, 0, "C", false));
  1890. fieldIndex++;
  1891. segmentLapMesg.SetField(new Field("TotalMovingTime", 44, 134, 1000, 0, "s", false));
  1892. fieldIndex++;
  1893. segmentLapMesg.SetField(new Field("AvgPosVerticalSpeed", 45, 131, 1000, 0, "m/s", false));
  1894. fieldIndex++;
  1895. segmentLapMesg.SetField(new Field("AvgNegVerticalSpeed", 46, 131, 1000, 0, "m/s", false));
  1896. fieldIndex++;
  1897. segmentLapMesg.SetField(new Field("MaxPosVerticalSpeed", 47, 131, 1000, 0, "m/s", false));
  1898. fieldIndex++;
  1899. segmentLapMesg.SetField(new Field("MaxNegVerticalSpeed", 48, 131, 1000, 0, "m/s", false));
  1900. fieldIndex++;
  1901. segmentLapMesg.SetField(new Field("TimeInHrZone", 49, 134, 1000, 0, "s", false));
  1902. fieldIndex++;
  1903. segmentLapMesg.SetField(new Field("TimeInSpeedZone", 50, 134, 1000, 0, "s", false));
  1904. fieldIndex++;
  1905. segmentLapMesg.SetField(new Field("TimeInCadenceZone", 51, 134, 1000, 0, "s", false));
  1906. fieldIndex++;
  1907. segmentLapMesg.SetField(new Field("TimeInPowerZone", 52, 134, 1000, 0, "s", false));
  1908. fieldIndex++;
  1909. segmentLapMesg.SetField(new Field("RepetitionNum", 53, 132, 1, 0, "", false));
  1910. fieldIndex++;
  1911. segmentLapMesg.SetField(new Field("MinAltitude", 54, 132, 5, 500, "m", false));
  1912. fieldIndex++;
  1913. segmentLapMesg.SetField(new Field("MinHeartRate", 55, 2, 1, 0, "bpm", false));
  1914. fieldIndex++;
  1915. segmentLapMesg.SetField(new Field("ActiveTime", 56, 134, 1000, 0, "s", false));
  1916. fieldIndex++;
  1917. segmentLapMesg.SetField(new Field("WktStepIndex", 57, 132, 1, 0, "", false));
  1918. fieldIndex++;
  1919. segmentLapMesg.SetField(new Field("SportEvent", 58, 0, 1, 0, "", false));
  1920. fieldIndex++;
  1921. segmentLapMesg.SetField(new Field("AvgLeftTorqueEffectiveness", 59, 2, 2, 0, "percent", false));
  1922. fieldIndex++;
  1923. segmentLapMesg.SetField(new Field("AvgRightTorqueEffectiveness", 60, 2, 2, 0, "percent", false));
  1924. fieldIndex++;
  1925. segmentLapMesg.SetField(new Field("AvgLeftPedalSmoothness", 61, 2, 2, 0, "percent", false));
  1926. fieldIndex++;
  1927. segmentLapMesg.SetField(new Field("AvgRightPedalSmoothness", 62, 2, 2, 0, "percent", false));
  1928. fieldIndex++;
  1929. segmentLapMesg.SetField(new Field("AvgCombinedPedalSmoothness", 63, 2, 2, 0, "percent", false));
  1930. fieldIndex++;
  1931. segmentLapMesg.SetField(new Field("Status", 64, 0, 1, 0, "", false));
  1932. fieldIndex++;
  1933. segmentLapMesg.SetField(new Field("Uuid", 65, 7, 1, 0, "", false));
  1934. fieldIndex++;
  1935. segmentLapMesg.SetField(new Field("AvgFractionalCadence", 66, 2, 128, 0, "rpm", false));
  1936. fieldIndex++;
  1937. segmentLapMesg.SetField(new Field("MaxFractionalCadence", 67, 2, 128, 0, "rpm", false));
  1938. fieldIndex++;
  1939. segmentLapMesg.SetField(new Field("TotalFractionalCycles", 68, 2, 128, 0, "cycles", false));
  1940. fieldIndex++;
  1941. segmentLapMesg.SetField(new Field("FrontGearShiftCount", 69, 132, 1, 0, "", false));
  1942. fieldIndex++;
  1943. segmentLapMesg.SetField(new Field("RearGearShiftCount", 70, 132, 1, 0, "", false));
  1944. fieldIndex++;
  1945. segmentLapMesg.SetField(new Field("TimeStanding", 71, 134, 1000, 0, "s", false));
  1946. fieldIndex++;
  1947. segmentLapMesg.SetField(new Field("StandCount", 72, 132, 1, 0, "", false));
  1948. fieldIndex++;
  1949. segmentLapMesg.SetField(new Field("AvgLeftPco", 73, 1, 1, 0, "mm", false));
  1950. fieldIndex++;
  1951. segmentLapMesg.SetField(new Field("AvgRightPco", 74, 1, 1, 0, "mm", false));
  1952. fieldIndex++;
  1953. segmentLapMesg.SetField(new Field("AvgLeftPowerPhase", 75, 2, 1, 0, "degrees", false));
  1954. fieldIndex++;
  1955. segmentLapMesg.SetField(new Field("AvgLeftPowerPhasePeak", 76, 2, 1, 0, "degrees", false));
  1956. fieldIndex++;
  1957. segmentLapMesg.SetField(new Field("AvgRightPowerPhase", 77, 2, 1, 0, "degrees", false));
  1958. fieldIndex++;
  1959. segmentLapMesg.SetField(new Field("AvgRightPowerPhasePeak", 78, 2, 1, 0, "degrees", false));
  1960. fieldIndex++;
  1961. segmentLapMesg.SetField(new Field("AvgPowerPosition", 79, 132, 1, 0, "watts", false));
  1962. fieldIndex++;
  1963. segmentLapMesg.SetField(new Field("MaxPowerPosition", 80, 132, 1, 0, "watts", false));
  1964. fieldIndex++;
  1965. segmentLapMesg.SetField(new Field("AvgCadencePosition", 81, 2, 1, 0, "rpm", false));
  1966. fieldIndex++;
  1967. segmentLapMesg.SetField(new Field("MaxCadencePosition", 82, 2, 1, 0, "rpm", false));
  1968. fieldIndex++;
  1969. mesgs.Add(segmentLapMesg);
  1970. SegmentLapIndex = mesgIndex;
  1971. m_mesgLookup.Add(MesgNum.SegmentLap, segmentLapMesg);
  1972. mesgIndex++;
  1973. // SegmentFile
  1974. Mesg segmentFileMesg = new Mesg("SegmentFile", MesgNum.SegmentFile);
  1975. fieldIndex = 0;
  1976. segmentFileMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  1977. fieldIndex++;
  1978. segmentFileMesg.SetField(new Field("FileUuid", 1, 7, 1, 0, "", false));
  1979. fieldIndex++;
  1980. segmentFileMesg.SetField(new Field("Enabled", 3, 0, 1, 0, "", false));
  1981. fieldIndex++;
  1982. segmentFileMesg.SetField(new Field("UserProfilePrimaryKey", 4, 134, 1, 0, "", false));
  1983. fieldIndex++;
  1984. segmentFileMesg.SetField(new Field("LeaderType", 7, 0, 1, 0, "", false));
  1985. fieldIndex++;
  1986. segmentFileMesg.SetField(new Field("LeaderGroupPrimaryKey", 8, 134, 1, 0, "", false));
  1987. fieldIndex++;
  1988. segmentFileMesg.SetField(new Field("LeaderActivityId", 9, 134, 1, 0, "", false));
  1989. fieldIndex++;
  1990. segmentFileMesg.SetField(new Field("LeaderActivityIdString", 10, 7, 1, 0, "", false));
  1991. fieldIndex++;
  1992. mesgs.Add(segmentFileMesg);
  1993. SegmentFileIndex = mesgIndex;
  1994. m_mesgLookup.Add(MesgNum.SegmentFile, segmentFileMesg);
  1995. mesgIndex++;
  1996. // Workout
  1997. Mesg workoutMesg = new Mesg("Workout", MesgNum.Workout);
  1998. fieldIndex = 0;
  1999. workoutMesg.SetField(new Field("Sport", 4, 0, 1, 0, "", false));
  2000. fieldIndex++;
  2001. workoutMesg.SetField(new Field("Capabilities", 5, 140, 1, 0, "", false));
  2002. fieldIndex++;
  2003. workoutMesg.SetField(new Field("NumValidSteps", 6, 132, 1, 0, "", false));
  2004. fieldIndex++;
  2005. workoutMesg.SetField(new Field("WktName", 8, 7, 1, 0, "", false));
  2006. fieldIndex++;
  2007. mesgs.Add(workoutMesg);
  2008. WorkoutIndex = mesgIndex;
  2009. m_mesgLookup.Add(MesgNum.Workout, workoutMesg);
  2010. mesgIndex++;
  2011. // WorkoutStep
  2012. Mesg workoutStepMesg = new Mesg("WorkoutStep", MesgNum.WorkoutStep);
  2013. fieldIndex = 0;
  2014. workoutStepMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  2015. fieldIndex++;
  2016. workoutStepMesg.SetField(new Field("WktStepName", 0, 7, 1, 0, "", false));
  2017. fieldIndex++;
  2018. workoutStepMesg.SetField(new Field("DurationType", 1, 0, 1, 0, "", false));
  2019. fieldIndex++;
  2020. workoutStepMesg.SetField(new Field("DurationValue", 2, 134, 1, 0, "", false));
  2021. subfieldIndex = 0;
  2022. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationTime", 134, 1000, 0, "s"));
  2023. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 0);
  2024. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 28);
  2025. subfieldIndex++;
  2026. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationDistance", 134, 100, 0, "m"));
  2027. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 1);
  2028. subfieldIndex++;
  2029. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationHr", 134, 1, 0, "% or bpm"));
  2030. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 2);
  2031. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 3);
  2032. subfieldIndex++;
  2033. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationCalories", 134, 1, 0, "calories"));
  2034. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 4);
  2035. subfieldIndex++;
  2036. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationStep", 134, 1, 0, ""));
  2037. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 6);
  2038. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 7);
  2039. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 8);
  2040. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 9);
  2041. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 10);
  2042. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 11);
  2043. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 12);
  2044. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 13);
  2045. subfieldIndex++;
  2046. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("DurationPower", 134, 1, 0, "% or watts"));
  2047. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 14);
  2048. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 15);
  2049. subfieldIndex++;
  2050. fieldIndex++;
  2051. workoutStepMesg.SetField(new Field("TargetType", 3, 0, 1, 0, "", false));
  2052. fieldIndex++;
  2053. workoutStepMesg.SetField(new Field("TargetValue", 4, 134, 1, 0, "", false));
  2054. subfieldIndex = 0;
  2055. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("TargetHrZone", 134, 1, 0, ""));
  2056. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 1);
  2057. subfieldIndex++;
  2058. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("TargetPowerZone", 134, 1, 0, ""));
  2059. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 4);
  2060. subfieldIndex++;
  2061. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatSteps", 134, 1, 0, ""));
  2062. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 6);
  2063. subfieldIndex++;
  2064. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatTime", 134, 1000, 0, "s"));
  2065. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 7);
  2066. subfieldIndex++;
  2067. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatDistance", 134, 100, 0, "m"));
  2068. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 8);
  2069. subfieldIndex++;
  2070. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatCalories", 134, 1, 0, "calories"));
  2071. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 9);
  2072. subfieldIndex++;
  2073. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatHr", 134, 1, 0, "% or bpm"));
  2074. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 10);
  2075. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 11);
  2076. subfieldIndex++;
  2077. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("RepeatPower", 134, 1, 0, "% or watts"));
  2078. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 12);
  2079. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(1, 13);
  2080. subfieldIndex++;
  2081. fieldIndex++;
  2082. workoutStepMesg.SetField(new Field("CustomTargetValueLow", 5, 134, 1, 0, "", false));
  2083. subfieldIndex = 0;
  2084. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetSpeedLow", 134, 1000, 0, "m/s"));
  2085. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 0);
  2086. subfieldIndex++;
  2087. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetHeartRateLow", 134, 1, 0, "% or bpm"));
  2088. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 1);
  2089. subfieldIndex++;
  2090. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetCadenceLow", 134, 1, 0, "rpm"));
  2091. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 3);
  2092. subfieldIndex++;
  2093. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetPowerLow", 134, 1, 0, "% or watts"));
  2094. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 4);
  2095. subfieldIndex++;
  2096. fieldIndex++;
  2097. workoutStepMesg.SetField(new Field("CustomTargetValueHigh", 6, 134, 1, 0, "", false));
  2098. subfieldIndex = 0;
  2099. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetSpeedHigh", 134, 1000, 0, "m/s"));
  2100. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 0);
  2101. subfieldIndex++;
  2102. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetHeartRateHigh", 134, 1, 0, "% or bpm"));
  2103. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 1);
  2104. subfieldIndex++;
  2105. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetCadenceHigh", 134, 1, 0, "rpm"));
  2106. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 3);
  2107. subfieldIndex++;
  2108. workoutStepMesg.fields[fieldIndex].subfields.Add(new Subfield("CustomTargetPowerHigh", 134, 1, 0, "% or watts"));
  2109. workoutStepMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(3, 4);
  2110. subfieldIndex++;
  2111. fieldIndex++;
  2112. workoutStepMesg.SetField(new Field("Intensity", 7, 0, 1, 0, "", false));
  2113. fieldIndex++;
  2114. mesgs.Add(workoutStepMesg);
  2115. WorkoutStepIndex = mesgIndex;
  2116. m_mesgLookup.Add(MesgNum.WorkoutStep, workoutStepMesg);
  2117. mesgIndex++;
  2118. // Schedule
  2119. Mesg scheduleMesg = new Mesg("Schedule", MesgNum.Schedule);
  2120. fieldIndex = 0;
  2121. scheduleMesg.SetField(new Field("Manufacturer", 0, 132, 1, 0, "", false));
  2122. fieldIndex++;
  2123. scheduleMesg.SetField(new Field("Product", 1, 132, 1, 0, "", false));
  2124. subfieldIndex = 0;
  2125. scheduleMesg.fields[fieldIndex].subfields.Add(new Subfield("GarminProduct", 132, 1, 0, ""));
  2126. scheduleMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 1);
  2127. scheduleMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 15);
  2128. scheduleMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(0, 13);
  2129. subfieldIndex++;
  2130. fieldIndex++;
  2131. scheduleMesg.SetField(new Field("SerialNumber", 2, 140, 1, 0, "", false));
  2132. fieldIndex++;
  2133. scheduleMesg.SetField(new Field("TimeCreated", 3, 134, 1, 0, "", false));
  2134. fieldIndex++;
  2135. scheduleMesg.SetField(new Field("Completed", 4, 0, 1, 0, "", false));
  2136. fieldIndex++;
  2137. scheduleMesg.SetField(new Field("Type", 5, 0, 1, 0, "", false));
  2138. fieldIndex++;
  2139. scheduleMesg.SetField(new Field("ScheduledTime", 6, 134, 1, 0, "", false));
  2140. fieldIndex++;
  2141. mesgs.Add(scheduleMesg);
  2142. ScheduleIndex = mesgIndex;
  2143. m_mesgLookup.Add(MesgNum.Schedule, scheduleMesg);
  2144. mesgIndex++;
  2145. // Totals
  2146. Mesg totalsMesg = new Mesg("Totals", MesgNum.Totals);
  2147. fieldIndex = 0;
  2148. totalsMesg.SetField(new Field("MessageIndex", 254, 132, 1, 0, "", false));
  2149. fieldIndex++;
  2150. totalsMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2151. fieldIndex++;
  2152. totalsMesg.SetField(new Field("TimerTime", 0, 134, 1, 0, "s", false));
  2153. fieldIndex++;
  2154. totalsMesg.SetField(new Field("Distance", 1, 134, 1, 0, "m", false));
  2155. fieldIndex++;
  2156. totalsMesg.SetField(new Field("Calories", 2, 134, 1, 0, "kcal", false));
  2157. fieldIndex++;
  2158. totalsMesg.SetField(new Field("Sport", 3, 0, 1, 0, "", false));
  2159. fieldIndex++;
  2160. totalsMesg.SetField(new Field("ElapsedTime", 4, 134, 1, 0, "s", false));
  2161. fieldIndex++;
  2162. totalsMesg.SetField(new Field("Sessions", 5, 132, 1, 0, "", false));
  2163. fieldIndex++;
  2164. totalsMesg.SetField(new Field("ActiveTime", 6, 134, 1, 0, "s", false));
  2165. fieldIndex++;
  2166. totalsMesg.SetField(new Field("SportIndex", 9, 2, 1, 0, "", false));
  2167. fieldIndex++;
  2168. mesgs.Add(totalsMesg);
  2169. TotalsIndex = mesgIndex;
  2170. m_mesgLookup.Add(MesgNum.Totals, totalsMesg);
  2171. mesgIndex++;
  2172. // WeightScale
  2173. Mesg weightScaleMesg = new Mesg("WeightScale", MesgNum.WeightScale);
  2174. fieldIndex = 0;
  2175. weightScaleMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2176. fieldIndex++;
  2177. weightScaleMesg.SetField(new Field("Weight", 0, 132, 100, 0, "kg", false));
  2178. fieldIndex++;
  2179. weightScaleMesg.SetField(new Field("PercentFat", 1, 132, 100, 0, "%", false));
  2180. fieldIndex++;
  2181. weightScaleMesg.SetField(new Field("PercentHydration", 2, 132, 100, 0, "%", false));
  2182. fieldIndex++;
  2183. weightScaleMesg.SetField(new Field("VisceralFatMass", 3, 132, 100, 0, "kg", false));
  2184. fieldIndex++;
  2185. weightScaleMesg.SetField(new Field("BoneMass", 4, 132, 100, 0, "kg", false));
  2186. fieldIndex++;
  2187. weightScaleMesg.SetField(new Field("MuscleMass", 5, 132, 100, 0, "kg", false));
  2188. fieldIndex++;
  2189. weightScaleMesg.SetField(new Field("BasalMet", 7, 132, 4, 0, "kcal/day", false));
  2190. fieldIndex++;
  2191. weightScaleMesg.SetField(new Field("PhysiqueRating", 8, 2, 1, 0, "", false));
  2192. fieldIndex++;
  2193. weightScaleMesg.SetField(new Field("ActiveMet", 9, 132, 4, 0, "kcal/day", false));
  2194. fieldIndex++;
  2195. weightScaleMesg.SetField(new Field("MetabolicAge", 10, 2, 1, 0, "years", false));
  2196. fieldIndex++;
  2197. weightScaleMesg.SetField(new Field("VisceralFatRating", 11, 2, 1, 0, "", false));
  2198. fieldIndex++;
  2199. weightScaleMesg.SetField(new Field("UserProfileIndex", 12, 132, 1, 0, "", false));
  2200. fieldIndex++;
  2201. mesgs.Add(weightScaleMesg);
  2202. WeightScaleIndex = mesgIndex;
  2203. m_mesgLookup.Add(MesgNum.WeightScale, weightScaleMesg);
  2204. mesgIndex++;
  2205. // BloodPressure
  2206. Mesg bloodPressureMesg = new Mesg("BloodPressure", MesgNum.BloodPressure);
  2207. fieldIndex = 0;
  2208. bloodPressureMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2209. fieldIndex++;
  2210. bloodPressureMesg.SetField(new Field("SystolicPressure", 0, 132, 1, 0, "mmHg", false));
  2211. fieldIndex++;
  2212. bloodPressureMesg.SetField(new Field("DiastolicPressure", 1, 132, 1, 0, "mmHg", false));
  2213. fieldIndex++;
  2214. bloodPressureMesg.SetField(new Field("MeanArterialPressure", 2, 132, 1, 0, "mmHg", false));
  2215. fieldIndex++;
  2216. bloodPressureMesg.SetField(new Field("Map3SampleMean", 3, 132, 1, 0, "mmHg", false));
  2217. fieldIndex++;
  2218. bloodPressureMesg.SetField(new Field("MapMorningValues", 4, 132, 1, 0, "mmHg", false));
  2219. fieldIndex++;
  2220. bloodPressureMesg.SetField(new Field("MapEveningValues", 5, 132, 1, 0, "mmHg", false));
  2221. fieldIndex++;
  2222. bloodPressureMesg.SetField(new Field("HeartRate", 6, 2, 1, 0, "bpm", false));
  2223. fieldIndex++;
  2224. bloodPressureMesg.SetField(new Field("HeartRateType", 7, 0, 1, 0, "", false));
  2225. fieldIndex++;
  2226. bloodPressureMesg.SetField(new Field("Status", 8, 0, 1, 0, "", false));
  2227. fieldIndex++;
  2228. bloodPressureMesg.SetField(new Field("UserProfileIndex", 9, 132, 1, 0, "", false));
  2229. fieldIndex++;
  2230. mesgs.Add(bloodPressureMesg);
  2231. BloodPressureIndex = mesgIndex;
  2232. m_mesgLookup.Add(MesgNum.BloodPressure, bloodPressureMesg);
  2233. mesgIndex++;
  2234. // MonitoringInfo
  2235. Mesg monitoringInfoMesg = new Mesg("MonitoringInfo", MesgNum.MonitoringInfo);
  2236. fieldIndex = 0;
  2237. monitoringInfoMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2238. fieldIndex++;
  2239. monitoringInfoMesg.SetField(new Field("LocalTimestamp", 0, 134, 1, 0, "s", false));
  2240. fieldIndex++;
  2241. monitoringInfoMesg.SetField(new Field("ActivityType", 1, 0, 1, 0, "", false));
  2242. fieldIndex++;
  2243. monitoringInfoMesg.SetField(new Field("CyclesToDistance", 3, 132, 5000, 0, "m/cycle", false));
  2244. fieldIndex++;
  2245. monitoringInfoMesg.SetField(new Field("CyclesToCalories", 4, 132, 5000, 0, "kcal/cycle", false));
  2246. fieldIndex++;
  2247. monitoringInfoMesg.SetField(new Field("RestingMetabolicRate", 5, 132, 1, 0, "kcal / day", false));
  2248. fieldIndex++;
  2249. mesgs.Add(monitoringInfoMesg);
  2250. MonitoringInfoIndex = mesgIndex;
  2251. m_mesgLookup.Add(MesgNum.MonitoringInfo, monitoringInfoMesg);
  2252. mesgIndex++;
  2253. // Monitoring
  2254. Mesg monitoringMesg = new Mesg("Monitoring", MesgNum.Monitoring);
  2255. fieldIndex = 0;
  2256. monitoringMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2257. fieldIndex++;
  2258. monitoringMesg.SetField(new Field("DeviceIndex", 0, 2, 1, 0, "", false));
  2259. fieldIndex++;
  2260. monitoringMesg.SetField(new Field("Calories", 1, 132, 1, 0, "kcal", false));
  2261. fieldIndex++;
  2262. monitoringMesg.SetField(new Field("Distance", 2, 134, 100, 0, "m", false));
  2263. fieldIndex++;
  2264. monitoringMesg.SetField(new Field("Cycles", 3, 134, 2, 0, "cycles", false));
  2265. subfieldIndex = 0;
  2266. monitoringMesg.fields[fieldIndex].subfields.Add(new Subfield("Steps", 134, 1, 0, "steps"));
  2267. monitoringMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 6);
  2268. monitoringMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 1);
  2269. subfieldIndex++;
  2270. monitoringMesg.fields[fieldIndex].subfields.Add(new Subfield("Strokes", 134, 2, 0, "strokes"));
  2271. monitoringMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 2);
  2272. monitoringMesg.fields[fieldIndex].subfields[subfieldIndex].AddMap(5, 5);
  2273. subfieldIndex++;
  2274. fieldIndex++;
  2275. monitoringMesg.SetField(new Field("ActiveTime", 4, 134, 1000, 0, "s", false));
  2276. fieldIndex++;
  2277. monitoringMesg.SetField(new Field("ActivityType", 5, 0, 1, 0, "", false));
  2278. fieldIndex++;
  2279. monitoringMesg.SetField(new Field("ActivitySubtype", 6, 0, 1, 0, "", false));
  2280. fieldIndex++;
  2281. monitoringMesg.SetField(new Field("ActivityLevel", 7, 0, 1, 0, "", false));
  2282. fieldIndex++;
  2283. monitoringMesg.SetField(new Field("Distance16", 8, 132, 1, 0, "100 * m", false));
  2284. fieldIndex++;
  2285. monitoringMesg.SetField(new Field("Cycles16", 9, 132, 1, 0, "2 * cycles (steps)", false));
  2286. fieldIndex++;
  2287. monitoringMesg.SetField(new Field("ActiveTime16", 10, 132, 1, 0, "s", false));
  2288. fieldIndex++;
  2289. monitoringMesg.SetField(new Field("LocalTimestamp", 11, 134, 1, 0, "", false));
  2290. fieldIndex++;
  2291. monitoringMesg.SetField(new Field("Temperature", 12, 131, 100, 0, "C", false));
  2292. fieldIndex++;
  2293. monitoringMesg.SetField(new Field("TemperatureMin", 14, 131, 100, 0, "C", false));
  2294. fieldIndex++;
  2295. monitoringMesg.SetField(new Field("TemperatureMax", 15, 131, 100, 0, "C", false));
  2296. fieldIndex++;
  2297. monitoringMesg.SetField(new Field("ActivityTime", 16, 132, 1, 0, "minutes", false));
  2298. fieldIndex++;
  2299. monitoringMesg.SetField(new Field("ActiveCalories", 19, 132, 1, 0, "kcal", false));
  2300. fieldIndex++;
  2301. monitoringMesg.SetField(new Field("CurrentActivityTypeIntensity", 24, 13, 1, 0, "", false));
  2302. monitoringMesg.fields[fieldIndex].components.Add(new FieldComponent(5, false, 5, 1, 0)); // activity_type
  2303. monitoringMesg.fields[fieldIndex].components.Add(new FieldComponent(28, false, 3, 1, 0)); // intensity
  2304. fieldIndex++;
  2305. monitoringMesg.SetField(new Field("TimestampMin8", 25, 2, 1, 0, "min", false));
  2306. fieldIndex++;
  2307. monitoringMesg.SetField(new Field("Timestamp16", 26, 132, 1, 0, "s", false));
  2308. fieldIndex++;
  2309. monitoringMesg.SetField(new Field("HeartRate", 27, 2, 1, 0, "bpm", false));
  2310. fieldIndex++;
  2311. monitoringMesg.SetField(new Field("Intensity", 28, 2, 10, 0, "", false));
  2312. fieldIndex++;
  2313. monitoringMesg.SetField(new Field("DurationMin", 29, 132, 1, 0, "min", false));
  2314. fieldIndex++;
  2315. monitoringMesg.SetField(new Field("Duration", 30, 134, 1, 0, "s", false));
  2316. fieldIndex++;
  2317. monitoringMesg.SetField(new Field("Ascent", 31, 134, 1000, 0, "m", false));
  2318. fieldIndex++;
  2319. monitoringMesg.SetField(new Field("Descent", 32, 134, 1000, 0, "m", false));
  2320. fieldIndex++;
  2321. monitoringMesg.SetField(new Field("ModerateActivityMinutes", 33, 132, 1, 0, "minutes", false));
  2322. fieldIndex++;
  2323. monitoringMesg.SetField(new Field("VigorousActivityMinutes", 34, 132, 1, 0, "minutes", false));
  2324. fieldIndex++;
  2325. mesgs.Add(monitoringMesg);
  2326. MonitoringIndex = mesgIndex;
  2327. m_mesgLookup.Add(MesgNum.Monitoring, monitoringMesg);
  2328. mesgIndex++;
  2329. // Hr
  2330. Mesg hrMesg = new Mesg("Hr", MesgNum.Hr);
  2331. fieldIndex = 0;
  2332. hrMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "", false));
  2333. fieldIndex++;
  2334. hrMesg.SetField(new Field("FractionalTimestamp", 0, 132, 32768, 0, "s", false));
  2335. fieldIndex++;
  2336. hrMesg.SetField(new Field("Time256", 1, 2, 256, 0, "s", false));
  2337. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(0, false, 8, 256, 0)); // fractional_timestamp
  2338. fieldIndex++;
  2339. hrMesg.SetField(new Field("FilteredBpm", 6, 2, 1, 0, "bpm", false));
  2340. fieldIndex++;
  2341. hrMesg.SetField(new Field("EventTimestamp", 9, 134, 1024, 0, "s", true));
  2342. fieldIndex++;
  2343. hrMesg.SetField(new Field("EventTimestamp12", 10, 13, 1, 0, "", false));
  2344. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2345. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2346. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2347. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2348. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2349. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2350. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2351. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2352. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2353. hrMesg.fields[fieldIndex].components.Add(new FieldComponent(9, true, 12, 1024, 0)); // event_timestamp
  2354. fieldIndex++;
  2355. mesgs.Add(hrMesg);
  2356. HrIndex = mesgIndex;
  2357. m_mesgLookup.Add(MesgNum.Hr, hrMesg);
  2358. mesgIndex++;
  2359. // MemoGlob
  2360. Mesg memoGlobMesg = new Mesg("MemoGlob", MesgNum.MemoGlob);
  2361. fieldIndex = 0;
  2362. memoGlobMesg.SetField(new Field("PartIndex", 250, 134, 1, 0, "", false));
  2363. fieldIndex++;
  2364. memoGlobMesg.SetField(new Field("Memo", 0, 13, 1, 0, "", false));
  2365. fieldIndex++;
  2366. memoGlobMesg.SetField(new Field("MessageNumber", 1, 132, 1, 0, "", false));
  2367. fieldIndex++;
  2368. memoGlobMesg.SetField(new Field("MessageIndex", 2, 132, 1, 0, "", false));
  2369. fieldIndex++;
  2370. mesgs.Add(memoGlobMesg);
  2371. MemoGlobIndex = mesgIndex;
  2372. m_mesgLookup.Add(MesgNum.MemoGlob, memoGlobMesg);
  2373. mesgIndex++;
  2374. // AntChannelId
  2375. Mesg antChannelIdMesg = new Mesg("AntChannelId", MesgNum.AntChannelId);
  2376. fieldIndex = 0;
  2377. antChannelIdMesg.SetField(new Field("ChannelNumber", 0, 2, 1, 0, "", false));
  2378. fieldIndex++;
  2379. antChannelIdMesg.SetField(new Field("DeviceType", 1, 10, 1, 0, "", false));
  2380. fieldIndex++;
  2381. antChannelIdMesg.SetField(new Field("DeviceNumber", 2, 139, 1, 0, "", false));
  2382. fieldIndex++;
  2383. antChannelIdMesg.SetField(new Field("TransmissionType", 3, 10, 1, 0, "", false));
  2384. fieldIndex++;
  2385. antChannelIdMesg.SetField(new Field("DeviceIndex", 4, 2, 1, 0, "", false));
  2386. fieldIndex++;
  2387. mesgs.Add(antChannelIdMesg);
  2388. AntChannelIdIndex = mesgIndex;
  2389. m_mesgLookup.Add(MesgNum.AntChannelId, antChannelIdMesg);
  2390. mesgIndex++;
  2391. // AntRx
  2392. Mesg antRxMesg = new Mesg("AntRx", MesgNum.AntRx);
  2393. fieldIndex = 0;
  2394. antRxMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2395. fieldIndex++;
  2396. antRxMesg.SetField(new Field("FractionalTimestamp", 0, 132, 32768, 0, "s", false));
  2397. fieldIndex++;
  2398. antRxMesg.SetField(new Field("MesgId", 1, 13, 1, 0, "", false));
  2399. fieldIndex++;
  2400. antRxMesg.SetField(new Field("MesgData", 2, 13, 1, 0, "", false));
  2401. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(3, false, 8, 1, 0)); // channel_number
  2402. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2403. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2404. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2405. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2406. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2407. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2408. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2409. antRxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2410. fieldIndex++;
  2411. antRxMesg.SetField(new Field("ChannelNumber", 3, 2, 1, 0, "", false));
  2412. fieldIndex++;
  2413. antRxMesg.SetField(new Field("Data", 4, 13, 1, 0, "", false));
  2414. fieldIndex++;
  2415. mesgs.Add(antRxMesg);
  2416. AntRxIndex = mesgIndex;
  2417. m_mesgLookup.Add(MesgNum.AntRx, antRxMesg);
  2418. mesgIndex++;
  2419. // AntTx
  2420. Mesg antTxMesg = new Mesg("AntTx", MesgNum.AntTx);
  2421. fieldIndex = 0;
  2422. antTxMesg.SetField(new Field("Timestamp", 253, 134, 1, 0, "s", false));
  2423. fieldIndex++;
  2424. antTxMesg.SetField(new Field("FractionalTimestamp", 0, 132, 32768, 0, "s", false));
  2425. fieldIndex++;
  2426. antTxMesg.SetField(new Field("MesgId", 1, 13, 1, 0, "", false));
  2427. fieldIndex++;
  2428. antTxMesg.SetField(new Field("MesgData", 2, 13, 1, 0, "", false));
  2429. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(3, false, 8, 1, 0)); // channel_number
  2430. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2431. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2432. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2433. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2434. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2435. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2436. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2437. antTxMesg.fields[fieldIndex].components.Add(new FieldComponent(4, false, 8, 1, 0)); // data
  2438. fieldIndex++;
  2439. antTxMesg.SetField(new Field("ChannelNumber", 3, 2, 1, 0, "", false));
  2440. fieldIndex++;
  2441. antTxMesg.SetField(new Field("Data", 4, 13, 1, 0, "", false));
  2442. fieldIndex++;
  2443. mesgs.Add(antTxMesg);
  2444. AntTxIndex = mesgIndex;
  2445. m_mesgLookup.Add(MesgNum.AntTx, antTxMesg);
  2446. mesgIndex++;
  2447. // Pad
  2448. Mesg padMesg = new Mesg("Pad", MesgNum.Pad);
  2449. fieldIndex = 0;
  2450. mesgs.Add(padMesg);
  2451. PadIndex = mesgIndex;
  2452. m_mesgLookup.Add(MesgNum.Pad, padMesg);
  2453. mesgIndex++;
  2454. #pragma warning restore 0618
  2455. //InvalidIndex; = FitTypeInvalid.uint16;
  2456. }
  2457. #endregion
  2458. #region Methods
  2459. public static Mesg GetMesg(ushort globalMesgNum)
  2460. {
  2461. if(m_mesgLookup.ContainsKey(globalMesgNum))
  2462. {
  2463. return m_mesgLookup[globalMesgNum];
  2464. }
  2465. return new Mesg("unknown", globalMesgNum);
  2466. }
  2467. public static Field GetField(ushort globalMesgNum, byte fieldNum)
  2468. {
  2469. if(m_mesgLookup.ContainsKey(globalMesgNum))
  2470. {
  2471. return m_mesgLookup[globalMesgNum].GetField(fieldNum);
  2472. }
  2473. return new Field("unknown", fieldNum, 0, 1, 0, "", false);
  2474. }
  2475. #endregion
  2476. } // class
  2477. } // namespace