ubxmessage.h 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125
  1. /*
  2. * ubxproto
  3. * Copyright (c) 2014, Alexey Edelev aka semlanik, All rights reserved.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 3.0 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library.
  17. *
  18. * Additionally to GNU Lesser General Public License you MUST NOT
  19. * static link this library to your application and MUST add link to author
  20. * and source of this library in your application.
  21. *
  22. * Actual LGPL text https://www.gnu.org/licenses/lgpl.html
  23. *
  24. * File: ubxmessage.h
  25. */
  26. /*! \file */
  27. #ifndef UBXMESSAGE_H
  28. #define UBXMESSAGE_H
  29. #include <stdio.h>
  30. #include "portable_endian.h"
  31. #ifdef __linux__
  32. #include <sys/types.h>
  33. #elif defined(_WIN32)
  34. //Need to add other OS depend headers
  35. #endif
  36. /*
  37. * Need to clarify how many I/O ports has each version of UBLOX before define UBX_IO_PORTS_NUM macros
  38. * current proto vesion has hardcoded 6 I/O ports by default. If you have other I/O ports amount
  39. * please define macro manualy by yourself.
  40. */
  41. #define UBX_IO_PORTS_NUM 6
  42. //#if!defined UBLOX_VERSION
  43. //#error Before using library define UBLOX_VERSION first
  44. //#else
  45. //#if UBLOX_VERSION == 5 || UBLOX_VERSION == 6
  46. //#define UBX_IO_PORTS_NUM 6
  47. //#else
  48. //#define UBX_IO_PORTS_NUM 6
  49. //#endif
  50. //#endif
  51. static const int UBX_CHECKSUM_SIZE = 2;
  52. static const int UBX_HEADER_SIZE = 6;
  53. static const u_int16_t UBX_PREAMBLE = 0xB562;
  54. #if defined (__linux__)
  55. typedef u_int8_t UBXU1_t;
  56. typedef int8_t UBXI1_t;
  57. typedef u_int8_t UBXX1_t;
  58. typedef u_int16_t UBXU2_t;
  59. typedef int16_t UBXI2_t;
  60. typedef u_int16_t UBXX2_t;
  61. typedef u_int32_t UBXU4_t;
  62. typedef int32_t UBXI4_t;
  63. typedef u_int32_t UBXX4_t;
  64. typedef float UBXR4_t;
  65. typedef double UBXR8_t;
  66. typedef char UBXCH_t;
  67. #else
  68. typedef unsigned char UBXU1_t;
  69. typedef char UBXI1_t;
  70. typedef unsigned char UBXX1_t;
  71. typedef unsigned short UBXU2_t;
  72. typedef short UBXI2_t;
  73. typedef unsigned short UBXX2_t;
  74. typedef unsigned int UBXU4_t;
  75. typedef int UBXI4_t;
  76. typedef unsigned int UBXX4_t;
  77. typedef float UBXR4_t;
  78. typedef double UBXR8_t;
  79. typedef char UBXCH_t;
  80. #endif
  81. enum UBXMessageClass
  82. {
  83. UBXMsgClassNAV = 0x01,
  84. UBXMsgClassRXM = 0x02,
  85. UBXMsgClassINF = 0x04,
  86. UBXMsgClassACK = 0x05,
  87. UBXMsgClassCFG = 0x06,
  88. UBXMsgClassMON = 0x0A,
  89. UBXMsgClassAID = 0x0B,
  90. UBXMsgClassTIM = 0x0D,
  91. UBXMsgClassLOG = 0x21,
  92. UBXMsgClassInvalid = 255
  93. };
  94. enum UBXMessageId
  95. {
  96. UBXMsgIdACK_NACK = 0x00,
  97. UBXMsgIdACK_ACK = 0x01,
  98. UBXMsgIdAID_ALM = 0x30,
  99. UBXMsgIdAID_ALPSRV = 0x32,
  100. UBXMsgIdAID_ALP = 0x50,
  101. UBXMsgIdAID_AOP = 0x33,
  102. UBXMsgIdAID_DATA = 0x10,
  103. UBXMsgIdAID_EPH = 0x31,
  104. UBXMsgIdAID_HUI = 0x02,
  105. UBXMsgIdAID_INI = 0x01,
  106. UBXMsgIdAID_REQ = 0x00,
  107. UBXMsgIdCFG_ANT = 0x13,
  108. UBXMsgIdCFG_CFG = 0x09,
  109. UBXMsgIdCFG_DAT = 0x06,
  110. UBXMsgIdCFG_GNSS = 0x3E,
  111. UBXMsgIdCFG_INF = 0x02,
  112. UBXMsgIdCFG_ITFM = 0x39,
  113. UBXMsgIdCFG_LOGFILTER = 0x47,
  114. UBXMsgIdCFG_MSG = 0x01,
  115. UBXMsgIdCFG_NAV5 = 0x24,
  116. UBXMsgIdCFG_NAVX5 = 0x23,
  117. UBXMsgIdCFG_NMEA = 0x17,
  118. UBXMsgIdCFG_NVS = 0x22,
  119. UBXMsgIdCFG_PM2 = 0x3B,
  120. UBXMsgIdCFG_PRT = 0x00,
  121. UBXMsgIdCFG_RATE = 0x08,
  122. UBXMsgIdCFG_RINV = 0x34,
  123. UBXMsgIdCFG_RST = 0x04,
  124. UBXMsgIdCFG_RXM = 0x11,
  125. UBXMsgIdCFG_SBAS = 0x16,
  126. UBXMsgIdCFG_TP5 = 0x31,
  127. UBXMsgIdCFG_USB = 0x1B,
  128. UBXMsgIdINF_DEBUG = 0x04,
  129. UBXMsgIdINF_ERROR = 0x00,
  130. UBXMsgIdINF_NOTICE = 0x02,
  131. UBXMsgIdINF_TEST = 0x03,
  132. UBXMsgIdINF_WARNING = 0x01,
  133. UBXMsgIdLOG_CREATE = 0x07,
  134. UBXMsgIdLOG_ERASE = 0x03,
  135. UBXMsgIdLOG_FINDTIME = 0x0E,
  136. UBXMsgIdLOG_INFO = 0x08,
  137. UBXMsgIdLOG_RETRIEVEPOS = 0x0B,
  138. UBXMsgIdLOG_RETRIEVESTRING = 0x0D,
  139. UBXMsgIdLOG_RETRIEVE = 0x09,
  140. UBXMsgIdLOG_STRING = 0x04,
  141. UBXMsgIdMON_HW2 = 0x0B,
  142. UBXMsgIdMON_HW = 0x09,
  143. UBXMsgIdMON_IO = 0x02,
  144. UBXMsgIdMON_MSGPP = 0x06,
  145. UBXMsgIdMON_RXBUF = 0x07,
  146. UBXMsgIdMON_RXR = 0x21,
  147. UBXMsgIdMON_TXBUF = 0x08,
  148. UBXMsgIdMON_VER = 0x04,
  149. UBXMsgIdNAV_AOPSTATUS = 0x60,
  150. UBXMsgIdNAV_CLOCK = 0x22,
  151. UBXMsgIdNAV_DGPS = 0x31,
  152. UBXMsgIdNAV_DOP = 0x04,
  153. UBXMsgIdNAV_POSECEF = 0x01,
  154. UBXMsgIdNAV_POSLLH = 0x02,
  155. UBXMsgIdNAV_PVT = 0x07,
  156. UBXMsgIdNAV_SBAS = 0x32,
  157. UBXMsgIdNAV_SOL = 0x06,
  158. UBXMsgIdNAV_STATUS = 0x03,
  159. UBXMsgIdNAV_SVINFO = 0x30,
  160. UBXMsgIdNAV_TIMEGPS = 0x20,
  161. UBXMsgIdNAV_TIMEUTC = 0x21,
  162. UBXMsgIdNAV_VELECEF = 0x11,
  163. UBXMsgIdNAV_VELNED = 0x12,
  164. UBXMsgIdRXM_ALM = 0x30,
  165. UBXMsgIdRXM_EPH = 0x31,
  166. UBXMsgIdRXM_PMREQ = 0x41,
  167. UBXMsgIdRXM_RAW = 0x10,
  168. UBXMsgIdRXM_SFRB = 0x11,
  169. UBXMsgIdRXM_SVSI = 0x20,
  170. UBXMsgIdTIM_TM2 = 0x03,
  171. UBXMsgIdTIM_TP = 0x01,
  172. UBXMsgIdTIM_VRFY = 0x06,
  173. UBXMsgIdInvalid = 0xFF
  174. };
  175. enum UBXResetMode
  176. {
  177. UBXHardwareReset = 0x00,
  178. UBXControlledReset = 0x01,
  179. UBXControlledResetGNSSOnly = 0x02,
  180. UBXHardwareResetAfterShutdown = 0x04,
  181. UBXControlledGNSSStop = 0x08,
  182. UBXControlledGNSSStart = 0x09
  183. };
  184. enum UBXBBRSpecialSets
  185. {
  186. UBXBBRHotstart = 0x0000,
  187. UBXBBRWarmstart = 0x0001,
  188. UBXBBRColdstart = 0xFFFF
  189. };
  190. enum UBXBBRMask
  191. {
  192. UBXBBReph = 1,
  193. UBXBBRalm = 1 << 1,
  194. UBXBBRhealth = 1 << 2,
  195. UBXBBRklob = 1 << 3,
  196. UBXBBRpos = 1 << 4,
  197. UBXBBRclkd = 1 << 5,
  198. UBXBBRosc = 1 << 6,
  199. UBXBBRutc = 1 << 7,
  200. UBXBBRrtc = 1 << 8,
  201. UBXBBRsfdr = 1 << 11,
  202. UBXBBRvmon = 1 << 12,
  203. UBXBBRtct = 1 << 13,
  204. UBXBBRaop = 1 << 15
  205. };
  206. enum UBXHUIFlags
  207. {
  208. UBXHUIHealthValid = 1,
  209. UBXHUIUTCValid = 1 << 1,
  210. UBXHUIKlobValid = 1 << 2
  211. };
  212. enum UBXINItmCfg
  213. {
  214. UBXINIfEdge = 1 << 1,
  215. UBXINItm1 = 1 << 4,
  216. UBXINIf1 = 1 << 6
  217. };
  218. enum UBXINIFlags
  219. {
  220. UBXINIpos = 1,
  221. UBXINItime = 1 << 1,
  222. UBXINIclockD = 1 << 2,
  223. UBXINItp = 1 << 3,
  224. UBXINIclockF = 1 << 4,
  225. UBXINIlla = 1 << 5,
  226. UBXINIaltInv = 1 << 6,
  227. UBXINIprevTm = 1 << 7,
  228. UBXINIutc = 1 << 10
  229. };
  230. enum UBXANTFlags
  231. {
  232. UBXANTsvcs = 1,
  233. UBXANTscd = 1 << 1,
  234. UBXANTocd = 1 << 2,
  235. UBXANTpdwnOnSCD = 1 << 3,
  236. UBXANTrecovery = 1 << 4
  237. };
  238. enum UBXCFGMask
  239. {
  240. //CFG_CFG message
  241. UBXCFGioPort = 1,
  242. UBXCFGmsgConf = 1 << 1,
  243. UBXCFGinfMsg = 1 << 2,
  244. UBXCFGnavConf = 1 << 3,
  245. UBXCFGrxmConf = 1 << 4,
  246. UBXCFGrinvConf = 1 << 9,
  247. UBXCFGantConf = 1 << 10,
  248. //CFG_NVS message
  249. UBXCFGalm = 1 << 17,
  250. UBXCFGaopConf = 1 << 29
  251. };
  252. enum UBXCFGDeviceMask
  253. {
  254. UBXCFGdevBBR = 1,
  255. UBXCFGdevFlash = 1 << 1,
  256. UBXCFGdevEEPROM = 1 << 2,
  257. UBXCFGdevSpiFlash = 1 << 5
  258. };
  259. enum UBXCFGTimepulses
  260. {
  261. UBXCFGTimepulse = 0,
  262. UBXCFGTimepulse2 = 1
  263. };
  264. enum UBXCFGTimepulseFlags
  265. {
  266. UBXCFGTimepulseActive = 1,
  267. UBXCFGTimepulseLockGpsFreq = 1 << 1,
  268. UBXCFGTimepulseLockedOtherSet = 1 << 2,
  269. UBXCFGTimepulseIsFreq = 1 << 3,
  270. UBXCFGTimepulseIsLenght = 1 << 4,
  271. UBXCFGTimepulseAlignToTow = 1 << 5,
  272. UBXCFGTimepulsePolarity = 1 << 6,
  273. UBXCFGTimepulseGridUTSGPS = 1 << 7
  274. };
  275. enum UBXCFGProtocolIds
  276. {
  277. UBXProtocol = 0,
  278. UBXNMEAProtocol
  279. };
  280. enum UBXGNSSIds
  281. {
  282. UBXGPS,
  283. UBXSBAS,
  284. UBXQZSS = 5,
  285. UBXGLONASS = 6
  286. };
  287. enum UBXCFGInfMsgMask
  288. {
  289. UBXInfError = 1,
  290. UBXInfWarning = 1 << 1,
  291. UBXInfNotice = 1 << 2,
  292. UBXInfDebug = 1 << 3,
  293. UBXInfTest = 1 << 4
  294. };
  295. enum UBXITFMAntSetting
  296. {
  297. UBXITFMAntUnknown = 0,
  298. UBXITFMAntPassive = 1,
  299. UBXITFMAntActive = 2
  300. };
  301. enum UBXLOGFILTERFlags
  302. {
  303. UBXLOGFILTERRecordEnabled = 1,
  304. UBXLOGFILTERPsmOncePerWakupEnabled = 1 << 1,
  305. UBXLOGFILTERApplyAllFilterSettings = 1 << 2
  306. };
  307. enum UBXNAV5Mask
  308. {
  309. UBXNAV5Dyn = 1,
  310. UBXNAV5MinEl = 1 << 1,
  311. UBXNAV5PosFixMode = 1 << 2,
  312. UBXNAV5DrLim = 1 << 3,
  313. UBXNAV5PosMask = 1 << 4,
  314. UBXNAV5TimeMask = 1 << 5,
  315. UBXNAV5StaticHoldMask = 1 << 6,
  316. UBXNAV5DgpsMask = 1 << 7,
  317. };
  318. enum UBXNAV5Model
  319. {
  320. UBXNAV5ModelPortable = 0,
  321. UBXNAV5ModelStationary = 2,
  322. UBXNAV5ModelPedestrian = 3,
  323. UBXNAV5ModelAutomotive = 4,
  324. UBXNAV5ModelSea = 5,
  325. UBXNAV5ModelAirborne1g = 6,
  326. UBXNAV5ModelAirborne2g = 7,
  327. UBXNAV5ModelAirborne4g = 8
  328. };
  329. enum UBXNAV5FixMode
  330. {
  331. UBXNAV5Fix2DOnly = 1,
  332. UBXNAV5Fix3DOnly = 2,
  333. UBXNAV5FixAuto2D3D = 3
  334. };
  335. enum UBXNAVX5Mask
  336. {
  337. UBXNAVX5AopMinMax = 1 << 2,
  338. UBXNAVX5AopMinCno = 1 << 3,
  339. UBXNAVX5AopInitial3dfix = 1 << 6,
  340. UBXNAVX5AopWknRoll = 1 << 9,
  341. UBXNAVX5AopPPP = 1 << 13,
  342. UBXNAVX5Aop = 1 << 14
  343. };
  344. enum UBXNMEAFilter
  345. {
  346. UBXNMEAPosFilter = 1,
  347. UBXNMEAMskPosFilter = 1 << 1,
  348. UBXNMEATimeFilter = 1 << 2,
  349. UBXNMEADateFilter = 1 << 3,
  350. UBXNMEAGPSOnlyFilter = 1 << 4,
  351. UBXNMEATrackFilter = 1 << 5,
  352. };
  353. enum UBXNMEAVersion
  354. {
  355. UBXNMEAVersion23 = 0x23,
  356. UBXNMEAVersion21 = 0x21
  357. };
  358. enum UBXNMEAFlags
  359. {
  360. UBXNMEACompatFlag = 1,
  361. UBXNMEAConsiderFlag = 1 << 1
  362. };
  363. enum UBXNMEAGNSSToFilter
  364. {
  365. UBXNMEAGPSFilter = 1,
  366. UBXNMEASBASFilter = 1 << 1,
  367. UBXNMEAQZSSFilter = 1 << 4,
  368. UBXNMEAGLONASSFilter = 1 << 5
  369. };
  370. enum UBXNMEASVNumbering
  371. {
  372. UBXNMEASVNumStrict = 0,
  373. UBXNMEASVNumExtended = 1
  374. };
  375. enum UBXNMEATalkerIds
  376. {
  377. UBXNMEATalkerNotOverriden = 0,
  378. UBXNMEATalkerGP = 1,
  379. UBXNMEATalkerGL = 2,
  380. UBXNMEATalkerGN = 3
  381. };
  382. enum UBXNMEAGSVTalkerIds
  383. {
  384. UBXNMEAGSVTalkerGNSSSpecific = 0,
  385. UBXNMEAGSVTalkerMain = 1
  386. };
  387. enum UBXPM2LimitPeakCurrent
  388. {
  389. UBXPM2LimitCurrentDisabled = 0x00,
  390. UBXPM2LimitCurrentEnabled = 0x01
  391. };
  392. enum UBXPM2Mode
  393. {
  394. UBXPM2OnOffOperation = 0x00,
  395. UBXPM2CyclicTrackOperation = 0x01
  396. };
  397. enum UBXPRTModeCharLen
  398. {
  399. UBXPRTMode5BitCharLen = 0x00, //Not supported
  400. UBXPRTMode6BitCharLen = 0x01, //Not supported
  401. UBXPRTMode7BitCharLen = 0x02, //Supported only with parity
  402. UBXPRTMode8BitCharLen = 0x03
  403. };
  404. enum UBXPRTModeParity
  405. {
  406. UBXPRTModeEvenParity = 0,
  407. UBXPRTModeOddParity = 1,
  408. UBXPRTModeNoParity = 1 << 3,
  409. UBXPRTModeReserved = 1 << 2
  410. };
  411. enum UBXPRTModeStopBits
  412. {
  413. UBXPRTMode1StopBit = 0,
  414. UBXPRTMode1dot5StopBit = 1,
  415. UBXPRTMode2StopBit = 2,
  416. UBXPRTMode0dot5StopBit = 3,
  417. };
  418. enum UBXPRTInProtoMask
  419. {
  420. UBXPRTInProtoInUBX = 1,
  421. UBXPRTInProtoInNMEA = 1 << 1,
  422. UBXPRTInProtoInRTCM = 1 << 2
  423. };
  424. enum UBXPRTOutProtoMask
  425. {
  426. UBXPRTOutProtoOutUBX = 1,
  427. UBXPRTOutProtoOutNMEA = 1 << 1
  428. };
  429. enum UBXPRTFlags
  430. {
  431. UBXPRTExtendedTxTimeout = 1 << 1
  432. };
  433. enum UBXPRTSPIMode {
  434. UBXPRTSPIMode0 = 0, //CPOL = 0, CPHA = 0
  435. UBXPRTSPIMode1, //CPOL = 0, CPHA = 1
  436. UBXPRTSPIMode2, //CPOL = 1, CPHA = 0
  437. UBXPRTSPIMode3, //CPOL = 1, CPHA = 1
  438. };
  439. enum UBXRINVFlags
  440. {
  441. UBXRINVDump = 1,
  442. UBXRINVBinary = 1 << 1
  443. };
  444. enum UBXRXMLowPowerModes
  445. {
  446. UBXRXMContinousMode = 0,
  447. UBXRXMPowerSaveMode = 1
  448. };
  449. enum UBXSBASModes
  450. {
  451. UBXSBASModeEnabled = 1,
  452. UBXSBASModeTest = 1 << 1
  453. };
  454. enum UBXSBASUsage
  455. {
  456. UBXSBASUsageRange = 1,
  457. UBXSBASUsageDiffCorr = 1 << 1,
  458. UBXSBASUsageIntegrity = 1 << 2
  459. };
  460. enum UBXSBASScanModes2
  461. {
  462. UBXSBASScanModePRN152 = 1,
  463. UBXSBASScanModePRN153 = 1 << 1,
  464. UBXSBASScanModePRN154 = 1 << 2,
  465. UBXSBASScanModePRN155 = 1 << 3,
  466. UBXSBASScanModePRN156 = 1 << 4,
  467. UBXSBASScanModePRN157 = 1 << 5,
  468. UBXSBASScanModePRN158 = 1 << 6
  469. };
  470. enum UBXSBASScanModes1
  471. {
  472. UBXSBASScanModePRN120 = 1,
  473. UBXSBASScanModePRN121 = 1 << 1,
  474. UBXSBASScanModePRN122 = 1 << 2,
  475. UBXSBASScanModePRN123 = 1 << 3,
  476. UBXSBASScanModePRN124 = 1 << 4,
  477. UBXSBASScanModePRN125 = 1 << 5,
  478. UBXSBASScanModePRN126 = 1 << 6,
  479. UBXSBASScanModePRN127 = 1 << 7,
  480. UBXSBASScanModePRN128 = 1 << 8,
  481. UBXSBASScanModePRN129 = 1 << 9,
  482. UBXSBASScanModePRN130 = 1 << 10,
  483. UBXSBASScanModePRN131 = 1 << 11,
  484. UBXSBASScanModePRN132 = 1 << 12,
  485. UBXSBASScanModePRN133 = 1 << 13,
  486. UBXSBASScanModePRN134 = 1 << 14,
  487. UBXSBASScanModePRN135 = 1 << 15,
  488. UBXSBASScanModePRN136 = 1 << 16,
  489. UBXSBASScanModePRN137 = 1 << 17,
  490. UBXSBASScanModePRN138 = 1 << 18,
  491. UBXSBASScanModePRN139 = 1 << 19,
  492. UBXSBASScanModePRN140 = 1 << 20,
  493. UBXSBASScanModePRN141 = 1 << 21,
  494. UBXSBASScanModePRN142 = 1 << 22,
  495. UBXSBASScanModePRN143 = 1 << 23,
  496. UBXSBASScanModePRN144 = 1 << 24,
  497. UBXSBASScanModePRN145 = 1 << 25,
  498. UBXSBASScanModePRN146 = 1 << 26,
  499. UBXSBASScanModePRN147 = 1 << 27,
  500. UBXSBASScanModePRN148 = 1 << 28,
  501. UBXSBASScanModePRN149 = 1 << 29,
  502. UBXSBASScanModePRN150 = 1 << 30,
  503. UBXSBASScanModePRN151 = 1 << 31,
  504. };
  505. enum UBXUSBFlags
  506. {
  507. USBFlagReEnum = 1,
  508. USBFlagPowerMode = 1 << 1
  509. };
  510. enum UBXLOGCfg
  511. {
  512. UBXLOGCfgCircular = 1
  513. };
  514. enum UBXLOGSize
  515. {
  516. UBXLOGMaximumSafeSize = 0,
  517. UBXLOGMinimunSize = 1,
  518. UBXLOGUserDefined = 2,
  519. };
  520. enum UBXLOGStatus
  521. {
  522. UBXLOGStatusRecording = 1 << 3,
  523. UBXLOGStatusInactive = 1 << 4,
  524. UBXLOGStatusCircular = 1 << 5
  525. };
  526. enum UBXRETRIEVEPOSFixType
  527. {
  528. UBXRETRIEVEPOS2DFix = 2,
  529. UBXRETRIEVEPOS3DFix = 3
  530. };
  531. enum UBXRXRFlags
  532. {
  533. UBXRXRAwake = 1
  534. };
  535. enum UBXAOPStatus
  536. {
  537. UBXAOPStatusIdle = 0,
  538. UBXAOPStatusRunning = 1
  539. };
  540. enum UBXAOPCfg
  541. {
  542. UBXAOPCfgUseAOP = 1
  543. };
  544. enum UBXGPSFix
  545. {
  546. UBXGPSNoFix = 0x00,
  547. UBXGPSDeadReckoning = 0x01,
  548. UBXGPS2DFix = 0x02,
  549. UBXGPS3DFix = 0x03,
  550. UBXGPSGNSSDeadReckoning = 0x04,
  551. UBXGPSTimeOnlyFix = 0x05
  552. };
  553. enum UBXPVTValid
  554. {
  555. UBXPVTValidDate = 1,
  556. UBXPVTValidTime = 1 << 1,
  557. UBXPVTFullyResolved = 1 << 2,
  558. };
  559. enum UBXPVTPSMStates
  560. {
  561. UBXPVTPSMStateNA = 0,
  562. UBXPVTPSMStateEnabled = 1,
  563. UBXPVTPSMStateAcquisition = 2,
  564. UBXPVTPSMStateTracking = 3,
  565. UBXPVTPSMStatePowerOptim = 4,
  566. UBXPVTPSMStateInactive = 5,
  567. };
  568. enum UBXSBASService
  569. {
  570. UBXSBASServiceRanging = 1,
  571. UBXSBASServiceCorrections = 1 << 1,
  572. UBXSBASServiceIntegrity = 1 << 2,
  573. UBXSBASServiceTestmode = 1 << 3
  574. };
  575. enum UBXSBASSOLFlags
  576. {
  577. UBXSBASSOLGPSfixOK = 1,
  578. UBXSBASSOLDiffSoln = 1 << 1,
  579. UBXSBASSOLWKNSet = 1 << 2,
  580. UBXSBASSOLTOWSet = 1 << 3
  581. };
  582. enum UBXSVINFOChipGen
  583. {
  584. UBXSVINFOAntarisChip = 0,
  585. UBXSVINFOUBlox5Chip = 1,
  586. UBXSVINFOUBlox6Chip = 2
  587. };
  588. enum UBXSVINFOFlags
  589. {
  590. UBXSVINFOFlagsSVUsed = 1,
  591. UBXSVINFOFlagsDiffCorr = 1 << 1,
  592. UBXSVINFOFlagsOrbitAvail = 1 << 2,
  593. UBXSVINFOFlagsOrbitEph = 1 << 3,
  594. UBXSVINFOFlagsUnhealthy = 1 << 4,
  595. UBXSVINFOFlagsOrbitAlm = 1 << 5,
  596. UBXSVINFOFlagsOrbitAop = 1 << 6,
  597. UBXSVINFOFlagsSmoothed = 1 << 7
  598. };
  599. enum UBXSVINFOQualityId
  600. {
  601. UBXSVINFOQualityChannelIdle = 0,
  602. UBXSVINFOQualityChannelSearching = 1,
  603. UBXSVINFOQualitySignalAquired = 2,
  604. UBXSVINFOQualitySignalDetected = 3,
  605. UBXSVINFOQualityCodeLockOnSignal = 4,
  606. UBXSVINFOQualityCodeCarrierLocked = 5
  607. };
  608. enum UBXTIMEGPSValidityFlags
  609. {
  610. UBXTIMEGPSTowValid = 1,
  611. UBXTIMEGPSWeekValid = 1 << 1,
  612. UBXTIMEGPSLeapSValid = 1 << 2
  613. };
  614. enum UBXTIMEUTCValidityFlags
  615. {
  616. UBXTIMEUTCValidTOW = 1,
  617. UBXTIMEUTCValidWKN = 1 << 1,
  618. UBXTIMEUTCValidUTC = 1 << 2
  619. };
  620. enum UBXPMREQFlags
  621. {
  622. UBXPMREQBackup = 1 << 1
  623. };
  624. enum UBXTM2FlagsMode
  625. {
  626. UBXTM2FlagsModeSingle = 0,
  627. UBXTM2FlagsModeRunning = 1
  628. };
  629. enum UBXTM2FlagsRun
  630. {
  631. UBXTM2FlagsRunArmed = 0,
  632. UBXTM2FlagsRunStopped = 1
  633. };
  634. enum UBXTM2FlagsTimeBase
  635. {
  636. UBXTM2FlagsTimeBaseReceiverTime = 0,
  637. UBXTM2FlagsTimeBaseGPS = 1,
  638. UBXTM2FlagsTimeBaseUTC = 2
  639. };
  640. enum UBXTM2FlagsUTC
  641. {
  642. UBXTM2FlagsUTCNotAvailable = 0,
  643. UBXTM2FlagsUTCAvailable = 1
  644. };
  645. enum UBXTM2FlagsTime
  646. {
  647. UBXTM2FlagsTimeInvalid = 0,
  648. UBXTM2FlagsTimeValid = 1
  649. };
  650. enum UBXTPFlags
  651. {
  652. UBXTPTimeBaseUTC = 1,
  653. UBXTPUTCAvailable = 1 << 1
  654. };
  655. enum UBXVRFYFlagsSource
  656. {
  657. UBXVRFYNoTimeAidingDone = 0,
  658. UBXVRFYSourceRTC = 2,
  659. UBXVRFYSourceAID_INI = 3
  660. };
  661. #pragma pack(push,1)
  662. struct UBXHdr {
  663. UBXU1_t msgClass;
  664. UBXU1_t msgId;
  665. UBXU2_t length;
  666. };
  667. struct UBXAID_ALPSRV {
  668. UBXU1_t idSize;
  669. UBXU1_t type;
  670. UBXU2_t offset;
  671. UBXU2_t size;
  672. UBXU2_t fileId;
  673. UBXU2_t dataSize;
  674. UBXU1_t id1;
  675. UBXU1_t id2;
  676. UBXU4_t id3;
  677. };
  678. struct UBXACK_ACK {
  679. UBXU1_t msgClass;
  680. UBXU1_t msgId;
  681. };
  682. struct UBXACK_NACK {
  683. UBXU1_t msgClass;
  684. UBXU1_t msgId;
  685. };
  686. struct UBXAID_ALM_POLL {
  687. //No payload
  688. };
  689. struct UBXAID_ALM_POLL_OPT {
  690. UBXU1_t svid;
  691. };
  692. struct UBXAID_ALM {
  693. UBXU4_t svid;
  694. UBXU4_t week;
  695. };
  696. struct UBXAID_ALM_OPT {
  697. UBXU4_t svid;
  698. UBXU4_t week;
  699. UBXU4_t dwrd[8];
  700. };
  701. struct UBXAID_ALP {
  702. //Variable payload
  703. };
  704. struct UBXAID_ALP_END {
  705. UBXU1_t dummy;
  706. };
  707. struct UBXAID_ALP_POLL {
  708. UBXU4_t predTow;
  709. UBXU4_t predDur;
  710. UBXI4_t age;
  711. UBXU2_t predWno;
  712. UBXU2_t almWno;
  713. UBXU4_t reserved1;
  714. UBXU1_t svs;
  715. UBXU1_t reserved2;
  716. UBXU2_t reserved3;
  717. };
  718. struct UBXAID_AOP_POLL {
  719. //No payload
  720. };
  721. struct UBXAID_AOP_POLL_OPT {
  722. UBXU1_t svid;
  723. };
  724. struct UBXAID_AOP {
  725. UBXU1_t svid;
  726. UBXU1_t data[59];
  727. };
  728. struct UBXAID_AOP_OPT {
  729. UBXU1_t svid;
  730. UBXU1_t data[59];
  731. UBXU1_t optional0[48];
  732. UBXU1_t optional1[48];
  733. UBXU1_t optional2[48];
  734. };
  735. struct UBXAID_DATA_POLL {
  736. //No payload
  737. };
  738. struct UBXAID_EPH_POLL {
  739. //No payload
  740. };
  741. struct UBXAID_EPH_POLL_OPT {
  742. UBXU1_t svid;
  743. };
  744. struct UBXAID_EPH {
  745. UBXU4_t svid;
  746. UBXU4_t how;
  747. };
  748. struct UBXAID_EPH_OPT {
  749. UBXU4_t svid;
  750. UBXU4_t how;
  751. UBXU4_t sf1d[8];
  752. UBXU4_t sf2d[8];
  753. UBXU4_t sf3d[8];
  754. };
  755. struct UBXAID_HUI_POLL {
  756. //No payload
  757. };
  758. struct UBXAID_HUI {
  759. UBXI4_t health;
  760. UBXR4_t utcA0;
  761. UBXR4_t utcA1;
  762. UBXI4_t utcTOW;
  763. UBXI2_t utcWNT;
  764. UBXI2_t utcLS;
  765. UBXI2_t utcWNF;
  766. UBXI2_t utcDN;
  767. UBXI2_t utcLSF;
  768. UBXI2_t utcSpare;
  769. UBXR4_t klobA0;
  770. UBXR4_t klobA1;
  771. UBXR4_t klobA2;
  772. UBXR4_t klobA3;
  773. UBXR4_t klobB0;
  774. UBXR4_t klobB1;
  775. UBXR4_t klobB2;
  776. UBXR4_t klobB3;
  777. UBXX2_t flags;
  778. };
  779. struct UBXAID_INI_POLL {
  780. //No payload
  781. };
  782. struct UBXAID_INI {
  783. UBXI1_t ecefXOrLat;
  784. UBXI1_t ecefYOrLat;
  785. UBXI1_t ecefZOrLat;
  786. UBXU1_t posAcc;
  787. UBXI1_t tmCfg;
  788. UBXU2_t wnoOrDate;
  789. UBXU4_t towOrDate;
  790. UBXI4_t towNs;
  791. UBXU4_t tAccMS;
  792. UBXU4_t tAccNS;
  793. UBXI4_t clkDOrFreq;
  794. UBXU4_t clkDAccOrFreqAcc;
  795. UBXX4_t flags;
  796. };
  797. struct UBXAID_REQ {
  798. //No payload
  799. };
  800. struct UBXCFG_ANT_POLL {
  801. //No payload
  802. };
  803. struct UBXANTPins
  804. {
  805. UBXX2_t UBXANTpinSwitch:5;
  806. UBXX2_t UBXANTpinSCD:5;
  807. UBXX2_t UBXANTpinOCD:5;
  808. UBXX2_t UBXANTreconfig:1;
  809. };
  810. struct UBXCFG_ANT {
  811. UBXX2_t flags; //See UBXANTFlags to fill this field
  812. struct UBXANTPins pins;
  813. };
  814. struct UBXCFG_CFG {
  815. UBXX4_t clearMask; //See UBXCFGMask to fill this field
  816. UBXX4_t saveMask; //See UBXCFGMask to fill this field
  817. UBXX4_t loadMask; //See UBXCFGMask to fill this field
  818. };
  819. struct UBXCFG_CFG_OPT {
  820. UBXX4_t clearMask; //See UBXCFGMask to fill this field
  821. UBXX4_t saveMask; //See UBXCFGMask to fill this field
  822. UBXX4_t loadMask; //See UBXCFGMask to fill this field
  823. UBXX1_t deviceMask; //See UBXCFGDeviceMask to fill this field
  824. };
  825. struct UBXCFG_DAT_POLL {
  826. //No payload
  827. };
  828. struct UBXCFG_DAT_IN {
  829. UBXR8_t majA;
  830. UBXR8_t flat;
  831. UBXR4_t dX;
  832. UBXR4_t dY;
  833. UBXR4_t dZ;
  834. UBXR4_t rotX;
  835. UBXR4_t rotY;
  836. UBXR4_t rotZ;
  837. UBXR4_t scale;
  838. };
  839. struct UBXCFG_DAT_OUT {
  840. UBXU2_t datumNum;
  841. UBXCH_t datumName[6];
  842. UBXR8_t majA;
  843. UBXR8_t flat;
  844. UBXR4_t dX;
  845. UBXR4_t dY;
  846. UBXR4_t dZ;
  847. UBXR4_t rotX;
  848. UBXR4_t rotY;
  849. UBXR4_t rotZ;
  850. UBXR4_t scale;
  851. };
  852. struct UBXCFG_GNSS_POLL {
  853. //No payload
  854. };
  855. struct UBXCFG_GNSS {
  856. UBXU1_t msgVer;
  857. UBXU1_t numTrkChHw;
  858. UBXU1_t numTrkChUse;
  859. UBXU1_t numConfigBlocks;
  860. //Variable addition here
  861. //See structure below
  862. };
  863. struct UBXCFG_GNSS_PART
  864. {
  865. UBXU1_t gnssId; //See UBXGNSSIds to fill this field
  866. UBXU1_t resTrkCh;
  867. UBXU1_t maxTrkCh;
  868. UBXU1_t reserved1;
  869. UBXX4_t flags; //0 - disabled, 1 - enabled
  870. };
  871. struct UBXCFG_INF_POLL {
  872. UBXU1_t protocolId;
  873. };
  874. struct UBXCFG_INF {
  875. //Variable payload
  876. //See structure UBXCFG_INF_PART below
  877. };
  878. struct UBXCFG_INF_PART {
  879. UBXU1_t protocolId;
  880. UBXU1_t reserved0;
  881. UBXU2_t reserved1;
  882. UBXX1_t infMsgMask[6]; //See UBXCFGInfMsgMask to fill this field
  883. };
  884. struct UBXCFG_ITFM_POLL {
  885. //No payload
  886. };
  887. struct UBXITFMConfig
  888. {
  889. UBXX4_t bbThreshold:4;
  890. UBXX4_t cwThreshold:5;
  891. UBXX4_t reserved1:22; //Should be 0x16B156
  892. UBXX4_t enbled:1;
  893. };
  894. struct UBXITFMConfig2
  895. {
  896. UBXX4_t reserved2:12; //Should be 0x31E
  897. UBXX4_t antSetting:2; //See UBXITFMAntSetting to fill this field
  898. UBXX4_t reserved3:18; //Should be 0x00
  899. };
  900. struct UBXCFG_ITFM {
  901. struct UBXITFMConfig config;
  902. struct UBXITFMConfig2 config2;
  903. };
  904. struct UBXCFG_LOGFILTER_POLL {
  905. //No payload data
  906. };
  907. struct UBXCFG_LOGFILTER {
  908. UBXU1_t version;
  909. UBXX1_t flags; //See UBXLOGFILTERFlags to fill this field
  910. UBXU2_t minIterval;
  911. UBXU2_t timeThreshold;
  912. UBXU2_t speedThreshold;
  913. UBXU4_t positionThreshold;
  914. };
  915. struct UBXCFG_MSG_POLL {
  916. UBXU1_t msgClass;
  917. UBXU1_t msgId;
  918. };
  919. struct UBXCFG_MSG_RATES {
  920. UBXU1_t msgClass;
  921. UBXU1_t msgId;
  922. UBXU1_t rate[6];
  923. };
  924. struct UBXCFG_MSG_RATE {
  925. UBXU1_t msgClass;
  926. UBXU1_t msgId;
  927. UBXU1_t rate;
  928. };
  929. struct UBXCFG_NAV5_POLL {
  930. //No payload data
  931. };
  932. struct UBXCFG_NAV5 {
  933. UBXX2_t mask; //See UBXNAV5Mask to fill this field
  934. UBXU1_t dynModel; //See UBXNAV5Model to fill this field
  935. UBXU1_t fixMode; //See UBXNAV5FixMode to fill this field
  936. UBXI4_t fixedAlt;
  937. UBXU4_t fixedAltVar;
  938. UBXI1_t minElev;
  939. UBXU1_t drLimit;
  940. UBXU2_t pDop;
  941. UBXU2_t tDop;
  942. UBXU2_t pAcc;
  943. UBXU2_t tAcc;
  944. UBXU1_t staticHoldThresh;
  945. UBXU1_t dgpsTimeOut;
  946. UBXU1_t cnoThreshNumSVs;
  947. UBXU1_t cnoThresh;
  948. UBXU2_t reserved2; //Set to 0
  949. UBXU4_t reserved3; //Set to 0
  950. UBXU4_t reserved4; //Set to 0
  951. };
  952. struct UBXCFG_NAVX5_POLL {
  953. //No payload
  954. };
  955. struct UBXCFG_NAVX5 {
  956. UBXU2_t version;
  957. UBXX2_t mask1; //See UBXNAVX5Mask to fill this field
  958. UBXU4_t reserved0; //Set 0
  959. UBXU1_t reserved1; //Set 0
  960. UBXU1_t reserved2; //Set 0
  961. UBXU1_t minSVs;
  962. UBXU1_t maxSVs;
  963. UBXU1_t minCNO;
  964. UBXU1_t reserved5; //Set 0
  965. UBXU1_t iniFix3D;
  966. UBXU1_t reserved6; //Set 0
  967. UBXU1_t reserved7; //Set 0
  968. UBXU1_t reserved8; //Set 0
  969. UBXU2_t wknRollover;
  970. UBXU4_t reserved9; //Set 0
  971. UBXU1_t reserved10; //Set 0
  972. UBXU1_t reserved11; //Set 0
  973. UBXU1_t usePPP;
  974. UBXU1_t aopCFG; // 0-disabled, 1 - enabled
  975. UBXU1_t reserved12; //Set 0
  976. UBXU1_t reserved13; //Set 0
  977. UBXU1_t aopOrbMaxErr;
  978. UBXU1_t reserved14; //Set 0
  979. UBXU1_t reserved15; //Set 0
  980. UBXU2_t reserved3; //Set 0
  981. UBXU4_t reserved4; //Set 0
  982. };
  983. struct UBXCFG_NMEA_POLL {
  984. //No payload
  985. };
  986. struct UBXCFG_NMEA {
  987. UBXX1_t filter; //See UBXNMEAFilter to fill this field
  988. UBXU1_t nmeaVersion;
  989. UBXU1_t numSV;
  990. UBXX1_t flags; //See UBXNMEAFlags to fill this field
  991. UBXX4_t gnssToFilter; //See UBXNMEAGNSSToFilter to fill this field
  992. UBXU1_t svNumbering;
  993. UBXU1_t mainTalkerId;
  994. UBXU1_t gsvTalkerId;
  995. UBXU1_t reserved;
  996. };
  997. struct UBXCFG_NVS {
  998. UBXX4_t clearMask; //See UBXCFGMask CFG_NVS section to fill this field
  999. UBXX4_t saveMask; //See UBXCFGMask CFG_NVS section to fill this field
  1000. UBXX4_t loadMask; //See UBXCFGMask CFG_NVS section to fill this field
  1001. UBXX1_t deviceMask; //See UBXCFGDeviceMask to fill this field
  1002. };
  1003. struct UBXCFG_PM2_POLL {
  1004. //No payload
  1005. };
  1006. struct UBXCFG_PM2Flags
  1007. {
  1008. UBXX4_t blank1:1;
  1009. UBXX4_t reserved:3;
  1010. UBXX4_t extIntSelect:1;
  1011. UBXX4_t extIntWake:1;
  1012. UBXX4_t extIntBackup:1;
  1013. UBXX4_t blank2:1;
  1014. UBXX4_t limitPeakCurr:2; //See UBXPM2LimitPeakCurrent to fill this field
  1015. UBXX4_t waitTimeFix:1;
  1016. UBXX4_t updateRTC:1;
  1017. UBXX4_t updateEPH:1;
  1018. UBXX4_t blank3:3;
  1019. UBXX4_t doNotEnterOff:1;
  1020. UBXX4_t mode:2; //See UBXPM2Mode to fill this field
  1021. };
  1022. struct UBXCFG_PM2 {
  1023. UBXU1_t version;
  1024. UBXU1_t reserved1;
  1025. UBXU1_t reserved2;
  1026. UBXU1_t reserved3;
  1027. struct UBXCFG_PM2Flags flags;
  1028. UBXU4_t updatePeriod;
  1029. UBXU4_t searchPeriod;
  1030. UBXU4_t gridOffset;
  1031. UBXU2_t onTime;
  1032. UBXU2_t minAcqTime;
  1033. UBXU2_t reserved4;
  1034. UBXU2_t reserved5;
  1035. UBXU4_t reserved6;
  1036. UBXU4_t reserved7;
  1037. UBXU1_t reserved8;
  1038. UBXU1_t reserved9;
  1039. UBXU2_t reserved10;
  1040. UBXU4_t reserved11;
  1041. };
  1042. struct UBXCFG_PRT_POLL {
  1043. //No payload
  1044. };
  1045. struct UBXCFG_PRT_POLL_OPT {
  1046. UBXU1_t portId;
  1047. };
  1048. struct UBXCFG_PRTTxReady
  1049. {
  1050. UBXX2_t en:1; //0 - disabled, 1 - enabled
  1051. UBXX2_t pol:1; //0 - High-active, 1 - Low-active
  1052. UBXX2_t pin:5;
  1053. UBXX2_t thres:9; //Given value is multiplied by 8 bytes
  1054. };
  1055. struct UBXCFG_PRTUARTMode
  1056. {
  1057. UBXX4_t blank0:4;
  1058. UBXX4_t reserved1:1;
  1059. UBXX4_t blank1:1;
  1060. UBXX4_t charLen:2; //See UBXPRTModeCharLen to fill this field
  1061. UBXX4_t blank2:1;
  1062. UBXX4_t parity:3; //See UBXPRTModeParity to fill this field
  1063. UBXX4_t nStopBits:2; //See UBXPRTModeStopBits to fill this field
  1064. UBXX4_t blank3:18;
  1065. };
  1066. struct UBXCFG_PRTSPIMode
  1067. {
  1068. UBXX4_t blank0:1;
  1069. UBXX4_t spiMode:2; //See UBXPRTSPIMode to fill this field
  1070. UBXX4_t blank1:3;
  1071. UBXX4_t flowControl:1; //0 - disabled, 1 - enabled
  1072. UBXX4_t blank2:1;
  1073. UBXX4_t ffCnt:8;
  1074. UBXX4_t blank3:16;
  1075. };
  1076. struct UBXCFG_PRTDDCMode
  1077. {
  1078. UBXX4_t blank0:1;
  1079. UBXX4_t slaveAddr:7; //Range: 0x07 < slaveAddr < 0x78. Bit 0 shall be 0
  1080. UBXX4_t blank1:24;
  1081. };
  1082. union UBXCFG_PRTMode
  1083. {
  1084. struct UBXCFG_PRTUARTMode UART;
  1085. struct UBXCFG_PRTSPIMode SPI;
  1086. struct UBXCFG_PRTDDCMode DDC;
  1087. UBXX4_t USB; //reserved
  1088. };
  1089. union UBXCFG_PRT5Option
  1090. {
  1091. UBXU4_t UARTbaudRate;
  1092. UBXU4_t OtherReserved;
  1093. };
  1094. struct UBXCFG_PRT
  1095. {
  1096. UBXU1_t portID;
  1097. UBXU1_t reserved0;
  1098. struct UBXCFG_PRTTxReady txReady;
  1099. union UBXCFG_PRTMode mode;
  1100. union UBXCFG_PRT5Option option;
  1101. UBXX2_t inProtoMask; //See UBXPRTInProtoMask to fill this field
  1102. UBXX2_t outProtoMask; //See UBXPRTOutProtoMask to fill this field
  1103. UBXX2_t flags; //See UBXPRTFlags to fill this field, shall be 0 for USB
  1104. UBXU1_t reserved5;
  1105. };
  1106. struct UBXCFG_RATE_POLL {
  1107. //No payload
  1108. };
  1109. struct UBXCFG_RATE {
  1110. UBXU2_t measRate;
  1111. UBXU2_t navRate;
  1112. UBXU2_t timeRef;
  1113. };
  1114. struct UBXCFG_RINV_POLL {
  1115. //No payload
  1116. };
  1117. struct UBXCFG_RINV {
  1118. UBXX1_t flags; //See UBXRINVFlags to fill this field
  1119. //Variable payload size
  1120. };
  1121. struct UBXCFG_RST {
  1122. UBXX2_t navBBRMask;
  1123. UBXU1_t resetMode;
  1124. UBXU1_t reserved1;
  1125. };
  1126. struct UBXCFG_RXM_POLL {
  1127. //No payload
  1128. };
  1129. struct UBXCFG_RXM {
  1130. UBXU1_t reserved1; //Shall be set to 8
  1131. UBXU1_t lpMode; //See UBXRXMLowPowerModes to fill this field
  1132. };
  1133. struct UBXCFG_SBAS_POLL {
  1134. //No payload
  1135. };
  1136. struct UBXCFG_SBAS {
  1137. UBXX1_t mode; //See UBXSBASModes to fill this field
  1138. UBXX1_t usage; //See UBXSBASUsage to fill this field
  1139. UBXU1_t maxSBAS;
  1140. UBXX1_t scanmode2; //See UBXSBASScanModes2 to fill this field
  1141. UBXX4_t scanmode1; //See UBXSBASScanModes1 to fill this field
  1142. };
  1143. struct UBXCFG_TP5_POLL {
  1144. //No payload
  1145. };
  1146. struct UBXCFG_TP5_POLL_OPT {
  1147. UBXU1_t tpIdx;
  1148. };
  1149. struct UBXCFG_TP5 {
  1150. UBXU1_t tpIdx;
  1151. UBXU1_t reserved0;
  1152. UBXU2_t reserved1;
  1153. UBXI2_t antCableDelay;
  1154. UBXI2_t rfGroupDelay;
  1155. UBXU4_t freqPeriod;
  1156. UBXU4_t freqPeriodLock;
  1157. UBXU4_t pulseLenRatio;
  1158. UBXU4_t pulseLenRatioLock;
  1159. UBXI4_t userConfigDelay;
  1160. UBXX4_t flags; //See UBXCFGTimepulseFlags to fill this field
  1161. };
  1162. struct UBXCFG_USB_POLL {
  1163. //No payload
  1164. };
  1165. struct UBXCFG_USB {
  1166. UBXU2_t vendorId;
  1167. UBXU2_t productId;
  1168. UBXU2_t reserved1;//Set to 0
  1169. UBXU2_t reserved2;//Set to 1
  1170. UBXU2_t powerConsumption;
  1171. UBXX2_t flags;
  1172. UBXCH_t vendorString[32];
  1173. UBXCH_t productString[32];
  1174. UBXCH_t serialNumber[32];
  1175. };
  1176. struct UBXINF_DEBUG {
  1177. //Variable payload of UBXCH_t
  1178. };
  1179. struct UBXINF_ERROR {
  1180. //Variable payload of UBXCH_t
  1181. };
  1182. struct UBXINF_NOTICE {
  1183. //Variable payload of UBXCH_t
  1184. };
  1185. struct UBXINF_TEST {
  1186. //Variable payload of UBXCH_t
  1187. };
  1188. struct UBXINF_WARNING {
  1189. //Variable payload of UBXCH_t
  1190. };
  1191. struct UBXLOG_CREATE {
  1192. UBXU1_t version;
  1193. UBXX1_t logCfg; //See UBXLOGCfg
  1194. UBXU1_t reserved; //Set to 0
  1195. UBXU1_t logSize;
  1196. UBXU4_t userDefinedSize;
  1197. };
  1198. struct UBXLOG_ERASE {
  1199. //No payload
  1200. };
  1201. struct UBXLOG_FINDTIME_IN {
  1202. UBXU1_t version; //Shall be 0
  1203. UBXU1_t type; //Shall be 0
  1204. UBXU2_t reserved1;
  1205. UBXU2_t year;
  1206. UBXU1_t month;
  1207. UBXU1_t day;
  1208. UBXU1_t hour;
  1209. UBXU1_t minute;
  1210. UBXU1_t second;
  1211. UBXU1_t reserved2;
  1212. };
  1213. struct UBXLOG_FINDTIME_OUT {
  1214. UBXU1_t version; //Shall be 1
  1215. UBXU1_t type; //Shall be 1
  1216. UBXU2_t reserved1;
  1217. UBXU4_t entryNumber;
  1218. };
  1219. struct UBXLOG_INFO_POLL {
  1220. //No payload
  1221. };
  1222. struct UBXLOG_INFO
  1223. {
  1224. UBXU1_t version;
  1225. UBXU1_t reserved1[3];
  1226. UBXU4_t filestoreCapacity;
  1227. UBXU4_t reserved2;
  1228. UBXU4_t reserved3;
  1229. UBXU4_t currentMaxLogSize;
  1230. UBXU4_t currentLogSize;
  1231. UBXU4_t entryCount;
  1232. UBXU2_t oldestYear;
  1233. UBXU1_t oldestMonth;
  1234. UBXU1_t oldestDay;
  1235. UBXU1_t oldestHour;
  1236. UBXU1_t oldestMinute;
  1237. UBXU1_t oldestSecond;
  1238. UBXU1_t reserved4;
  1239. UBXU2_t newestYear;
  1240. UBXU1_t newestMonth;
  1241. UBXU1_t newestDay;
  1242. UBXU1_t newestHour;
  1243. UBXU1_t newestMinute;
  1244. UBXU1_t newestSecond;
  1245. UBXU1_t reserved5;
  1246. UBXX1_t status; //See UBXLOGStatus to fill this field
  1247. UBXU1_t reserved6[3];
  1248. };
  1249. struct UBXLOG_RETRIEVEPOS {
  1250. UBXU4_t entryIndex;
  1251. UBXI4_t lon;
  1252. UBXI4_t lat;
  1253. UBXI4_t hMSL;
  1254. UBXU4_t hAcc;
  1255. UBXU4_t gSpeed;
  1256. UBXU4_t heading;
  1257. UBXU1_t version; //Shall be 0
  1258. UBXU1_t fixType; //See UBXRETRIEVEPOSFixType to fill this field
  1259. UBXU2_t year;
  1260. UBXU1_t month;
  1261. UBXU1_t day;
  1262. UBXU1_t hour;
  1263. UBXU1_t minute;
  1264. UBXU1_t second;
  1265. UBXU1_t reserved1;
  1266. UBXU1_t numSV;
  1267. UBXU1_t reserved2;
  1268. };
  1269. struct UBXLOG_RETRIEVESTRING {
  1270. UBXU4_t entryIndex;
  1271. UBXU1_t version; //Shall be 0
  1272. UBXU1_t reserved1;
  1273. UBXU2_t year;
  1274. UBXU1_t month;
  1275. UBXU1_t day;
  1276. UBXU1_t hour;
  1277. UBXU1_t minute;
  1278. UBXU1_t second;
  1279. UBXU1_t reserved2;
  1280. UBXU2_t byteCount;
  1281. //Variable payload according byteCount
  1282. };
  1283. struct UBXLOG_RETRIEVE {
  1284. UBXU4_t startNumber;
  1285. UBXU4_t entryCount;
  1286. UBXU1_t version;
  1287. UBXU1_t reserved[3];
  1288. };
  1289. struct UBXLOG_STRING {
  1290. //Variable payload UBXU1_t
  1291. };
  1292. struct UBXMON_HW2 {
  1293. UBXI1_t ofsI;
  1294. UBXU1_t magI;
  1295. UBXI1_t ofsQ;
  1296. UBXU1_t magQ;
  1297. UBXU1_t cfgSource;
  1298. UBXU1_t reserved0[3];
  1299. UBXU4_t lowLevCfg;
  1300. UBXU4_t reserved1[2];
  1301. UBXU4_t postStatus;
  1302. UBXU4_t reserved2;
  1303. };
  1304. struct UBXHWFlags
  1305. {
  1306. UBXX1_t UBXHWFlagsRTCCalib:1;
  1307. UBXX1_t UBXHWFlagsSafeBoot:1;
  1308. UBXX1_t UBXHWFlagsJammingState:2;
  1309. };
  1310. struct UBXMON_HW {
  1311. UBXX4_t pinSel;
  1312. UBXX4_t pinBank;
  1313. UBXX4_t pinDir;
  1314. UBXX4_t pinVal;
  1315. UBXU2_t noisePerMS;
  1316. UBXU2_t agcCnt;
  1317. UBXU1_t aStatus;
  1318. UBXU1_t aPower;
  1319. struct UBXHWFlags flags;
  1320. UBXU1_t reserved1;
  1321. UBXX4_t usedMask;
  1322. UBXU1_t VP[17];
  1323. UBXU1_t jamInd;
  1324. UBXU2_t reserved3;
  1325. UBXX4_t pinIrq;
  1326. UBXX4_t pullH;
  1327. UBXX4_t pullL;
  1328. };
  1329. struct UBXMON_IO_PART
  1330. {
  1331. UBXU4_t rxBytes;
  1332. UBXU4_t txBytes;
  1333. UBXU2_t parityErrs;
  1334. UBXU2_t framingErrs;
  1335. UBXU2_t overrunErrs;
  1336. UBXU2_t breakCond;
  1337. UBXU1_t rxBusy;
  1338. UBXU1_t txBusy;
  1339. UBXU2_t reserved1;
  1340. };
  1341. struct UBXMON_IO {
  1342. struct UBXMON_IO_PART ioPortInfo[UBX_IO_PORTS_NUM];
  1343. };
  1344. struct UBXMON_MSGPP {
  1345. UBXU2_t msg1[8];
  1346. UBXU2_t msg2[8];
  1347. UBXU2_t msg3[8];
  1348. UBXU2_t msg4[8];
  1349. UBXU2_t msg5[8];
  1350. UBXU2_t msg6[8];
  1351. UBXU4_t skipped[6];
  1352. };
  1353. struct UBXMON_RXBUF {
  1354. UBXU2_t pending[6];
  1355. UBXU1_t usage[6];
  1356. UBXU1_t peakUsage[6];
  1357. };
  1358. struct UBXMON_RXR {
  1359. UBXX1_t flags; //See UBXRXRFlags to fill this field
  1360. };
  1361. struct UBXMON_TXBUF {
  1362. UBXU2_t pending[6];
  1363. UBXU1_t usage[6];
  1364. UBXU1_t peakUsage[6];
  1365. UBXU1_t tUsage;
  1366. UBXU1_t tPeakusage;
  1367. UBXX1_t errors;
  1368. UBXU1_t reserved1;
  1369. };
  1370. struct UBXMON_VER_POLL {
  1371. //No payload
  1372. };
  1373. struct UBXMON_VER {
  1374. UBXCH_t swVersion[30];
  1375. UBXCH_t hwVersion[10];
  1376. //Variable payload of UBXMON_VER_PART type
  1377. };
  1378. struct UBXMON_VER_PART
  1379. {
  1380. UBXCH_t extension[30];
  1381. };
  1382. struct UBXNAV_AOPSTATUS {
  1383. UBXU4_t iTOW;
  1384. UBXU1_t aopCfg; //See UBXAOPCfg to fill this field
  1385. UBXU1_t status; //See UBXAOPStatus to fill this field
  1386. UBXU1_t reserved0;
  1387. UBXU1_t reserved1;
  1388. UBXU4_t availGPS;
  1389. UBXU4_t reserved2;
  1390. UBXU4_t reserved3;
  1391. };
  1392. struct UBXNAV_CLOCK {
  1393. UBXU4_t iTOW;
  1394. UBXI4_t clkB;
  1395. UBXI4_t clkD;
  1396. UBXU4_t tAcc;
  1397. UBXU4_t fAcc;
  1398. };
  1399. struct UBXNAV_DGPS {
  1400. UBXU4_t iTOW;
  1401. UBXI4_t age;
  1402. UBXI2_t baseId;
  1403. UBXI2_t baseHealth;
  1404. UBXU1_t numCh;
  1405. UBXU1_t status;
  1406. UBXU2_t reserved1;
  1407. };
  1408. struct UBXDGPSFlags
  1409. {
  1410. UBXX1_t channel:4;
  1411. UBXX1_t dgpsUsed:1;
  1412. };
  1413. struct UBXNAV_DGPS_PART {
  1414. UBXU1_t svid;
  1415. struct UBXDGPSFlags flags;
  1416. UBXU2_t ageC;
  1417. UBXR4_t prc;
  1418. UBXR4_t prrc;
  1419. };
  1420. struct UBXNAV_DOP {
  1421. UBXU4_t iTOW;
  1422. UBXU2_t gDOP;
  1423. UBXU2_t pDOP;
  1424. UBXU2_t tDOP;
  1425. UBXU2_t vDOP;
  1426. UBXU2_t hDOP;
  1427. UBXU2_t nDOP;
  1428. UBXU2_t eDOP;
  1429. };
  1430. struct UBXNAV_POSECEF {
  1431. UBXU4_t iTOW;
  1432. UBXI4_t ecefX;
  1433. UBXI4_t ecefY;
  1434. UBXI4_t ecefZ;
  1435. UBXU4_t pAcc;
  1436. };
  1437. struct UBXNAV_POSLLH {
  1438. UBXU4_t iTOW;
  1439. UBXI4_t lon;
  1440. UBXI4_t lat;
  1441. UBXI4_t height;
  1442. UBXI4_t hMSL;
  1443. UBXU4_t hAcc;
  1444. UBXU4_t vAcc;
  1445. };
  1446. struct UBXPVTFlags
  1447. {
  1448. UBXX1_t gnssFixOk:1;
  1449. UBXX1_t diffSoln:1;
  1450. UBXX1_t psmState:3; //See UBXPVTPSMStates to fill this field
  1451. };
  1452. struct UBXNAV_PVT {
  1453. UBXU4_t iTOW;
  1454. UBXU2_t year;
  1455. UBXU1_t month;
  1456. UBXU1_t day;
  1457. UBXU1_t hour;
  1458. UBXU1_t min;
  1459. UBXU1_t sec;
  1460. UBXX1_t valid; //See UBXPVTValid to fill this field
  1461. UBXU4_t tAcc;
  1462. UBXI4_t nano;
  1463. UBXU1_t fixType; //See UBXGPSFix to fill this field
  1464. struct UBXPVTFlags flags;
  1465. UBXU1_t reserved1;
  1466. UBXU1_t numSV;
  1467. UBXI4_t lon;
  1468. UBXI4_t lat;
  1469. UBXI4_t height;
  1470. UBXI4_t hMSL;
  1471. UBXU4_t hAcc;
  1472. UBXU4_t vAcc;
  1473. UBXI4_t velN;
  1474. UBXI4_t velE;
  1475. UBXI4_t velD;
  1476. UBXI4_t gSpeed;
  1477. UBXI4_t heading;
  1478. UBXU4_t sAcc;
  1479. UBXU4_t headingAcc;
  1480. UBXU2_t pDOP;
  1481. UBXX2_t reserved2;
  1482. UBXU4_t reserved3;
  1483. };
  1484. struct UBXNAV_SBAS {
  1485. UBXU4_t iTOW;
  1486. UBXU1_t geo;
  1487. UBXU1_t mode;
  1488. UBXI1_t sys;
  1489. UBXX1_t service; //See UBXSBASService to fill this field
  1490. UBXU1_t cnt;
  1491. UBXU1_t reserved0[3];
  1492. //Variable payload of UBXNAV_SBAS_PART type
  1493. };
  1494. struct UBXNAV_SBAS_PART {
  1495. UBXU1_t svid;
  1496. UBXU1_t flags;
  1497. UBXU1_t udre;
  1498. UBXU1_t svSys;
  1499. UBXU1_t svService;
  1500. UBXU1_t reserved1;
  1501. UBXI2_t prc;
  1502. UBXU2_t reserved2;
  1503. UBXI2_t ic;
  1504. };
  1505. struct UBXNAV_SOL {
  1506. UBXU4_t iTOW;
  1507. UBXI4_t fTOW;
  1508. UBXI2_t week;
  1509. UBXU1_t gpsFix; //See UBXGPSFix to fill this field
  1510. UBXX1_t flags; //See UBXSBASSOLFlags to fill this field
  1511. UBXI4_t ecefX;
  1512. UBXI4_t ecefY;
  1513. UBXI4_t ecefZ;
  1514. UBXU4_t pAcc;
  1515. UBXI4_t ecefVX;
  1516. UBXI4_t ecefVY;
  1517. UBXI4_t ecefVZ;
  1518. UBXU4_t sAcc;
  1519. UBXU2_t pDOP;
  1520. UBXU1_t reserved1;
  1521. UBXU1_t numSV;
  1522. UBXU4_t reserved2;
  1523. };
  1524. struct UBXNAV_STATUS {
  1525. UBXU4_t iTOW;
  1526. UBXU1_t gpsFix;
  1527. UBXX1_t flags; //See UBXGPSFix to fill this field
  1528. UBXX1_t fixStat; //See UBXSBASSOLFlags to fill this field
  1529. UBXX1_t flags2;
  1530. UBXU4_t ttff;
  1531. UBXU4_t msss;
  1532. };
  1533. struct UBXSVINFOGlobalFlags
  1534. {
  1535. UBXX1_t chipGen:3; //See UBXSVINFOChipGen to fill this field
  1536. };
  1537. struct UBXNAV_SVINFO {
  1538. UBXU4_t iTOW;
  1539. UBXU1_t numCh;
  1540. struct UBXSVINFOGlobalFlags globalFlags;
  1541. UBXU2_t reserved2;
  1542. //Variable payload of UBXNAV_SVINFO_PART type
  1543. };
  1544. struct UBXSVINFOQuality
  1545. {
  1546. UBXX1_t qualityInd:4; //See UBXSVINFOQualityId to fill this field
  1547. };
  1548. struct UBXNAV_SVINFO_PART {
  1549. UBXU1_t chn;
  1550. UBXU1_t svid;
  1551. UBXX1_t flags; //See UBXSVINFOFlags to fill this field
  1552. UBXX1_t quality;
  1553. UBXU1_t cno;
  1554. UBXI1_t elev;
  1555. UBXI2_t azim;
  1556. UBXI4_t prRes;
  1557. };
  1558. struct UBXNAV_TIMEGPS {
  1559. UBXU4_t iTOW;
  1560. UBXI4_t fTOW;
  1561. UBXI2_t week;
  1562. UBXI1_t leapS;
  1563. UBXX1_t valid; //See UBXTIMEGPSValidityFlags to fill this field
  1564. UBXU4_t tAcc;
  1565. };
  1566. struct UBXNAV_TIMEUTC {
  1567. UBXU4_t iTOW;
  1568. UBXU4_t tAcc;
  1569. UBXI4_t nano;
  1570. UBXU2_t year;
  1571. UBXU1_t month;
  1572. UBXU1_t day;
  1573. UBXU1_t hour;
  1574. UBXU1_t min;
  1575. UBXU1_t sec;
  1576. UBXX1_t valid; //See UBXTIMEUTCValidityFlags to fill this field
  1577. };
  1578. struct UBXNAV_VELECEF {
  1579. UBXU4_t iTOW;
  1580. UBXI4_t ecefVX;
  1581. UBXI4_t ecefVY;
  1582. UBXI4_t ecefVZ;
  1583. UBXU4_t sAcc;
  1584. };
  1585. struct UBXNAV_VELNED {
  1586. UBXU4_t iTOW;
  1587. UBXI4_t velN;
  1588. UBXI4_t velE;
  1589. UBXI4_t velD;
  1590. UBXU4_t speed;
  1591. UBXU4_t gSpeed;
  1592. UBXI4_t heading;
  1593. UBXU4_t sAcc;
  1594. UBXU4_t cAcc;
  1595. };
  1596. struct UBXRXM_ALM_POLL {
  1597. //No payload
  1598. };
  1599. struct UBXRXM_ALM_POLL_OPT {
  1600. UBXU1_t svid;
  1601. };
  1602. struct UBXRXM_ALM {
  1603. /* ###################################################
  1604. * This RMX messages marked as obsolete API use AID instead
  1605. */
  1606. UBXU4_t svid;
  1607. UBXU4_t week;
  1608. };
  1609. struct UBXRXM_ALM_OPT {
  1610. /* ###################################################
  1611. * This RMX messages marked as obsolete API use AID instead
  1612. */
  1613. UBXU4_t svid;
  1614. UBXU4_t week;
  1615. UBXU4_t dwrd[8];
  1616. };
  1617. struct UBXRXM_EPH_POLL {
  1618. //No payload
  1619. };
  1620. struct UBXRXM_EPH_POLL_OPT {
  1621. UBXU1_t svid;
  1622. };
  1623. struct UBXRXM_EPH {
  1624. /* ###################################################
  1625. * This RMX messages marked as obsolete API use AID instead
  1626. */
  1627. UBXU4_t svid;
  1628. UBXU4_t how;
  1629. };
  1630. struct UBXRXM_EPH_OPT {
  1631. /* ###################################################
  1632. * This RMX messages marked as obsolete API use AID instead
  1633. */
  1634. UBXU4_t svid;
  1635. UBXU4_t how;
  1636. UBXU4_t sf1d[8];
  1637. UBXU4_t sf2d[8];
  1638. UBXU4_t sf3d[8];
  1639. };
  1640. struct UBXRXM_PMREQ {
  1641. UBXU4_t duration;
  1642. UBXX4_t flags; //See UBXPMREQFlags to fill this field
  1643. };
  1644. struct UBXRXM_RAW {
  1645. UBXI4_t rcvTow;
  1646. UBXI2_t week;
  1647. UBXU1_t numSV;
  1648. UBXU1_t reserved1;
  1649. //Variable payload of UBXRXM_RAW_PART type
  1650. };
  1651. struct UBXRXM_RAW_PART
  1652. {
  1653. UBXR8_t cpMes;
  1654. UBXR8_t prMes;
  1655. UBXR4_t doMes;
  1656. UBXU1_t sv;
  1657. UBXI1_t mesQI;
  1658. UBXI1_t cno;
  1659. UBXU1_t lli;
  1660. };
  1661. struct UBXRXM_SFRB {
  1662. UBXU1_t chn;
  1663. UBXU1_t svid;
  1664. UBXX4_t dwrd[10];
  1665. };
  1666. struct UBXRXM_SVSI {
  1667. UBXU4_t iTOW;
  1668. UBXI2_t week;
  1669. UBXU1_t numVis;
  1670. UBXU1_t numSV;
  1671. //Variable payload of UBXRXM_SVSI_PART type
  1672. };
  1673. struct UBXSVSISVFlags
  1674. {
  1675. UBXX1_t ura:4;
  1676. UBXX1_t healthy:1;
  1677. UBXX1_t ephVal:1;
  1678. UBXX1_t almVal:1;
  1679. UBXX1_t notAvail:1;
  1680. };
  1681. struct UBXSVSIAge
  1682. {
  1683. UBXX1_t almAge:4;
  1684. UBXX1_t ephAge:4;
  1685. };
  1686. struct UBXRXM_SVSI_PART
  1687. {
  1688. UBXU1_t svid;
  1689. struct UBXSVSISVFlags svFlag;
  1690. UBXI2_t azim;
  1691. UBXI1_t elev;
  1692. struct UBXSVSIAge age;
  1693. };
  1694. struct UBXTM2Flags
  1695. {
  1696. UBXX1_t mode:1; //See UBXTM2FlagsMode to fill this field
  1697. UBXX1_t run:1; //See UBXTM2FlagsRun to fill this field
  1698. UBXX1_t newFallingEdge:1;
  1699. UBXX1_t timeBase:2; //See UBXTM2FlagsTimeBase to fill this field
  1700. UBXX1_t utc:1; //See UBXTM2FlagsUTC to fill this field
  1701. UBXX1_t time:1; //See UBXTM2FlagsTime to fill this field
  1702. UBXX1_t newRisingEdge:1;
  1703. };
  1704. struct UBXTIM_TM2 {
  1705. UBXU1_t ch;
  1706. struct UBXTM2Flags flags;
  1707. UBXU2_t count;
  1708. UBXU2_t wnR;
  1709. UBXU2_t wnF;
  1710. UBXU4_t towMsR;
  1711. UBXU4_t towSubMsR;
  1712. UBXU4_t towMsF;
  1713. UBXU4_t towSubMsF;
  1714. UBXU4_t accEst;
  1715. };
  1716. struct UBXTIM_TP {
  1717. UBXU4_t towMS;
  1718. UBXU4_t towSubMS;
  1719. UBXI4_t qErr;
  1720. UBXU2_t week;
  1721. UBXX1_t flags;
  1722. UBXU1_t reserved1;
  1723. };
  1724. struct UBXVRFYFlags
  1725. {
  1726. UBXX1_t src:3; //See UBXVRFYFlagsSource to fill this field
  1727. };
  1728. struct UBXTIM_VRFY {
  1729. UBXI4_t itow;
  1730. UBXI4_t frac;
  1731. UBXI4_t deltaMs;
  1732. UBXI4_t deltaNs;
  1733. UBXU2_t wno;
  1734. struct UBXVRFYFlags flags;
  1735. UBXU1_t reserved1;
  1736. };
  1737. union UBXMsgs
  1738. {
  1739. struct UBXACK_NACK ACK_NACK;
  1740. struct UBXACK_ACK ACK_ACK;
  1741. struct UBXAID_ALM_POLL AID_ALM_POLL;
  1742. struct UBXAID_ALM_POLL_OPT AID_ALM_POLL_OPT;
  1743. struct UBXAID_ALM AID_ALM;
  1744. struct UBXAID_ALM_OPT AID_ALM_OPT;
  1745. struct UBXAID_ALPSRV AID_ALPSRV;
  1746. struct UBXAID_ALP_POLL AID_ALP_POLL;
  1747. struct UBXAID_ALP_END AID_ALP_END;
  1748. struct UBXAID_ALP AID_ALP;
  1749. struct UBXAID_AOP_POLL AID_AOP_POLL;
  1750. struct UBXAID_AOP_POLL_OPT AID_AOP_POLL_OPT;
  1751. struct UBXAID_AOP AID_AOP;
  1752. struct UBXAID_AOP_OPT AID_AOP_OPT;
  1753. struct UBXAID_DATA_POLL AID_DATA_POLL;
  1754. struct UBXAID_EPH_POLL AID_EPH_POLL;
  1755. struct UBXAID_EPH_POLL_OPT AID_EPH_POLL_OPT;
  1756. struct UBXAID_EPH AID_EPH;
  1757. struct UBXAID_EPH_OPT AID_EPH_OPT;
  1758. struct UBXAID_HUI_POLL AID_HUI_POLL;
  1759. struct UBXAID_HUI AID_HUI;
  1760. struct UBXAID_INI_POLL AID_INI_POLL;
  1761. struct UBXAID_INI AID_INI;
  1762. struct UBXAID_REQ AID_REQ;
  1763. struct UBXCFG_ANT CFG_ANT;
  1764. struct UBXCFG_ANT_POLL CFG_ANT_POLL;
  1765. struct UBXCFG_CFG CFG_CFG;
  1766. struct UBXCFG_CFG_OPT CFG_CFG_OPT;
  1767. struct UBXCFG_DAT_IN CFG_DAT_IN;
  1768. struct UBXCFG_DAT_OUT CFG_DAT_OUT;
  1769. struct UBXCFG_DAT_POLL CFG_DAT_POLL;
  1770. struct UBXCFG_GNSS_POLL CFG_GNSS_POLL;
  1771. struct UBXCFG_GNSS CFG_GNSS;
  1772. struct UBXCFG_INF_POLL CFG_INF_POLL;
  1773. struct UBXCFG_INF CFG_INF;
  1774. struct UBXCFG_ITFM_POLL CFG_ITFM_POLL;
  1775. struct UBXCFG_ITFM CFG_ITFM;
  1776. struct UBXCFG_LOGFILTER_POLL CFG_LOGFILTER_POLL;
  1777. struct UBXCFG_LOGFILTER CFG_LOGFILTER;
  1778. struct UBXCFG_MSG_POLL CFG_MSG_POLL;
  1779. struct UBXCFG_MSG_RATE CFG_MSG_RATE;
  1780. struct UBXCFG_MSG_RATES CFG_MSG_RATES;
  1781. struct UBXCFG_NAV5_POLL CFG_NAV5_POLL;
  1782. struct UBXCFG_NAV5 CFG_NAV5;
  1783. struct UBXCFG_NAVX5_POLL CFG_NAVX5_POLL;
  1784. struct UBXCFG_NAVX5 CFG_NAVX5;
  1785. struct UBXCFG_NMEA_POLL CFG_NMEA_POLL;
  1786. struct UBXCFG_NMEA CFG_NMEA;
  1787. struct UBXCFG_NVS CFG_NVS;
  1788. struct UBXCFG_PM2_POLL CFG_PM2_POLL;
  1789. struct UBXCFG_PM2 CFG_PM2;
  1790. struct UBXCFG_PRT_POLL CFG_PRT_POLL;
  1791. struct UBXCFG_PRT_POLL_OPT CFG_PRT_POLL_OPT;
  1792. struct UBXCFG_PRT CFG_PRT;
  1793. struct UBXCFG_RATE_POLL CFG_RATE_POLL;
  1794. struct UBXCFG_RATE CFG_RATE;
  1795. struct UBXCFG_RINV CFG_RINV;
  1796. struct UBXCFG_RINV_POLL CFG_RINV_POLL;
  1797. struct UBXCFG_RST CFG_RST;
  1798. struct UBXCFG_RXM CFG_RXM;
  1799. struct UBXCFG_RXM_POLL CFG_RXM_POLL;
  1800. struct UBXCFG_SBAS_POLL CFG_SBAS_POLL;
  1801. struct UBXCFG_SBAS CFG_SBAS;
  1802. struct UBXCFG_TP5_POLL CFG_TP5_POLL;
  1803. struct UBXCFG_TP5_POLL_OPT CFG_TP5_POLL_OPT;
  1804. struct UBXCFG_TP5 CFG_TP5;
  1805. struct UBXCFG_USB_POLL CFG_USB_POLL;
  1806. struct UBXCFG_USB CFG_USB;
  1807. struct UBXINF_DEBUG INF_DEBUG;
  1808. struct UBXINF_ERROR INF_ERROR;
  1809. struct UBXINF_NOTICE INF_NOTICE;
  1810. struct UBXINF_TEST INF_TEST;
  1811. struct UBXINF_WARNING INF_WARNING;
  1812. struct UBXLOG_CREATE LOG_CREATE;
  1813. struct UBXLOG_ERASE LOG_ERASE;
  1814. struct UBXLOG_FINDTIME_IN LOG_FINDTIME_IN;
  1815. struct UBXLOG_FINDTIME_OUT LOG_FINDTIME_OUT;
  1816. struct UBXLOG_INFO_POLL LOG_INFO_POLL;
  1817. struct UBXLOG_INFO LOG_INFO;
  1818. struct UBXLOG_RETRIEVEPOS LOG_RETRIEVEPOS;
  1819. struct UBXLOG_RETRIEVESTRING LOG_RETRIEVESTRING;
  1820. struct UBXLOG_RETRIEVE LOG_RETRIEVE;
  1821. struct UBXLOG_STRING LOG_STRING;
  1822. struct UBXMON_HW2 MON_HW2;
  1823. struct UBXMON_HW MON_HW;
  1824. struct UBXMON_IO MON_IO;
  1825. struct UBXMON_MSGPP MON_MSGPP;
  1826. struct UBXMON_RXBUF MON_RXBUF;
  1827. struct UBXMON_RXR MON_RXR;
  1828. struct UBXMON_TXBUF MON_TXBUF;
  1829. struct UBXMON_VER_POLL MON_VER_POLL;
  1830. struct UBXMON_VER MON_VER;
  1831. struct UBXNAV_AOPSTATUS NAV_AOPSTATUS;
  1832. struct UBXNAV_CLOCK NAV_CLOCK;
  1833. struct UBXNAV_DGPS NAV_DGPS;
  1834. struct UBXNAV_DOP NAV_DOP;
  1835. struct UBXNAV_POSECEF NAV_POSECEF;
  1836. struct UBXNAV_POSLLH NAV_POSLLH;
  1837. struct UBXNAV_PVT NAV_PVT;
  1838. struct UBXNAV_SBAS NAV_SBAS;
  1839. struct UBXNAV_SOL NAV_SOL;
  1840. struct UBXNAV_STATUS NAV_STATUS;
  1841. struct UBXNAV_SVINFO NAV_SVINFO;
  1842. struct UBXNAV_TIMEGPS NAV_TIMEGPS;
  1843. struct UBXNAV_TIMEUTC NAV_TIMEUTC;
  1844. struct UBXNAV_VELECEF NAV_VELECEF;
  1845. struct UBXNAV_VELNED NAV_VELNED;
  1846. struct UBXRXM_ALM_POLL RXM_ALM_POLL;
  1847. struct UBXRXM_ALM_POLL_OPT RXM_ALM_POLL_OPT;
  1848. struct UBXRXM_ALM_OPT RXM_ALM_OPT;
  1849. struct UBXRXM_EPH_POLL RXM_EPH_POLL;
  1850. struct UBXRXM_EPH_POLL_OPT RXM_EPH_POLL_OPT;
  1851. struct UBXRXM_EPH RXM_EPH;
  1852. struct UBXRXM_EPH_OPT RXM_EPH_OPT;
  1853. struct UBXRXM_PMREQ RXM_PMREQ;
  1854. struct UBXRXM_RAW RXM_RAW;
  1855. struct UBXRXM_SFRB RXM_SFRB;
  1856. struct UBXRXM_SVSI RXM_SVSI;
  1857. struct UBXTIM_TM2 TIM_TM2;
  1858. struct UBXTIM_TP TIM_TP;
  1859. struct UBXTIM_VRFY TIM_VRFY;
  1860. };
  1861. struct UBXAlpFileInfo
  1862. {
  1863. int fileId;
  1864. char* alpData;
  1865. int dataSize;
  1866. };
  1867. struct UBXMsg
  1868. {
  1869. u_int16_t preamble;
  1870. struct UBXHdr hdr;
  1871. union UBXMsgs payload;
  1872. };
  1873. struct UBXMsgBuffer
  1874. {
  1875. int size;
  1876. char* data;
  1877. };
  1878. #pragma pack(pop)
  1879. #endif // UBXMESSAGE_H