gpsd_json.xml 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!--
  3. This file is Copyright 2010 by the GPSD project
  4. SPDX-License-Identifier: BSD-2-clause
  5. -->
  6. <!DOCTYPE refentry PUBLIC
  7. "-//OASIS//DTD DocBook XML V4.1.2//EN"
  8. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
  9. ]>
  10. <refentry id='gpsd_json.5'>
  11. <refentryinfo><date>28 June 2020</date></refentryinfo>
  12. <refmeta>
  13. <refentrytitle>gpsd_json</refentrytitle>
  14. <manvolnum>5</manvolnum>
  15. <refmiscinfo class="source">The GPSD Project</refmiscinfo>
  16. <refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
  17. </refmeta>
  18. <refnamediv id='name'>
  19. <refname>gpsd_json</refname>
  20. <refpurpose>gpsd request/response protocol</refpurpose>
  21. </refnamediv>
  22. <refsect1 id='overview'><title>OVERVIEW</title>
  23. <para><application>gpsd</application> is a service daemon that can be used
  24. to monitor GPSes, DGPS receivers, Marine AIS broadcasts, and various other
  25. location-related and kinematic sensors.</para>
  26. <para>Clients may communicate with <application>gpsd</application> via
  27. textual requests and responses over a socket. It is a bad idea for
  28. applications to speak the protocol directly: rather, they should use
  29. the <application>libgps</application> client library (for C; bindings
  30. also exist for other languages) and take appropriate care to
  31. conditionalize their code on the major and minor protocol version
  32. symbols.</para>
  33. <para>The GPSD protocol is built on top of JSON, JavaScript Object
  34. Notation, as specified in RFC 7159: <citetitle>The JavaScript Object
  35. Notation (JSON) Data Interchange Format</citetitle>. GPSD's use of
  36. JSON is restricted in some ways that make parsing it in fixed-extent
  37. languages (such as C) easier.</para>
  38. <para>A request line is introduced by "?" and may include multiple
  39. commands. Commands begin with a command identifier, followed either
  40. by a terminating ';' or by an equal sign "=" and a JSON object treated
  41. as an argument. Any ';' or newline indication (either LF or CR-LF)
  42. after the end of a command is ignored. All request lines must be
  43. composed of US-ASCII characters and may be no more than 80 characters
  44. in length, exclusive of the trailing newline.</para>
  45. <para>Responses are JSON objects all of which have a "class" attribute
  46. the value of which is either the name of the invoking command. There
  47. are reports (including but not limited to as "TPV", "SKY", "DEVICE",
  48. and "ERROR") which are not direct responses to commands.</para>
  49. <para> The order of JSON attributes within a response object is never
  50. significant, and you may specify command attributes in any
  51. order. Responses never contain the special JSON value null; instead,
  52. attributes with empty or undefined values are omitted. The length
  53. limit for responses and reports is 1536 characters, including a trailing
  54. newline; longer responses will be truncated, so client code must be
  55. prepared for the possibility of invalid JSON fragments.</para>
  56. <para>In JSON reports, if an attribute is present only if the parent
  57. attribute is present or has a particular range, then the parent
  58. attribute is emitted first.</para>
  59. <para>There is one constraint on the order in which attributes will
  60. be omitted. If an optional attribute is present only when a parent
  61. attribute has a specified value or range of values, the parent
  62. attribute will be emitted first to make parsing easier.</para>
  63. <para>The next subsection section documents the core GPSD protocol.
  64. Extensions are documented in the following subsections. The extensions
  65. may not be supported in your <application>gpsd</application> instance
  66. if it has been compiled with a restricted feature set.</para>
  67. </refsect1>
  68. <refsect1 id='core-protocol'><title>CORE SOCKET PROTOCOL</title>
  69. <para>Here are the core-protocol responses:</para>
  70. <variablelist>
  71. <varlistentry>
  72. <term>TPV</term>
  73. <listitem>
  74. <para>A TPV object is a time-position-velocity report. The "class" and "mode"
  75. fields will reliably be present. The "mode" field will be emitted
  76. before optional fields that may be absent when there is no fix. Error
  77. estimates will be emitted after the fix components they're associated with.
  78. Others may be reported or not depending on the fix quality.</para>
  79. <para>All error estimates (epc, epd, epe, eph, ept, epv, epx, epy)
  80. are guessed to be 95% confidence, may also be 50%, one sigma, or two
  81. sigma confidence. Many GNSS receivers do not specify a confidence level.
  82. None specify how the value is calculated. Use error estimates with
  83. caution, and only as relative "goodness" indicators. If the GPS reports
  84. a value to gpsd, then gpsd will report that value. Otherwise gpsd will
  85. try to compute the value from the skyview.</para>
  86. <table frame="all" pgwide="0"><title>TPV object</title>
  87. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  88. <thead>
  89. <row>
  90. <entry>Name</entry>
  91. <entry>Always?</entry>
  92. <entry>Type</entry>
  93. <entry>Description</entry>
  94. </row>
  95. </thead>
  96. <tbody>
  97. <row>
  98. <entry>class</entry>
  99. <entry>Yes</entry>
  100. <entry>string</entry>
  101. <entry>Fixed: "TPV"</entry>
  102. </row>
  103. <row>
  104. <entry>device</entry>
  105. <entry>No</entry>
  106. <entry>string</entry>
  107. <entry>Name of the originating device.</entry>
  108. </row>
  109. <row>
  110. <entry>status</entry>
  111. <entry>No</entry>
  112. <entry>numeric</entry>
  113. <entry>GPS fix status: %d, 2=DGPS fix, 3=RTK Fixed point,
  114. 4=RTK Floating point, 5=DR fix, 6=GNSSDR fix, 7=Time (surveyed) fix,
  115. 8=Simulated, 9=P(Y) fix, otherwise not present. Similar to FAA Quality
  116. Indicator in NMEA.</entry>
  117. </row>
  118. <row>
  119. <entry>mode</entry>
  120. <entry>Yes</entry>
  121. <entry>numeric</entry>
  122. <entry>NMEA mode: %d, 0=no mode value yet seen, 1=no fix, 2=2D,
  123. 3=3D.</entry>
  124. </row>
  125. <row>
  126. <entry>time</entry>
  127. <entry>No</entry>
  128. <entry>string</entry>
  129. <entry>Time/date stamp in ISO8601 format, UTC. May have a
  130. fractional part of up to .001sec precision. May be absent if the mode
  131. is not 2D or 3D.</entry>
  132. </row>
  133. <row>
  134. <entry>altHAE</entry>
  135. <entry>No</entry>
  136. <entry>numeric</entry>
  137. <entry>Altitude, height above allipsoid, in meters. Probably
  138. WGS84.</entry>
  139. </row>
  140. <row>
  141. <entry>altMSL</entry>
  142. <entry>No</entry>
  143. <entry>numeric</entry>
  144. <entry>MSL Altitude in meters. The geoid used is rarely specified
  145. and is often inaccurate. See the comments below on geoidSep.
  146. altMSL is altHAE minus geoidSep.</entry>
  147. </row>
  148. <row>
  149. <entry>alt</entry>
  150. <entry>No</entry>
  151. <entry>numeric</entry>
  152. <entry>Deprecated. Undefined. Use altHAE or altMSL.</entry>
  153. </row>
  154. <row>
  155. <entry>climb</entry>
  156. <entry>No</entry>
  157. <entry>numeric</entry>
  158. <entry>Climb (positive) or sink (negative) rate, meters per
  159. second.</entry>
  160. </row>
  161. <row>
  162. <entry>datum</entry>
  163. <entry>No</entry>
  164. <entry>string</entry>
  165. <entry>Current datum. Hopefully WGS84.</entry>
  166. </row>
  167. <row>
  168. <entry>depth</entry>
  169. <entry>No</entry>
  170. <entry>numeric</entry>
  171. <entry>Depth in meters. Probably depth below the keel...</entry>
  172. </row>
  173. <row>
  174. <entry>dgpsAge</entry>
  175. <entry>No</entry>
  176. <entry>numeric</entry>
  177. <entry>Age of DGPS data. In seconds</entry>
  178. </row>
  179. <row>
  180. <entry>dgpsSta</entry>
  181. <entry>No</entry>
  182. <entry>numeric</entry>
  183. <entry>Station of DGPS data.</entry>
  184. </row>
  185. <row>
  186. <entry>epc</entry>
  187. <entry>No</entry>
  188. <entry>numeric</entry>
  189. <entry>Estimated climb error in meters per second.
  190. Certainty unknown.</entry>
  191. </row>
  192. <row>
  193. <entry>epd</entry>
  194. <entry>No</entry>
  195. <entry>numeric</entry>
  196. <entry>Estimated track (direction) error in degrees.
  197. Certainty unknown.</entry>
  198. </row>
  199. <row>
  200. <entry>eph</entry>
  201. <entry>No</entry>
  202. <entry>numeric</entry>
  203. <entry>Estimated horizontal Position (2D) Error in meters.
  204. Also known as Estimated Position Error (epe). Certainty unknown.</entry>
  205. </row>
  206. <row>
  207. <entry>eps</entry>
  208. <entry>No</entry>
  209. <entry>numeric</entry>
  210. <entry>Estimated speed error in meters per second.
  211. Certainty unknown.</entry>
  212. </row>
  213. <row>
  214. <entry>ept</entry>
  215. <entry>No</entry>
  216. <entry>numeric</entry>
  217. <entry>Estimated timestamp error in seconds. Certainty unknown.</entry>
  218. </row>
  219. <row>
  220. <entry>epx</entry>
  221. <entry>No</entry>
  222. <entry>numeric</entry>
  223. <entry>Longitude error estimate in meters. Certainty unknown.</entry>
  224. </row>
  225. <row>
  226. <entry>epy</entry>
  227. <entry>No</entry>
  228. <entry>numeric</entry>
  229. <entry>Latitude error estimate in meters. Certainty unknown.</entry>
  230. </row>
  231. <row>
  232. <entry>epv</entry>
  233. <entry>No</entry>
  234. <entry>numeric</entry>
  235. <entry>Estimated vertical error in meters. Certainty unknown.</entry>
  236. </row>
  237. <row>
  238. <entry>geoidSep</entry>
  239. <entry>No</entry>
  240. <entry>numeric</entry>
  241. <entry>Geoid separation is the difference between the WGS84
  242. reference ellipsoid and the geoid (Mean Sea Level) in meters. Almost no
  243. GNSS receiver specifies how they compute their geoid. gpsd interpolates the
  244. geoid from a 5x5 degree table of EGM2008 values when the receiver does
  245. not supply a geoid separation. The gpsd computed geoidSep is usually
  246. within one meter of the "true" value, but can be off as much as 12 meters.
  247. </entry>
  248. </row>
  249. <row>
  250. <entry>lat</entry>
  251. <entry>No</entry>
  252. <entry>numeric</entry>
  253. <entry>Latitude in degrees: +/- signifies North/South.</entry>
  254. </row>
  255. <row>
  256. <entry>leapseconds</entry>
  257. <entry>No</entry>
  258. <entry>integer</entry>
  259. <entry>Current leap seconds.</entry>
  260. </row>
  261. <row>
  262. <entry>lon</entry>
  263. <entry>No</entry>
  264. <entry>numeric</entry>
  265. <entry>Longitude in degrees: +/- signifies East/West.</entry>
  266. </row>
  267. <row>
  268. <entry>track</entry>
  269. <entry>No</entry>
  270. <entry>numeric</entry>
  271. <entry>Course over ground, degrees from true north.</entry>
  272. </row>
  273. <row>
  274. <entry>magtrack</entry>
  275. <entry>No</entry>
  276. <entry>numeric</entry>
  277. <entry>Course over ground, degrees magnetic.</entry>
  278. </row>
  279. <row>
  280. <entry>magvar</entry>
  281. <entry>No</entry>
  282. <entry>numeric</entry>
  283. <entry>Magnetic variation, degrees. Also known as
  284. the magnetic declination (the direction of the horizontal component of
  285. the magnetic field measured clockwise from north) in degrees,
  286. Positive is West variation. Negative is East variation.</entry>
  287. </row>
  288. <row>
  289. <entry>speed</entry>
  290. <entry>No</entry>
  291. <entry>numeric</entry>
  292. <entry>Speed over ground, meters per second.</entry>
  293. </row>
  294. <row>
  295. <entry>ecefx</entry>
  296. <entry>No</entry>
  297. <entry>numeric</entry>
  298. <entry>ECEF X position in meters.</entry>
  299. </row>
  300. <row>
  301. <entry>ecefy</entry>
  302. <entry>No</entry>
  303. <entry>numeric</entry>
  304. <entry>ECEF Y position in meters.</entry>
  305. </row>
  306. <row>
  307. <entry>ecefz</entry>
  308. <entry>No</entry>
  309. <entry>numeric</entry>
  310. <entry>ECEF Z position in meters.</entry>
  311. </row>
  312. <row>
  313. <entry>ecefpAcc</entry>
  314. <entry>No</entry>
  315. <entry>numeric</entry>
  316. <entry>ECEF position error in meters. Certainty unknown.</entry>
  317. </row>
  318. <row>
  319. <entry>ecefvx</entry>
  320. <entry>No</entry>
  321. <entry>numeric</entry>
  322. <entry>ECEF X velocity in meters per second.</entry>
  323. </row>
  324. <row>
  325. <entry>ecefvy</entry>
  326. <entry>No</entry>
  327. <entry>numeric</entry>
  328. <entry>ECEF Y velocity in meters per second.</entry>
  329. </row>
  330. <row>
  331. <entry>ecefvz</entry>
  332. <entry>No</entry>
  333. <entry>numeric</entry>
  334. <entry>ECEF Z velocity in meters per second.</entry>
  335. </row>
  336. <row>
  337. <entry>ecefvAcc</entry>
  338. <entry>No</entry>
  339. <entry>numeric</entry>
  340. <entry>ECEF velocity error in meters per second. Certainty
  341. unknown.</entry>
  342. </row>
  343. <row>
  344. <entry>sep</entry>
  345. <entry>No</entry>
  346. <entry>numeric</entry>
  347. <entry>Estimated Spherical (3D) Position Error in meters.
  348. Guessed to be 95% confidence, but many GNSS receivers do not specify, so
  349. certainty unknown.</entry>
  350. </row>
  351. <row>
  352. <entry>relD</entry>
  353. <entry>No</entry>
  354. <entry>numeric</entry>
  355. <entry>Down component of relative position vector in meters.</entry>
  356. </row>
  357. <row>
  358. <entry>relE</entry>
  359. <entry>No</entry>
  360. <entry>numeric</entry>
  361. <entry>East component of relative position vector in meters.</entry>
  362. </row>
  363. <row>
  364. <entry>relN</entry>
  365. <entry>No</entry>
  366. <entry>numeric</entry>
  367. <entry>North component of relative position vector in meters.</entry>
  368. </row>
  369. <row>
  370. <entry>velD</entry>
  371. <entry>No</entry>
  372. <entry>numeric</entry>
  373. <entry>Down velocity component in meters.</entry>
  374. </row>
  375. <row>
  376. <entry>velE</entry>
  377. <entry>No</entry>
  378. <entry>numeric</entry>
  379. <entry>wEast velocity component in meters.</entry>
  380. </row>
  381. <row>
  382. <entry>velN</entry>
  383. <entry>No</entry>
  384. <entry>numeric</entry>
  385. <entry>North velocity component in meters.</entry>
  386. </row>
  387. <row>
  388. <entry>wanglem</entry>
  389. <entry>No</entry>
  390. <entry>numeric</entry>
  391. <entry>Wind angle magnetic in degrees.</entry>
  392. </row>
  393. <row>
  394. <entry>wangler</entry>
  395. <entry>No</entry>
  396. <entry>numeric</entry>
  397. <entry>Wind angle relative in degrees.</entry>
  398. </row>
  399. <row>
  400. <entry>wanglet</entry>
  401. <entry>No</entry>
  402. <entry>numeric</entry>
  403. <entry>Wind angle true in degrees.</entry>
  404. </row>
  405. <row>
  406. <entry>wspeedr</entry>
  407. <entry>No</entry>
  408. <entry>numeric</entry>
  409. <entry>Wind speed relative in meters per second.</entry>
  410. </row>
  411. <row>
  412. <entry>wspeedt</entry>
  413. <entry>No</entry>
  414. <entry>numeric</entry>
  415. <entry>Wind speed true in meters per second.</entry>
  416. </row>
  417. </tbody>
  418. </tgroup>
  419. </table>
  420. <para>When the C client library parses a response of this kind, it
  421. will assert validity bits in the top-level set member for each
  422. field received; see gps.h for bitmask names and values.</para>
  423. <para>Invalid or unknown floating-point values will be set to NAN.
  424. Always check floating points with isfinite() before use.
  425. </para>
  426. <para>Here's an example:</para>
  427. <programlisting>
  428. {"class":"TPV","device":"/dev/pts/1",
  429. "time":"2005-06-08T10:34:48.283Z","ept":0.005,
  430. "lat":46.498293369,"lon":7.567411672,"alt":1343.127,
  431. "eph":36.000,"epv":32.321,
  432. "track":10.3788,"speed":0.091,"climb":-0.085,"mode":3}
  433. </programlisting>
  434. </listitem>
  435. </varlistentry>
  436. <varlistentry>
  437. <term>SKY</term>
  438. <listitem>
  439. <para>A SKY object reports a sky view of the GPS satellite positions.
  440. If there is no GPS device available, or no skyview has been reported
  441. yet, only the "class" field will reliably be present.</para>
  442. <table frame="all" pgwide="0"><title>SKY object</title>
  443. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  444. <thead>
  445. <row>
  446. <entry>Name</entry>
  447. <entry>Always?</entry>
  448. <entry>Type</entry>
  449. <entry>Description</entry>
  450. </row>
  451. </thead>
  452. <tbody>
  453. <row>
  454. <entry>class</entry>
  455. <entry>Yes</entry>
  456. <entry>string</entry>
  457. <entry>Fixed: "SKY"</entry>
  458. </row>
  459. <row>
  460. <entry>device</entry>
  461. <entry>No</entry>
  462. <entry>string</entry>
  463. <entry>Name of originating device</entry>
  464. </row>
  465. <row>
  466. <entry>time</entry>
  467. <entry>No</entry>
  468. <entry>string</entry>
  469. <entry>Time/date stamp in ISO8601 format, UTC. May have a
  470. fractional part of up to .001sec precision.</entry>
  471. </row>
  472. <row>
  473. <entry>gdop</entry>
  474. <entry>No</entry>
  475. <entry>numeric</entry>
  476. <entry>Geometric (hyperspherical) dilution of precision, a
  477. combination of PDOP and TDOP. A dimensionless factor which
  478. should be multiplied by a base UERE
  479. to get an error estimate.</entry>
  480. </row>
  481. <row>
  482. <entry>hdop</entry>
  483. <entry>No</entry>
  484. <entry>numeric</entry>
  485. <entry>Horizontal dilution of precision, a dimensionless
  486. factor which should be multiplied by a base UERE to get a
  487. circular error estimate.</entry>
  488. </row>
  489. <row>
  490. <entry>pdop</entry>
  491. <entry>No</entry>
  492. <entry>numeric</entry>
  493. <entry>Position (spherical/3D) dilution of precision, a dimensionless
  494. factor which should be multiplied by a base UERE to get an
  495. error estimate.</entry>
  496. </row>
  497. <row>
  498. <entry>tdop</entry>
  499. <entry>No</entry>
  500. <entry>numeric</entry>
  501. <entry>Time dilution of precision, a dimensionless
  502. factor which should be multiplied by a base UERE to get an
  503. error estimate.</entry>
  504. </row>
  505. <row>
  506. <entry>vdop</entry>
  507. <entry>No</entry>
  508. <entry>numeric</entry>
  509. <entry>Vertical (altitude) dilution of precision, a dimensionless
  510. factor which should be multiplied by a base UERE to get an
  511. error estimate.</entry>
  512. </row>
  513. <row>
  514. <entry>xdop</entry>
  515. <entry>No</entry>
  516. <entry>numeric</entry>
  517. <entry>Longitudinal dilution of precision, a dimensionless
  518. factor which should be multiplied by a base UERE to get an
  519. error estimate.</entry>
  520. </row>
  521. <row>
  522. <entry>ydop</entry>
  523. <entry>No</entry>
  524. <entry>numeric</entry>
  525. <entry>Latitudinal dilution of precision, a dimensionless
  526. factor which should be multiplied by a base UERE to get an
  527. error estimate.</entry>
  528. </row>
  529. <row>
  530. <entry>nSat</entry>
  531. <entry>No</entry>
  532. <entry>numeric</entry>
  533. <entry>Number of satellite objects in "satellites" array.</entry>
  534. </row>
  535. <row>
  536. <entry>uSat</entry>
  537. <entry>No</entry>
  538. <entry>numeric</entry>
  539. <entry>Number of satellites used in navigation solution.</entry>
  540. </row>
  541. <row>
  542. <entry>satellites</entry>
  543. <entry>Yes</entry>
  544. <entry>list</entry>
  545. <entry>List of satellite objects in skyview</entry>
  546. </row>
  547. </tbody>
  548. </tgroup>
  549. </table>
  550. <para>Many devices compute dilution of precision factors but do not
  551. include them in their reports. Many that do report DOPs report only
  552. HDOP, two-dimensional circular error. <application>gpsd</application>
  553. always passes through whatever the device reports, then
  554. attempts to fill in other DOPs by calculating the appropriate
  555. determinants in a covariance matrix based on the satellite view. DOPs
  556. may be missing if some of these determinants are singular. It can even
  557. happen that the device reports an error estimate in meters when the
  558. corresponding DOP is unavailable; some devices use more sophisticated
  559. error modeling than the covariance calculation.</para>
  560. <para>The satellite list objects have the following elements:</para>
  561. <table frame="all" pgwide="0"><title>Satellite object</title>
  562. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  563. <thead>
  564. <row>
  565. <entry>Name</entry>
  566. <entry>Always?</entry>
  567. <entry>Type</entry>
  568. <entry>Description</entry>
  569. </row>
  570. </thead>
  571. <tbody>
  572. <row>
  573. <entry>PRN</entry>
  574. <entry>Yes</entry>
  575. <entry>numeric</entry>
  576. <entry>PRN ID of the satellite. 1-63 are GNSS satellites,
  577. 64-96 are GLONASS satellites, 100-164 are SBAS satellites</entry>
  578. </row>
  579. <row>
  580. <entry>az</entry>
  581. <entry>No</entry>
  582. <entry>numeric</entry>
  583. <entry>Azimuth, degrees from true north.</entry>
  584. </row>
  585. <row>
  586. <entry>el</entry>
  587. <entry>No</entry>
  588. <entry>numeric</entry>
  589. <entry>Elevation in degrees.</entry>
  590. </row>
  591. <row>
  592. <entry>ss</entry>
  593. <entry>No</entry>
  594. <entry>numeric</entry>
  595. <entry>Signal to Noise ratio in dBHz.</entry>
  596. </row>
  597. <row>
  598. <entry>used</entry>
  599. <entry>Yes</entry>
  600. <entry>boolean</entry>
  601. <entry>Used in current solution? (SBAS/WAAS/EGNOS satellites
  602. may be flagged used if the solution has corrections from them,
  603. but not all drivers make this information available.)</entry>
  604. </row>
  605. <row>
  606. <entry>gnssid</entry>
  607. <entry>No</entry>
  608. <entry>numeric</entry>
  609. <entry>The GNSS ID, as defined by u-blox, not NMEA. 0=GPS,
  610. 2=Galileo, 3=Beidou, 5=QZSS, 6-GLONASS.</entry>
  611. </row>
  612. <row>
  613. <entry>svid</entry>
  614. <entry>No</entry>
  615. <entry>numeric</entry>
  616. <entry>The satellite ID within its constellation. As defined
  617. by u-blox, not NMEA).</entry>
  618. </row>
  619. <row>
  620. <entry>sigid</entry>
  621. <entry>No</entry>
  622. <entry>numeric</entry>
  623. <entry>The signal ID of this signal. As defined by u-blox, not
  624. NMEA. See u-blox doc for details.</entry>
  625. </row>
  626. <row>
  627. <entry>freqid</entry>
  628. <entry>No</entry>
  629. <entry>numeric</entry>
  630. <entry>For GLONASS satellites only: the frequency ID of the signal.
  631. As defined by u-blox, range 0 to 13. The freqid is the frequency slot
  632. plus 7.</entry>
  633. </row>
  634. <row>
  635. <entry>health</entry>
  636. <entry>No</entry>
  637. <entry>numeric</entry>
  638. <entry>The health of this satellite. 0 is unknown, 1 is
  639. OK, and 2 is unhealthy.</entry>
  640. </row>
  641. </tbody>
  642. </tgroup>
  643. </table>
  644. <para>Note that satellite objects do not have a "class" field, as
  645. they are never shipped outside of a SKY object.</para>
  646. <para>When the C client library parses a SKY response, it
  647. will assert the SATELLITE_SET bit in the top-level set member.</para>
  648. <para>Here's an example:</para>
  649. <programlisting>
  650. {"class":"SKY","device":"/dev/pts/1",
  651. "time":"2005-07-08T11:28:07.114Z",
  652. "xdop":1.55,"hdop":1.24,"pdop":1.99,
  653. "satellites":[
  654. {"PRN":23,"el":6,"az":84,"ss":0,"used":false},
  655. {"PRN":28,"el":7,"az":160,"ss":0,"used":false},
  656. {"PRN":8,"el":66,"az":189,"ss":44,"used":true},
  657. {"PRN":29,"el":13,"az":273,"ss":0,"used":false},
  658. {"PRN":10,"el":51,"az":304,"ss":29,"used":true},
  659. {"PRN":4,"el":15,"az":199,"ss":36,"used":true},
  660. {"PRN":2,"el":34,"az":241,"ss":43,"used":true},
  661. {"PRN":27,"el":71,"az":76,"ss":43,"used":true}]}
  662. </programlisting>
  663. </listitem>
  664. </varlistentry>
  665. <varlistentry>
  666. <term>GST</term>
  667. <listitem>
  668. <para>A GST object is a pseudorange noise report.</para>
  669. <table frame="all" pgwide="0"><title>GST object</title>
  670. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  671. <thead>
  672. <row>
  673. <entry>Name</entry>
  674. <entry>Always?</entry>
  675. <entry>Type</entry>
  676. <entry>Description</entry>
  677. </row>
  678. </thead>
  679. <tbody>
  680. <row>
  681. <entry>class</entry>
  682. <entry>Yes</entry>
  683. <entry>string</entry>
  684. <entry>Fixed: "GST"</entry>
  685. </row>
  686. <row>
  687. <entry>device</entry>
  688. <entry>No</entry>
  689. <entry>string</entry>
  690. <entry>Name of originating device</entry>
  691. </row>
  692. <row>
  693. <entry>time</entry>
  694. <entry>No</entry>
  695. <entry>string</entry>
  696. <entry>Time/date stamp in ISO8601 format, UTC. May have a
  697. fractional part of up to .001sec precision.</entry>
  698. </row>
  699. <row>
  700. <entry>rms</entry>
  701. <entry>No</entry>
  702. <entry>numeric</entry>
  703. <entry>Value of the standard deviation of the range inputs to the
  704. navigation process (range inputs include pseudoranges and DGPS
  705. corrections).</entry>
  706. </row>
  707. <row>
  708. <entry>major</entry>
  709. <entry>No</entry>
  710. <entry>numeric</entry>
  711. <entry>Standard deviation of semi-major axis of error ellipse,
  712. in meters.</entry>
  713. </row>
  714. <row>
  715. <entry>minor</entry>
  716. <entry>No</entry>
  717. <entry>numeric</entry>
  718. <entry>Standard deviation of semi-minor axis of error ellipse,
  719. in meters.</entry>
  720. </row>
  721. <row>
  722. <entry>orient</entry>
  723. <entry>No</entry>
  724. <entry>numeric</entry>
  725. <entry>Orientation of semi-major axis of error ellipse, in degrees
  726. from true north.</entry>
  727. </row>
  728. <row>
  729. <entry>lat</entry>
  730. <entry>No</entry>
  731. <entry>numeric</entry>
  732. <entry>Standard deviation of latitude error, in meters.</entry>
  733. </row>
  734. <row>
  735. <entry>lon</entry>
  736. <entry>No</entry>
  737. <entry>numeric</entry>
  738. <entry>Standard deviation of longitude error, in meters.</entry>
  739. </row>
  740. <row>
  741. <entry>alt</entry>
  742. <entry>No</entry>
  743. <entry>numeric</entry>
  744. <entry>Standard deviation of altitude error, in meters.</entry>
  745. </row>
  746. </tbody>
  747. </tgroup>
  748. </table>
  749. <para>Here's an example:</para>
  750. <programlisting>
  751. {"class":"GST","device":"/dev/ttyUSB0",
  752. "time":"2010-12-07T10:23:07.096Z","rms":2.440,
  753. "major":1.660,"minor":1.120,"orient":68.989,
  754. "lat":1.600,"lon":1.200,"alt":2.520}
  755. </programlisting>
  756. </listitem>
  757. </varlistentry>
  758. <varlistentry>
  759. <term>ATT</term>
  760. <listitem>
  761. <para>An ATT object is a vehicle-attitude report. It is returned by
  762. digital-compass and gyroscope sensors; depending on device, it may
  763. include: heading, pitch, roll, yaw, gyroscope, and magnetic-field
  764. readings. Because such sensors are often bundled as part of
  765. marine-navigation systems, the ATT response may also include
  766. water depth.</para>
  767. <para>The "class" and "mode" fields will reliably be present. Others
  768. may be reported or not depending on the specific device type.</para>
  769. <table frame="all" pgwide="0"><title>ATT object</title>
  770. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  771. <thead>
  772. <row>
  773. <entry>Name</entry>
  774. <entry>Always?</entry>
  775. <entry>Type</entry>
  776. <entry>Description</entry>
  777. </row>
  778. </thead>
  779. <tbody>
  780. <row>
  781. <entry>class</entry>
  782. <entry>Yes</entry>
  783. <entry>string</entry>
  784. <entry>Fixed: "ATT"</entry>
  785. </row>
  786. <row>
  787. <entry>device</entry>
  788. <entry>Yes</entry>
  789. <entry>string</entry>
  790. <entry>Name of originating device</entry>
  791. </row>
  792. <row>
  793. <entry>time</entry>
  794. <entry>No</entry>
  795. <entry>string</entry>
  796. <entry>Time/date stamp in ISO8601 format, UTC. May have a
  797. fractional part of up to .001sec precision.</entry>
  798. </row>
  799. <row>
  800. <entry>heading</entry>
  801. <entry>No</entry>
  802. <entry>numeric</entry>
  803. <entry>Heading, degrees from true north.</entry>
  804. </row>
  805. <row>
  806. <entry>mag_st</entry>
  807. <entry>No</entry>
  808. <entry>string</entry>
  809. <entry>Magnetometer status.</entry>
  810. </row>
  811. <row>
  812. <entry>pitch</entry>
  813. <entry>No</entry>
  814. <entry>numeric</entry>
  815. <entry>Pitch in degrees.</entry>
  816. </row>
  817. <row>
  818. <entry>pitch_st</entry>
  819. <entry>No</entry>
  820. <entry>string</entry>
  821. <entry>Pitch sensor status.</entry>
  822. </row>
  823. <row>
  824. <entry>yaw</entry>
  825. <entry>No</entry>
  826. <entry>numeric</entry>
  827. <entry>Yaw in degrees</entry>
  828. </row>
  829. <row>
  830. <entry>yaw_st</entry>
  831. <entry>No</entry>
  832. <entry>string</entry>
  833. <entry>Yaw sensor status.</entry>
  834. </row>
  835. <row>
  836. <entry>roll</entry>
  837. <entry>No</entry>
  838. <entry>numeric</entry>
  839. <entry>Roll in degrees.</entry>
  840. </row>
  841. <row>
  842. <entry>roll_st</entry>
  843. <entry>No</entry>
  844. <entry>string</entry>
  845. <entry>Roll sensor status.</entry>
  846. </row>
  847. <row>
  848. <entry>dip</entry>
  849. <entry>No</entry>
  850. <entry>numeric</entry>
  851. <entry>Local magnetic inclination, degrees, positive when the magnetic
  852. field points downward (into the Earth).</entry>
  853. </row>
  854. <row>
  855. <entry>mag_len</entry>
  856. <entry>No</entry>
  857. <entry>numeric</entry>
  858. <entry>Scalar magnetic field strength.</entry>
  859. </row>
  860. <row>
  861. <entry>mag_x</entry>
  862. <entry>No</entry>
  863. <entry>numeric</entry>
  864. <entry>X component of magnetic field strength.</entry>
  865. </row>
  866. <row>
  867. <entry>mag_y</entry>
  868. <entry>No</entry>
  869. <entry>numeric</entry>
  870. <entry>Y component of magnetic field strength.</entry>
  871. </row>
  872. <row>
  873. <entry>mag_z</entry>
  874. <entry>No</entry>
  875. <entry>numeric</entry>
  876. <entry>Z component of magnetic field strength.</entry>
  877. </row>
  878. <row>
  879. <entry>acc_len</entry>
  880. <entry>No</entry>
  881. <entry>numeric</entry>
  882. <entry>Scalar acceleration.</entry>
  883. </row>
  884. <row>
  885. <entry>acc_x</entry>
  886. <entry>No</entry>
  887. <entry>numeric</entry>
  888. <entry>X component of acceleration.</entry>
  889. </row>
  890. <row>
  891. <entry>acc_y</entry>
  892. <entry>No</entry>
  893. <entry>numeric</entry>
  894. <entry>Y component of acceleration.</entry>
  895. </row>
  896. <row>
  897. <entry>acc_z</entry>
  898. <entry>No</entry>
  899. <entry>numeric</entry>
  900. <entry>Z component of acceleration.</entry>
  901. </row>
  902. <row>
  903. <entry>gyro_x</entry>
  904. <entry>No</entry>
  905. <entry>numeric</entry>
  906. <entry>X component of acceleration.</entry>
  907. </row>
  908. <row>
  909. <entry>gyro_y</entry>
  910. <entry>No</entry>
  911. <entry>numeric</entry>
  912. <entry>Y component of acceleration.</entry>
  913. </row>
  914. <row>
  915. <entry>depth</entry>
  916. <entry>No</entry>
  917. <entry>numeric</entry>
  918. <entry>Water depth in meters.</entry>
  919. </row>
  920. <row>
  921. <entry>temp</entry>
  922. <entry>No</entry>
  923. <entry>numeric</entry>
  924. <entry>Temperature at the sensor, degrees centigrade.</entry>
  925. </row>
  926. </tbody>
  927. </tgroup>
  928. </table>
  929. <para>The heading, pitch, and roll status codes (if present) vary by device.
  930. For the TNT Revolution digital compasses, they are coded as follows: </para>
  931. <table frame="all" pgwide="0"><title>Device flags</title>
  932. <tgroup cols="2" align="left" colsep="1" rowsep="1">
  933. <thead>
  934. <row>
  935. <entry>Code</entry>
  936. <entry>Description</entry>
  937. </row>
  938. </thead>
  939. <tbody>
  940. <row>
  941. <entry>C</entry>
  942. <entry>magnetometer calibration alarm</entry>
  943. </row>
  944. <row>
  945. <entry>L</entry>
  946. <entry>low alarm</entry>
  947. </row>
  948. <row>
  949. <entry>M</entry>
  950. <entry>low warning</entry>
  951. </row>
  952. <row>
  953. <entry>N</entry>
  954. <entry>normal</entry>
  955. </row>
  956. <row>
  957. <entry>O</entry>
  958. <entry>high warning</entry>
  959. </row>
  960. <row>
  961. <entry>P</entry>
  962. <entry>high alarm</entry>
  963. </row>
  964. <row>
  965. <entry>V</entry>
  966. <entry>magnetometer voltage level alarm</entry>
  967. </row>
  968. </tbody>
  969. </tgroup>
  970. </table>
  971. <para>When the C client library parses a response of this kind, it
  972. will assert ATT_IS.</para>
  973. <para>Here's an example:</para>
  974. <programlisting>
  975. {"class":"ATT","time":1270938096.843,
  976. "heading":14223.00,"mag_st":"N",
  977. "pitch":169.00,"pitch_st":"N", "roll":-43.00,"roll_st":"N",
  978. "dip":13641.000,"mag_x":2454.000}
  979. </programlisting>
  980. </listitem>
  981. </varlistentry>
  982. </variablelist>
  983. <para>And here are the commands:</para>
  984. <variablelist>
  985. <varlistentry>
  986. <term>?VERSION;</term>
  987. <listitem><para>Returns an object with the following attributes:</para>
  988. <table frame="all" pgwide="0"><title>VERSION object</title>
  989. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  990. <thead>
  991. <row>
  992. <entry>Name</entry>
  993. <entry>Always?</entry>
  994. <entry>Type</entry>
  995. <entry>Description</entry>
  996. </row>
  997. </thead>
  998. <tbody>
  999. <row>
  1000. <entry>class</entry>
  1001. <entry>Yes</entry>
  1002. <entry>string</entry>
  1003. <entry>Fixed: "VERSION"</entry>
  1004. </row>
  1005. <row>
  1006. <entry>release</entry>
  1007. <entry>Yes</entry>
  1008. <entry>string</entry>
  1009. <entry>Public release level</entry>
  1010. </row>
  1011. <row>
  1012. <entry>rev</entry>
  1013. <entry>Yes</entry>
  1014. <entry>string</entry>
  1015. <entry>Internal revision-control level.</entry>
  1016. </row>
  1017. <row>
  1018. <entry>proto_major</entry>
  1019. <entry>Yes</entry>
  1020. <entry>numeric</entry>
  1021. <entry>API major revision level.</entry>
  1022. </row>
  1023. <row>
  1024. <entry>proto_minor</entry>
  1025. <entry>Yes</entry>
  1026. <entry>numeric</entry>
  1027. <entry>API minor revision level.</entry>
  1028. </row>
  1029. <row>
  1030. <entry>remote</entry>
  1031. <entry>No</entry>
  1032. <entry>string</entry>
  1033. <entry>URL of the remote daemon reporting this version. If
  1034. empty, this is the version of the local daemon.</entry>
  1035. </row>
  1036. </tbody>
  1037. </tgroup>
  1038. </table>
  1039. <para>The daemon ships a VERSION response to each client when the
  1040. client first connects to it.</para>
  1041. <para>When the C client library parses a response of this kind, it
  1042. will assert the VERSION_SET bit in the top-level set member.</para>
  1043. <para>Here's an example:</para>
  1044. <programlisting>
  1045. {"class":"VERSION","version":"2.40dev",
  1046. "rev":"06f62e14eae9886cde907dae61c124c53eb1101f",
  1047. "proto_major":3,"proto_minor":1
  1048. }
  1049. </programlisting>
  1050. </listitem>
  1051. </varlistentry>
  1052. <varlistentry>
  1053. <term>?DEVICES;</term>
  1054. <listitem><para>Returns a device list object with the
  1055. following elements:</para>
  1056. <table frame="all" pgwide="0"><title>DEVICES object</title>
  1057. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1058. <thead>
  1059. <row>
  1060. <entry>Name</entry>
  1061. <entry>Always?</entry>
  1062. <entry>Type</entry>
  1063. <entry>Description</entry>
  1064. </row>
  1065. </thead>
  1066. <tbody>
  1067. <row>
  1068. <entry>class</entry>
  1069. <entry>Yes</entry>
  1070. <entry>string</entry>
  1071. <entry>Fixed: "DEVICES"</entry>
  1072. </row>
  1073. <row>
  1074. <entry>devices</entry>
  1075. <entry>Yes</entry>
  1076. <entry>list</entry>
  1077. <entry>List of device descriptions</entry>
  1078. </row>
  1079. <row>
  1080. <entry>remote</entry>
  1081. <entry>No</entry>
  1082. <entry>string</entry>
  1083. <entry>URL of the remote daemon reporting the device set. If
  1084. empty, this is a DEVICES response from the local daemon.</entry>
  1085. </row>
  1086. </tbody>
  1087. </tgroup>
  1088. </table>
  1089. <para>When the C client library parses a response of this kind, it
  1090. will assert the DEVICELIST_SET bit in the top-level set member.</para>
  1091. <para>Here's an example:</para>
  1092. <programlisting>
  1093. {"class"="DEVICES","devices":[
  1094. {"class":"DEVICE","path":"/dev/pts/1","flags":1,"driver":"SiRF binary"},
  1095. {"class":"DEVICE","path":"/dev/pts/3","flags":4,"driver":"AIVDM"}]}
  1096. </programlisting>
  1097. <para>The daemon occasionally ships a bare DEVICE object to the client
  1098. (that is, one not inside a DEVICES wrapper). The data content of these
  1099. objects will be described later as a response to the ?DEVICE command.</para>
  1100. </listitem>
  1101. </varlistentry>
  1102. <varlistentry>
  1103. <term>?WATCH;</term>
  1104. <listitem>
  1105. <para>This command sets watcher mode. It also sets or elicits a report
  1106. of per-subscriber policy and the raw bit. An argument WATCH object
  1107. changes the subscriber's policy. The response describes the
  1108. subscriber's policy. The response will also include a DEVICES
  1109. object.</para>
  1110. <para>A WATCH object has the following elements:</para>
  1111. <table frame="all" pgwide="0"><title>WATCH object</title>
  1112. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  1113. <thead>
  1114. <row>
  1115. <entry>Name</entry>
  1116. <entry>Always?</entry>
  1117. <entry>Type</entry>
  1118. <entry>Description</entry>
  1119. </row>
  1120. </thead>
  1121. <tbody>
  1122. <row>
  1123. <entry>class</entry>
  1124. <entry>Yes</entry>
  1125. <entry>string</entry>
  1126. <entry>Fixed: "WATCH"</entry>
  1127. </row>
  1128. <row>
  1129. <entry>enable</entry>
  1130. <entry>No</entry>
  1131. <entry>boolean</entry>
  1132. <entry>Enable (true) or disable (false) watcher mode. Default
  1133. is true.</entry>
  1134. </row>
  1135. <row>
  1136. <entry>json</entry>
  1137. <entry>No</entry>
  1138. <entry>boolean</entry>
  1139. <entry>Enable (true) or disable (false) dumping of JSON reports.
  1140. Default is false.</entry>
  1141. </row>
  1142. <row>
  1143. <entry>nmea</entry>
  1144. <entry>No</entry>
  1145. <entry>boolean</entry>
  1146. <entry>Enable (true) or disable (false) dumping of binary
  1147. packets as pseudo-NMEA. Default
  1148. is false.</entry>
  1149. </row>
  1150. <row>
  1151. <entry>raw</entry>
  1152. <entry>No</entry>
  1153. <entry>integer</entry>
  1154. <entry>Controls 'raw' mode. When this attribute is set to 1
  1155. for a channel, <application>gpsd</application> reports the
  1156. unprocessed NMEA or AIVDM data stream from whatever device is attached.
  1157. Binary GPS packets are hex-dumped. RTCM2 and RTCM3
  1158. packets are not dumped in raw mode. When this attribute is set to
  1159. 2 for a channel that processes binary data,
  1160. <application>gpsd</application> reports the received data verbatim
  1161. without hex-dumping.</entry>
  1162. </row>
  1163. <row>
  1164. <entry>scaled</entry>
  1165. <entry>No</entry>
  1166. <entry>boolean</entry>
  1167. <entry>If true, apply scaling divisors to output before
  1168. dumping; default is false.</entry>
  1169. </row>
  1170. <row>
  1171. <entry>split24</entry>
  1172. <entry>No</entry>
  1173. <entry>boolean</entry>
  1174. <entry>If true, aggregate AIS type24 sentence parts. If false,
  1175. report each part as a separate JSON object, leaving the
  1176. client to match MMSIs and aggregate. Default is
  1177. false. Applies only to AIS reports.</entry>
  1178. </row>
  1179. <row>
  1180. <entry>pps</entry>
  1181. <entry>No</entry>
  1182. <entry>boolean</entry>
  1183. <entry>If true, emit the TOFF JSON message on each cycle and a
  1184. PPS JSON message when the device issues 1PPS. Default is false.</entry>
  1185. </row>
  1186. <row>
  1187. <entry>device</entry>
  1188. <entry>No</entry>
  1189. <entry>string</entry>
  1190. <entry>If present, enable watching only of the specified device
  1191. rather than all devices. Useful with raw and NMEA modes
  1192. in which device responses aren't tagged. Has no effect when
  1193. used with enable:false.</entry>
  1194. </row>
  1195. <row>
  1196. <entry>remote</entry>
  1197. <entry>No</entry>
  1198. <entry>string</entry>
  1199. <entry>URL of the remote daemon reporting the watch set. If
  1200. empty, this is a WATCH response from the local daemon.</entry>
  1201. </row>
  1202. </tbody>
  1203. </tgroup>
  1204. </table>
  1205. <para>There is an additional boolean "timing" attribute which is
  1206. undocumented because that portion of the interface is considered
  1207. unstable and for developer use only.</para>
  1208. <para>In watcher mode, GPS reports are dumped as TPV and SKY
  1209. responses. AIS, Subframe and RTCM reporting is described in the next
  1210. section.</para>
  1211. <para>When the C client library parses a response of this kind, it
  1212. will assert the POLICY_SET bit in the top-level set member.</para>
  1213. <para>Here's an example:</para>
  1214. <programlisting>
  1215. {"class":"WATCH", "raw":1,"scaled":true}
  1216. </programlisting>
  1217. </listitem>
  1218. </varlistentry>
  1219. <varlistentry>
  1220. <term>?POLL;</term>
  1221. <listitem>
  1222. <para>The POLL command requests data from the last-seen fixes on all
  1223. active GPS devices. Devices must previously have been activated by
  1224. ?WATCH to be pollable.</para>
  1225. <para>Polling can lead to possibly surprising results when it is used
  1226. on a device such as an NMEA GPS for which a complete fix has to be
  1227. accumulated from several sentences. If you poll while those sentences
  1228. are being emitted, the response will contain the last complete fix
  1229. data and may be as much as one cycle time (typically 1 second)
  1230. stale.</para>
  1231. <para>The POLL response will contain a timestamped list of TPV objects
  1232. describing cached data, and a timestamped list of SKY objects
  1233. describing satellite configuration. If a device has not seen fixes, it
  1234. will be reported with a mode field of zero.</para>
  1235. <table frame="all" pgwide="0"><title>POLL object</title>
  1236. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1237. <thead>
  1238. <row>
  1239. <entry>Name</entry>
  1240. <entry>Always?</entry>
  1241. <entry>Type</entry>
  1242. <entry>Description</entry>
  1243. </row>
  1244. </thead>
  1245. <tbody>
  1246. <row>
  1247. <entry>class</entry>
  1248. <entry>Yes</entry>
  1249. <entry>string</entry>
  1250. <entry>Fixed: "POLL"</entry>
  1251. </row>
  1252. <row>
  1253. <entry>time</entry>
  1254. <entry>Yes</entry>
  1255. <entry>Numeric</entry>
  1256. <entry>Timestamp in ISO 8601 format. May have a
  1257. fractional part of up to .001sec precision.</entry>
  1258. </row>
  1259. <row>
  1260. <entry>active</entry>
  1261. <entry>Yes</entry>
  1262. <entry>Numeric</entry>
  1263. <entry>Count of active devices.</entry>
  1264. </row>
  1265. <row>
  1266. <entry>tpv</entry>
  1267. <entry>Yes</entry>
  1268. <entry>JSON array</entry>
  1269. <entry>Comma-separated list of TPV objects.</entry>
  1270. </row>
  1271. <row>
  1272. <entry>sky</entry>
  1273. <entry>Yes</entry>
  1274. <entry>JSON array</entry>
  1275. <entry>Comma-separated list of SKY objects.</entry>
  1276. </row>
  1277. </tbody>
  1278. </tgroup>
  1279. </table>
  1280. <para>Here's an example of a POLL response:</para>
  1281. <programlisting>
  1282. {"class":"POLL","time":"2010-06-04T10:31:00.289Z","active":1,
  1283. "tpv":[{"class":"TPV","device":"/dev/ttyUSB0",
  1284. "time":"2010-09-08T13:33:06.095Z",
  1285. "ept":0.005,"lat":40.035093060,
  1286. "lon":-75.519748733,"track":99.4319,"speed":0.123,"mode":2}],
  1287. "sky":[{"class":"SKY","device":"/dev/ttyUSB0",
  1288. "time":1270517264.240,"hdop":9.20,
  1289. "satellites":[{"PRN":16,"el":55,"az":42,"ss":36,"used":true},
  1290. {"PRN":19,"el":25,"az":177,"ss":0,"used":false},
  1291. {"PRN":7,"el":13,"az":295,"ss":0,"used":false},
  1292. {"PRN":6,"el":56,"az":135,"ss":32,"used":true},
  1293. {"PRN":13,"el":47,"az":304,"ss":0,"used":false},
  1294. {"PRN":23,"el":66,"az":259,"ss":0,"used":false},
  1295. {"PRN":20,"el":7,"az":226,"ss":0,"used":false},
  1296. {"PRN":3,"el":52,"az":163,"ss":32,"used":true},
  1297. {"PRN":31,"el":16,"az":102,"ss":0,"used":false}
  1298. ]}]}
  1299. </programlisting>
  1300. <note>
  1301. <para>Client software should not assume the field inventory of the
  1302. POLL response is fixed for all time. As
  1303. <application>gpsd</application> collects and caches more data from
  1304. more sensor types, those data are likely to find their way
  1305. into this response.</para>
  1306. </note>
  1307. </listitem>
  1308. </varlistentry>
  1309. <varlistentry>
  1310. <term>TOFF</term>
  1311. <listitem>
  1312. <para>This message is emitted on each cycle and reports the offset
  1313. between the host's clock time and the GPS time at top of the second
  1314. (actually, when the first data for the reporting cycle is received).</para>
  1315. <para>This message exactly mirrors the PPS message except for two
  1316. details.</para>
  1317. <para>TOFF emits no NTP precision, this is assumed to be -2. See
  1318. the NTP documentation for their definition of precision.</para>
  1319. <para> The TOFF message reports the GPS time as derived from the GPS
  1320. serial data stream. The PPS message reports the GPS time as derived
  1321. from the GPS PPS pulse.</para>
  1322. <para>A TOFF object has the following elements:</para>
  1323. <table frame="all" pgwide="0"><title>TOFF object</title>
  1324. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  1325. <thead>
  1326. <row>
  1327. <entry>Name</entry>
  1328. <entry>Always?</entry>
  1329. <entry>Type</entry>
  1330. <entry>Description</entry>
  1331. </row>
  1332. </thead>
  1333. <tbody>
  1334. <row>
  1335. <entry>class</entry>
  1336. <entry>Yes</entry>
  1337. <entry>string</entry>
  1338. <entry>Fixed: "TOFF"</entry>
  1339. </row>
  1340. <row>
  1341. <entry>device</entry>
  1342. <entry>Yes</entry>
  1343. <entry>string</entry>
  1344. <entry>Name of the originating device</entry>
  1345. </row>
  1346. <row>
  1347. <entry>real_sec</entry>
  1348. <entry>Yes</entry>
  1349. <entry>numeric</entry>
  1350. <entry>seconds from the GPS clock</entry>
  1351. </row>
  1352. <row>
  1353. <entry>real_nsec</entry>
  1354. <entry>Yes</entry>
  1355. <entry>numeric</entry>
  1356. <entry>nanoseconds from the GPS clock</entry>
  1357. </row>
  1358. <row>
  1359. <entry>clock_sec</entry>
  1360. <entry>Yes</entry>
  1361. <entry>numeric</entry>
  1362. <entry>seconds from the system clock</entry>
  1363. </row>
  1364. <row>
  1365. <entry>clock_nsec</entry>
  1366. <entry>Yes</entry>
  1367. <entry>numeric</entry>
  1368. <entry>nanoseconds from the system clock</entry>
  1369. </row>
  1370. </tbody>
  1371. </tgroup>
  1372. </table>
  1373. <para>This message is emitted once per second to watchers of a device
  1374. and is intended to report the timestamps of the in-band report of the
  1375. GPS and seconds as reported by the system clock (which may be
  1376. NTP-corrected) when the first valid timestamp of the reporting cycle
  1377. was seen.</para>
  1378. <para>The message contains two second/nanosecond pairs: real_sec and
  1379. real_nsec contain the time the GPS thinks it was at the start of the
  1380. current cycle; clock_sec and clock_nsec contain the time the system
  1381. clock thinks it was on receipt of the first timing message of the cycle.
  1382. real_nsec is always to nanosecond precision. clock_nsec is nanosecond
  1383. precision on most systems.</para>
  1384. <para>Here's an example:</para>
  1385. <programlisting>
  1386. {"class":"TOFF","device":"/dev/ttyUSB0",
  1387. "real_sec":1330212592, "real_nsec":343182,
  1388. "clock_sec":1330212592,"clock_nsec":343184,
  1389. "precision":-2}
  1390. </programlisting>
  1391. </listitem>
  1392. </varlistentry>
  1393. <varlistentry>
  1394. <term>PPS</term>
  1395. <listitem>
  1396. <para>This message is emitted each time the daemon sees a valid PPS (Pulse
  1397. Per Second) strobe from a device.</para>
  1398. <para>This message exactly mirrors the TOFF message except for two
  1399. details.</para>
  1400. <para>PPS emits the NTP precision. See the NTP documentation for their
  1401. definition of precision.</para>
  1402. <para>The TOFF message reports the GPS time as derived from the GPS
  1403. serial data stream. The PPS message reports the GPS time as derived
  1404. from the GPS PPS pulse.</para>
  1405. <para>There are various sources of error in the reported clock times.
  1406. The speed of the serial connection between the GPS and the system adds
  1407. a delay to the start of cycle detection. An even bigger error is added
  1408. by the variable computation time inside the GPS. Taken together the
  1409. time derived from the start of the GPS cycle can have offsets of
  1410. 10 milliseconds to 700 milliseconds and combined jitter and wander of
  1411. 100 to 300 milliseconds.</para>
  1412. <para>A PPS object has the following elements:</para>
  1413. <table frame="all" pgwide="0"><title>PPS object</title>
  1414. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  1415. <thead>
  1416. <row>
  1417. <entry>Name</entry>
  1418. <entry>Always?</entry>
  1419. <entry>Type</entry>
  1420. <entry>Description</entry>
  1421. </row>
  1422. </thead>
  1423. <tbody>
  1424. <row>
  1425. <entry>class</entry>
  1426. <entry>Yes</entry>
  1427. <entry>string</entry>
  1428. <entry>Fixed: "PPS"</entry>
  1429. </row>
  1430. <row>
  1431. <entry>device</entry>
  1432. <entry>Yes</entry>
  1433. <entry>string</entry>
  1434. <entry>Name of the originating device</entry>
  1435. </row>
  1436. <row>
  1437. <entry>real_sec</entry>
  1438. <entry>Yes</entry>
  1439. <entry>numeric</entry>
  1440. <entry>seconds from the PPS source</entry>
  1441. </row>
  1442. <row>
  1443. <entry>real_nsec</entry>
  1444. <entry>Yes</entry>
  1445. <entry>numeric</entry>
  1446. <entry>nanoseconds from the PPS source</entry>
  1447. </row>
  1448. <row>
  1449. <entry>clock_sec</entry>
  1450. <entry>Yes</entry>
  1451. <entry>numeric</entry>
  1452. <entry>seconds from the system clock</entry>
  1453. </row>
  1454. <row>
  1455. <entry>clock_nsec</entry>
  1456. <entry>Yes</entry>
  1457. <entry>numeric</entry>
  1458. <entry>nanoseconds from the system clock</entry>
  1459. </row>
  1460. <row>
  1461. <entry>precision</entry>
  1462. <entry>Yes</entry>
  1463. <entry>numeric</entry>
  1464. <entry>NTP style estimate of PPS precision</entry>
  1465. </row>
  1466. <row>
  1467. <entry>qErr</entry>
  1468. <entry>No</entry>
  1469. <entry>numeric</entry>
  1470. <entry>Quantization error of the PPS, in picoseconds. Sometimes
  1471. called the "sawtooth" error.</entry>
  1472. </row>
  1473. </tbody>
  1474. </tgroup>
  1475. </table>
  1476. <para>This message is emitted once per second to watchers of a device
  1477. emitting PPS, and reports the time of the start of the GPS second (when
  1478. the 1PPS arrives) and seconds as reported by the system clock (which
  1479. may be NTP-corrected) at that moment.</para>
  1480. <para>The message contains two second/nanosecond pairs: real_sec and
  1481. real_nsec contain the time the GPS thinks it was at the PPS edge;
  1482. clock_sec and clock_nsec contain the time the system clock thinks it was
  1483. at the PPS edge. real_nsec is always to nanosecond precision. clock_nsec
  1484. is nanosecond precision on most systems.</para>
  1485. <para>There are various sources of error in the reported clock times.
  1486. For PPS delivered via a real serial-line strobe, serial-interrupt
  1487. latency plus processing time to the timer call should be bounded above
  1488. by about 10 microseconds; that can be reduced to less than 1 microsecond if
  1489. your kernel supports RFC 2783. USB1.1-to-serial control-line emulation is
  1490. limited to about 1 millisecond. seconds.</para>
  1491. <para>Here's an example:</para>
  1492. <programlisting>
  1493. {"class":"PPS","device":"/dev/ttyUSB0",
  1494. "real_sec":1330212592, "real_nsec":343182,
  1495. "clock_sec":1330212592,"clock_nsec":343184,
  1496. "precision":-3}
  1497. </programlisting>
  1498. </listitem>
  1499. </varlistentry>
  1500. <varlistentry>
  1501. <term>OSC</term>
  1502. <listitem>
  1503. <para>This message reports the status of a GPS-disciplined oscillator
  1504. (GPSDO). The GPS PPS output (which has excellent long-term stability)
  1505. is typically used to discipline a local oscillator with much better
  1506. short-term stability (such as a rubidium atomic clock).</para>
  1507. <para>An OSC object has the following elements:</para>
  1508. <table frame="all" pgwide="0"><title>OSC object</title>
  1509. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1510. <thead>
  1511. <row>
  1512. <entry>Name</entry>
  1513. <entry>Always?</entry>
  1514. <entry>Type</entry>
  1515. <entry>Description</entry>
  1516. </row>
  1517. </thead>
  1518. <tbody>
  1519. <row>
  1520. <entry>class</entry>
  1521. <entry>Yes</entry>
  1522. <entry>string</entry>
  1523. <entry>Fixed: "OSC"</entry>
  1524. </row>
  1525. <row>
  1526. <entry>device</entry>
  1527. <entry>Yes</entry>
  1528. <entry>string</entry>
  1529. <entry>Name of the originating device.</entry>
  1530. </row>
  1531. <row>
  1532. <entry>running</entry>
  1533. <entry>Yes</entry>
  1534. <entry>boolean</entry>
  1535. <entry>If true, the oscillator is currently running. Oscillators may
  1536. require warm-up time at the start of the day.</entry>
  1537. </row>
  1538. <row>
  1539. <entry>reference</entry>
  1540. <entry>Yes</entry>
  1541. <entry>boolean</entry>
  1542. <entry>If true, the oscillator is receiving a GPS PPS signal.</entry>
  1543. </row>
  1544. <row>
  1545. <entry>disciplined</entry>
  1546. <entry>Yes</entry>
  1547. <entry>boolean</entry>
  1548. <entry>If true, the GPS PPS signal is sufficiently stable and is being
  1549. used to discipline the local oscillator.</entry>
  1550. </row>
  1551. <row>
  1552. <entry>delta</entry>
  1553. <entry>Yes</entry>
  1554. <entry>numeric</entry>
  1555. <entry>The time difference (in nanoseconds) between the GPS-disciplined
  1556. oscillator PPS output pulse and the most recent GPS PPS input
  1557. pulse.</entry>
  1558. </row>
  1559. </tbody>
  1560. </tgroup>
  1561. </table>
  1562. <para>Here's an example:</para>
  1563. <programlisting>
  1564. {"class":"OSC","running":true,"device":"/dev/ttyUSB0",
  1565. "reference":true,"disciplined":true,"delta":67}
  1566. </programlisting>
  1567. </listitem>
  1568. </varlistentry>
  1569. <varlistentry>
  1570. <term>?DEVICE</term>
  1571. <listitem>
  1572. <para>This command reports (when followed by ';') the state of a
  1573. device, or sets (when followed by '=' and a DEVICE object)
  1574. device-specific control bits, notably the device's speed and serial
  1575. mode and the native-mode bit. The parameter-setting form will be rejected if
  1576. more than one client is attached to the channel.</para>
  1577. <para>Pay attention to the response, because it is
  1578. possible for this command to fail if the GPS does not support a
  1579. speed-switching command or only supports some combinations of
  1580. serial modes. In case of failure, the daemon and GPS will
  1581. continue to communicate at the old speed.</para>
  1582. <para>Use the parameter-setting form with caution. On USB and
  1583. Bluetooth GPSes it is also possible for serial mode setting to fail
  1584. either because the serial adaptor chip does not support non-8N1 modes
  1585. or because the device firmware does not properly synchronize the
  1586. serial adaptor chip with the UART on the GPS chipset when the speed
  1587. changes. These failures can hang your device, possibly requiring a GPS
  1588. power cycle or (in extreme cases) physically disconnecting the NVRAM
  1589. backup battery.</para>
  1590. <para>A DEVICE object has the following elements:</para>
  1591. <table frame="all" pgwide="0"><title>DEVICE object</title>
  1592. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  1593. <thead>
  1594. <row>
  1595. <entry>Name</entry>
  1596. <entry>Always?</entry>
  1597. <entry>Type</entry>
  1598. <entry>Description</entry>
  1599. </row>
  1600. </thead>
  1601. <tbody>
  1602. <row>
  1603. <entry>class</entry>
  1604. <entry>Yes</entry>
  1605. <entry>string</entry>
  1606. <entry>Fixed: "DEVICE"</entry>
  1607. </row>
  1608. <row>
  1609. <entry>path</entry>
  1610. <entry>No</entry>
  1611. <entry>string</entry>
  1612. <entry>Name the device for which the control bits are
  1613. being reported, or for which they are to be applied. This
  1614. attribute may be omitted only when there is exactly one
  1615. subscribed channel.</entry>
  1616. </row>
  1617. <row>
  1618. <entry>activated</entry>
  1619. <entry>No</entry>
  1620. <entry>string</entry>
  1621. <entry>Time the device was activated as an ISO8601
  1622. timestamp. If the device is inactive this attribute is
  1623. absent.</entry>
  1624. </row>
  1625. <row>
  1626. <entry>flags</entry>
  1627. <entry>No</entry>
  1628. <entry>integer</entry>
  1629. <entry>Bit vector of property flags. Currently defined flags are:
  1630. describe packet types seen so far (GPS, RTCM2, RTCM3,
  1631. AIS). Won't be reported if empty, e.g. before
  1632. <application>gpsd</application> has seen identifiable packets
  1633. from the device.</entry>
  1634. </row>
  1635. <row>
  1636. <entry>driver</entry>
  1637. <entry>No</entry>
  1638. <entry>string</entry>
  1639. <entry>GPSD's name for the device driver type. Won't be reported before
  1640. <application>gpsd</application> has seen identifiable packets
  1641. from the device.</entry>
  1642. </row>
  1643. <row>
  1644. <entry>subtype</entry>
  1645. <entry>No</entry>
  1646. <entry>string</entry>
  1647. <entry>Whatever version information the device driver returned.</entry>
  1648. </row>
  1649. <row>
  1650. <entry>subtype1</entry>
  1651. <entry>No</entry>
  1652. <entry>string</entry>
  1653. <entry>More version information the device driver returned.</entry>
  1654. </row>
  1655. <row>
  1656. <entry>bps</entry>
  1657. <entry>No</entry>
  1658. <entry>integer</entry>
  1659. <entry>Device speed in bits per second.</entry>
  1660. </row>
  1661. <row>
  1662. <entry>parity</entry>
  1663. <entry>No</entry>
  1664. <entry>string</entry>
  1665. <entry>N, O or E for no parity, odd, or even.</entry>
  1666. </row>
  1667. <row>
  1668. <entry>stopbits</entry>
  1669. <entry>Yes</entry>
  1670. <entry>string</entry>
  1671. <entry>Stop bits (1 or 2).</entry>
  1672. </row>
  1673. <row>
  1674. <entry>native</entry>
  1675. <entry>No</entry>
  1676. <entry>integer</entry>
  1677. <entry>0 means NMEA mode and 1 means
  1678. alternate mode (binary if it has one, for SiRF and Evermore chipsets
  1679. in particular). Attempting to set this mode on a non-GPS
  1680. device will yield an error.</entry>
  1681. </row>
  1682. <row>
  1683. <entry>cycle</entry>
  1684. <entry>No</entry>
  1685. <entry>real</entry>
  1686. <entry>Device cycle time in seconds.</entry>
  1687. </row>
  1688. <row>
  1689. <entry>mincycle</entry>
  1690. <entry>No</entry>
  1691. <entry>real</entry>
  1692. <entry>Device minimum cycle time in seconds. Reported from
  1693. ?DEVICE when (and only when) the rate is switchable. It is
  1694. read-only and not settable.</entry>
  1695. </row>
  1696. </tbody>
  1697. </tgroup>
  1698. </table>
  1699. <para>The serial parameters will (bps, parity, stopbits) be omitted in
  1700. a response describing a TCP/IP source such as an Ntrip, DGPSIP, or AIS
  1701. feed; on a serial device they will always be present.</para>
  1702. <para>The contents of the flags field should be interpreted as follows:</para>
  1703. <table frame="all" pgwide="0"><title>Device flags</title>
  1704. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1705. <thead>
  1706. <row>
  1707. <entry>C #define</entry>
  1708. <entry>Value</entry>
  1709. <entry>Description</entry>
  1710. </row>
  1711. </thead>
  1712. <tbody>
  1713. <row>
  1714. <entry>SEEN_GPS</entry>
  1715. <entry>0x01</entry>
  1716. <entry>GPS data has been seen on this device</entry>
  1717. </row>
  1718. <row>
  1719. <entry>SEEN_RTCM2</entry>
  1720. <entry>0x02</entry>
  1721. <entry>RTCM2 data has been seen on this device</entry>
  1722. </row>
  1723. <row>
  1724. <entry>SEEN_RTCM3</entry>
  1725. <entry>0x04</entry>
  1726. <entry>RTCM3 data has been seen on this device</entry>
  1727. </row>
  1728. <row>
  1729. <entry>SEEN_AIS</entry>
  1730. <entry>0x08</entry>
  1731. <entry>AIS data has been seen on this device</entry>
  1732. </row>
  1733. </tbody>
  1734. </tgroup>
  1735. </table>
  1736. <!--
  1737. <para>The mincycle member may be 0, indicating no hard lower limit on the
  1738. cycle time. On an NMEA device of this kind it is possible to try to
  1739. push more characters through per cycle than the time to transmit will
  1740. allow. You must set the time high enough to let all sentences come
  1741. through. Here are the maxima to use for computation:</para>
  1742. <table frame='all'>
  1743. <tgroup cols='2'>
  1744. <tbody>
  1745. <row><entry>ZDA </entry><entry>36</entry></row>
  1746. <row><entry>GLL </entry><entry>47</entry></row>
  1747. <row><entry>GGA </entry><entry>82</entry></row>
  1748. <row><entry>VTG </entry><entry>46</entry></row>
  1749. <row><entry>RMC </entry><entry>77</entry></row>
  1750. <row><entry>GSA </entry><entry>67</entry></row>
  1751. <row><entry>GSV </entry><entry>60 (per line, thus 180 for a set
  1752. of 3)</entry> </row>
  1753. </tbody>
  1754. </tgroup>
  1755. </table>
  1756. <para>The transmit time for a cycle (which must be less than 1 second)
  1757. is the total character count multiplied by 10 and divided by the baud
  1758. rate. A typical budget is GGA, RMC, GSA, 3*GSV = 82+75+67+(3*60) =
  1759. 404.</para>
  1760. -->
  1761. <para>When the C client library parses a response of this kind, it
  1762. will assert the DEVICE_SET bit in the top-level set member.</para>
  1763. <para>Here's an example:</para>
  1764. <programlisting>
  1765. {"class":"DEVICE","bps":4800,"parity":"N","stopbits":1,"native":0}
  1766. </programlisting>
  1767. </listitem>
  1768. </varlistentry>
  1769. </variablelist>
  1770. <para>When a client is in watcher mode, the daemon will ship it DEVICE
  1771. notifications when a device is added to the pool or
  1772. deactivated.</para>
  1773. <para>When the C client library parses a response of this kind, it
  1774. will assert the DEVICE_SET bit in the top-level set member.</para>
  1775. <para>Here's an example:</para>
  1776. <programlisting>
  1777. {"class":"DEVICE","path":"/dev/pts1","activated":0}
  1778. </programlisting>
  1779. <para>The daemon may ship an error object in response to a
  1780. syntactically invalid command line or unknown command. It has
  1781. the following elements:</para>
  1782. <table frame="all" pgwide="0"><title>ERROR notification object</title>
  1783. <tgroup cols="4" align="left" colsep="1" rowsep="1">
  1784. <thead>
  1785. <row>
  1786. <entry>Name</entry>
  1787. <entry>Always?</entry>
  1788. <entry>Type</entry>
  1789. <entry>Description</entry>
  1790. </row>
  1791. </thead>
  1792. <tbody>
  1793. <row>
  1794. <entry>class</entry>
  1795. <entry>Yes</entry>
  1796. <entry>string</entry>
  1797. <entry>Fixed: "ERROR"</entry>
  1798. </row>
  1799. <row>
  1800. <entry>message</entry>
  1801. <entry>Yes</entry>
  1802. <entry>string</entry>
  1803. <entry>Textual error message</entry>
  1804. </row>
  1805. </tbody>
  1806. </tgroup>
  1807. </table>
  1808. <para>Here's an example:</para>
  1809. <programlisting>
  1810. {"class":"ERROR","message":"Unrecognized request '?FOO'"}
  1811. </programlisting>
  1812. <para>When the C client library parses a response of this kind, it
  1813. will assert the ERR_SET bit in the top-level set member.</para>
  1814. </refsect1>
  1815. <refsect1 id='rtcm2'><title>RTCM2</title>
  1816. <para>RTCM-104 is a family of serial protocols used for broadcasting
  1817. pseudorange corrections from differential-GPS reference stations. Many
  1818. GPS receivers can accept these corrections to improve their reporting
  1819. accuracy.</para>
  1820. <para>RTCM-104 comes in two major and incompatible flavors, 2.x and
  1821. 3.x. Each major flavor has minor (compatible) revisions.</para>
  1822. <para>The applicable standard for RTCM Version 2.x is <citetitle>RTCM
  1823. Recommended Standards for Differential NAVSTAR GPS Service</citetitle>
  1824. RTCM Paper 194-93/SC 104-STD. For RTCM 3.1 it is <citetitle>RTCM Paper
  1825. 177-2006-SC104-STD</citetitle>. Ordering instructions for both
  1826. standards are accessible from the website of the <ulink
  1827. url='http://www.rtcm.org/'>Radio Technical Commission for Maritime
  1828. Services</ulink> under "Publications".</para>
  1829. <refsect2 id='wire-format'><title>RTCM WIRE TRANSMISSIONS</title>
  1830. <para>Differential-GPS correction stations consist of a GPS reference
  1831. receiver coupled to a low frequency (LF) transmitter. The GPS
  1832. reference receiver is a survey-grade GPS that does GPS carrier
  1833. tracking and can work out its position to a few millimeters. It
  1834. generates range and range-rate corrections and encodes them into
  1835. RTCM104. It ships the RTCM104 to the LF transmitter over serial rs-232
  1836. signal at 100 baud or 200 baud depending on the requirements of the
  1837. transmitter.</para>
  1838. <para>The LF transmitter broadcasts the approximately 300khz radio
  1839. signal that differential-GPS radio receivers pick up. Transmitters
  1840. that are meant to have a higher range will need to transmit at a
  1841. slower rate. The higher the data rate the harder it will be for the
  1842. remote radio receiver to receive with a good signal-to-noise ration.
  1843. (Higher data rate signals can't be averaged over as long a time frame,
  1844. hence they appear noisier.)</para>
  1845. </refsect2>
  1846. <refsect2 id='rtcm-wire-format'><title>RTCM WIRE FORMATS</title>
  1847. <para>An RTCM 2.x message consists of a sequence of up to 33 30-bit
  1848. words. The 24 most significant bits of each word are data and the six
  1849. least significant bits are parity. The parity algorithm used is the
  1850. same ISGPS-2000 as that used on GPS satellite downlinks. Each RTCM
  1851. 2.x message consists of two header words followed by zero or more data
  1852. words, depending upon the message type.</para>
  1853. <para>An RTCM 3.x message begins with a fixed leader byte 0xD3. That
  1854. is followed by six bits of version information and 10 bits of payload
  1855. length information. Following that is the payload; following the
  1856. payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
  1857. algorithm.</para>
  1858. </refsect2>
  1859. <refsect2 id='rtcm2-dump-format2'><title>RTCM2 JSON FORMAT</title>
  1860. <para>Each RTCM2 message is dumped as a single JSON object per
  1861. message, with the message fields as attributes of that object. Arrays
  1862. of satellite, station, and constellation statistics become arrays of
  1863. JSON sub-objects. Each sentence will normally also have a "device"
  1864. field containing the pathname of the originating device.</para>
  1865. <para>All attributes other than the device field are mandatory. Header
  1866. attributes are emitted before others.</para>
  1867. <refsect3><title>Header portion</title>
  1868. <table frame="all" pgwide="0"><title>SKY object</title>
  1869. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1870. <thead>
  1871. <row>
  1872. <entry>Name</entry>
  1873. <entry>Type</entry>
  1874. <entry>Description</entry>
  1875. </row>
  1876. </thead>
  1877. <tbody>
  1878. <row>
  1879. <entry>class</entry>
  1880. <entry>string</entry>
  1881. <entry>Fixed: "RTCM2".</entry>
  1882. </row>
  1883. <row>
  1884. <entry>type</entry>
  1885. <entry>integer</entry>
  1886. <entry>Message type (1-9).</entry>
  1887. </row>
  1888. <row>
  1889. <entry>station_id</entry>
  1890. <entry>integer</entry>
  1891. <entry>The id of the GPS reference receiver. The
  1892. LF transmitters also have (different) id numbers.</entry>
  1893. </row>
  1894. <row>
  1895. <entry>zcount</entry>
  1896. <entry>real</entry>
  1897. <entry>The reference time of the
  1898. corrections in the message in seconds within the current hour. Note
  1899. that it is in GPS time, which is some seconds ahead of UTC (see the
  1900. U.S. Naval Observatory's <ulink
  1901. url="ftp://maia.usno.navy.mil/ser7/tai-utc.dat">table of leap second
  1902. corrections</ulink>).</entry>
  1903. </row>
  1904. <row>
  1905. <entry>seqnum</entry>
  1906. <entry>integer</entry>
  1907. <entry>Sequence number. Only 3 bits wide, wraps after 7.</entry>
  1908. </row>
  1909. <row>
  1910. <entry>length</entry>
  1911. <entry>integer</entry>
  1912. <entry>The number of words after the header that comprise the
  1913. message.</entry>
  1914. </row>
  1915. <row>
  1916. <entry>station_health</entry>
  1917. <entry>integer</entry>
  1918. <entry>Station transmission status. Indicates the health of
  1919. the beacon as a reference source. Any nonzero value means the
  1920. satellite is probably transmitting bad data and should not be
  1921. used in a fix. 6 means the transmission is unmonitored. 7
  1922. means the station is not working properly. Other values are
  1923. defined by the beacon operator.</entry>
  1924. </row>
  1925. </tbody>
  1926. </tgroup>
  1927. </table>
  1928. <para>&lt;message type&gt; is one of</para>
  1929. <variablelist>
  1930. <varlistentry>
  1931. <term>1</term>
  1932. <listitem><para>full corrections -- one message containing corrections for
  1933. all GPS satellites in view. This is not common.</para></listitem>
  1934. </varlistentry>
  1935. <varlistentry>
  1936. <term>3</term>
  1937. <listitem><para>reference station parameters -- the position of the
  1938. reference station GPS antenna.</para></listitem>
  1939. </varlistentry>
  1940. <varlistentry>
  1941. <term>4</term>
  1942. <listitem><para>datum &mdash; the datum to which the DGPS data is
  1943. referred.</para></listitem>
  1944. </varlistentry>
  1945. <varlistentry>
  1946. <term>5</term>
  1947. <listitem><para>constellation health &mdash; information about the
  1948. satellites the beacon can see.</para></listitem>
  1949. </varlistentry>
  1950. <varlistentry>
  1951. <term>6</term>
  1952. <listitem><para>null message &mdash; just a filler.</para></listitem>
  1953. </varlistentry>
  1954. <varlistentry>
  1955. <term>7</term>
  1956. <listitem><para>radio beacon almanac &mdash; information about this or other
  1957. beacons.</para></listitem>
  1958. </varlistentry>
  1959. <varlistentry>
  1960. <term>9</term>
  1961. <listitem><para>subset corrections &mdash; a message containing corrections
  1962. for only a subset of the GPS satellites in view.</para></listitem>
  1963. </varlistentry>
  1964. <varlistentry>
  1965. <term>16</term>
  1966. <listitem><para>special message &mdash; a text message from the beacon
  1967. operator.</para></listitem>
  1968. </varlistentry>
  1969. <varlistentry>
  1970. <term>31</term>
  1971. <listitem><para>GLONASS subset corrections &mdash; a message
  1972. containing corrections for a set of the GLONASS satellites in
  1973. view.</para></listitem>
  1974. </varlistentry>
  1975. </variablelist>
  1976. </refsect3>
  1977. <refsect3><title>Type 1 and 9: Correction data</title>
  1978. <para>One or more satellite objects follow the header for type 1 or type 9
  1979. messages. Here is the format:</para>
  1980. <table frame="all" pgwide="0"><title>Satellite object</title>
  1981. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  1982. <thead>
  1983. <row>
  1984. <entry>Name</entry>
  1985. <entry>Type</entry>
  1986. <entry>Description</entry>
  1987. </row>
  1988. </thead>
  1989. <tbody>
  1990. <row>
  1991. <entry>ident</entry>
  1992. <entry>integer</entry>
  1993. <entry>The PRN number of the satellite for which this is
  1994. correction data.</entry>
  1995. </row>
  1996. <row>
  1997. <entry>udre</entry>
  1998. <entry>integer</entry>
  1999. <entry>User Differential Range Error (0-3). See the
  2000. table following for values.</entry>
  2001. </row>
  2002. <row>
  2003. <entry>iod</entry>
  2004. <entry>integer</entry>
  2005. <entry>Issue Of Data, matching the IOD for the current
  2006. ephemeris of this satellite, as transmitted by the satellite.
  2007. The IOD is a unique tag that identifies the ephemeris; the GPS
  2008. using the DGPS correction and the DGPS generating the data
  2009. must use the same orbital positions for the
  2010. satellite.</entry>
  2011. </row>
  2012. <row>
  2013. <entry>prc</entry>
  2014. <entry>real</entry>
  2015. <entry>The pseudorange error in meters for this
  2016. satellite as measured by the beacon reference receiver at the
  2017. epoch indicated by the z_count in the parent
  2018. record.</entry>
  2019. </row>
  2020. <row>
  2021. <entry>rrc</entry>
  2022. <entry>real</entry>
  2023. <entry>The rate of change of pseudorange error in
  2024. meters/sec for this satellite as measured by the beacon
  2025. reference receiver at the epoch indicated by the z_count field
  2026. in the parent record. This is used to calculate pseudorange
  2027. errors at other epochs, if required by the GPS
  2028. receiver.</entry>
  2029. </row>
  2030. </tbody>
  2031. </tgroup>
  2032. </table>
  2033. <para>User Differential Range Error values are as follows:</para>
  2034. <table frame="all" pgwide="0"><title>UDRE values</title>
  2035. <tgroup cols="2" align="left" colsep="1" rowsep="1">
  2036. <tbody>
  2037. <row><entry>0</entry><entry>1-sigma error &lt;= 1 m</entry></row>
  2038. <row><entry>1</entry><entry>1-sigma error &lt;= 4 m</entry></row>
  2039. <row><entry>2</entry><entry>1-sigma error &lt;= 8 m</entry></row>
  2040. <row><entry>3</entry><entry>1-sigma error &gt; 8 m</entry></row>
  2041. </tbody>
  2042. </tgroup>
  2043. </table>
  2044. <para>Here's an example:</para>
  2045. <programlisting>
  2046. {"class":"RTCM2","type":1,
  2047. "station_id":688,"zcount":843.0,"seqnum":5,"length":19,"station_health":6,
  2048. "satellites":[
  2049. {"ident":10,"udre":0,"iod":46,"prc":-2.400,"rrc":0.000},
  2050. {"ident":13,"udre":0,"iod":94,"prc":-4.420,"rrc":0.000},
  2051. {"ident":7,"udre":0,"iod":22,"prc":-5.160,"rrc":0.002},
  2052. {"ident":2,"udre":0,"iod":34,"prc":-6.480,"rrc":0.000},
  2053. {"ident":4,"udre":0,"iod":47,"prc":-8.860,"rrc":0.000},
  2054. {"ident":8,"udre":0,"iod":76,"prc":-7.980,"rrc":0.002},
  2055. {"ident":5,"udre":0,"iod":99,"prc":-8.260,"rrc":0.002},
  2056. {"ident":23,"udre":0,"iod":81,"prc":-8.060,"rrc":0.000},
  2057. {"ident":16,"udre":0,"iod":70,"prc":-11.740,"rrc":0.000},
  2058. {"ident":30,"udre":0,"iod":4,"prc":-18.960,"rrc":-0.006},
  2059. {"ident":29,"udre":0,"iod":101,"prc":-24.960,"rrc":-0.002}
  2060. ]}
  2061. </programlisting>
  2062. </refsect3>
  2063. <refsect3><title>Type 3: Reference Station Parameters</title>
  2064. <para>Here are the payload members of a type 3 (Reference Station
  2065. Parameters) message:</para>
  2066. <table frame="all" pgwide="0"><title>Reference Station Parameters</title>
  2067. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2068. <thead>
  2069. <row>
  2070. <entry>Name</entry>
  2071. <entry>Type</entry>
  2072. <entry>Description</entry>
  2073. </row>
  2074. </thead>
  2075. <tbody>
  2076. <row>
  2077. <entry>x</entry>
  2078. <entry>real</entry>
  2079. <entry>ECEF X coordinate.</entry>
  2080. </row>
  2081. <row>
  2082. <entry>y</entry>
  2083. <entry>real</entry>
  2084. <entry>ECEF Y coordinate.</entry>
  2085. </row>
  2086. <row>
  2087. <entry>z</entry>
  2088. <entry>real</entry>
  2089. <entry>ECEF Z coordinate.</entry>
  2090. </row>
  2091. </tbody>
  2092. </tgroup>
  2093. </table>
  2094. <para>The coordinates are the position of the station, in meters to two
  2095. decimal places, in Earth Centred Earth Fixed coordinates.
  2096. These are usually referred to the WGS84 reference frame, but may
  2097. be referred to NAD83 in the US (essentially identical to WGS84 for
  2098. all except geodesists), or some other reference frame in other
  2099. parts of the world.</para>
  2100. <para>An invalid reference message is represented by a type 3 header
  2101. without payload fields.</para>
  2102. <para>Here's an example:</para>
  2103. <programlisting>
  2104. {"class":"RTCM2","type":3,
  2105. "station_id":652,"zcount":1657.2,"seqnum":2,"length":4,"station_health":6,
  2106. "x":3878620.92,"y":670281.40,"z":5002093.59
  2107. }
  2108. </programlisting>
  2109. </refsect3>
  2110. <refsect3><title>Type 4: Datum</title>
  2111. <para>Here are the payload members of a type 4 (Datum) message:</para>
  2112. <table frame="all" pgwide="0"><title>Datum</title>
  2113. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2114. <thead>
  2115. <row>
  2116. <entry>Name</entry>
  2117. <entry>Type</entry>
  2118. <entry>Description</entry>
  2119. </row>
  2120. </thead>
  2121. <tbody>
  2122. <row>
  2123. <entry>dgnss_type</entry>
  2124. <entry>string</entry>
  2125. <entry>Either "GPS", "GLONASS", "GALILEO", or
  2126. "UNKNOWN".</entry>
  2127. </row>
  2128. <row>
  2129. <entry>dat</entry>
  2130. <entry>integer</entry>
  2131. <entry>0 or 1 and indicates the sense of the offset
  2132. shift given by dx, dy, dz. dat = 0 means that the station
  2133. coordinates (in the reference message) are referred to a local
  2134. datum and that adding dx, dy, dz to that position will render
  2135. it in GNSS coordinates (WGS84 for GPS). If dat = 1 then the
  2136. ref station position is in GNSS coordinates and adding dx, dy,
  2137. dz will give it referred to the local datum.</entry>
  2138. </row>
  2139. <row>
  2140. <entry>datum_name</entry>
  2141. <entry>string</entry>
  2142. <entry>A standard name for the datum.</entry>
  2143. </row>
  2144. <row>
  2145. <entry>dx</entry>
  2146. <entry>real</entry>
  2147. <entry>X offset.</entry>
  2148. </row>
  2149. <row>
  2150. <entry>dy</entry>
  2151. <entry>real</entry>
  2152. <entry>Y offset.</entry>
  2153. </row>
  2154. <row>
  2155. <entry>dz</entry>
  2156. <entry>real</entry>
  2157. <entry>Z offset.</entry>
  2158. </row>
  2159. </tbody>
  2160. </tgroup>
  2161. </table>
  2162. <para>&lt;dx&gt; &lt;dy&gt; &lt;dz&gt; are offsets to convert from
  2163. local datum to GNSS datum or vice versa. These fields are
  2164. optional.</para>
  2165. <para>An invalid datum message is represented by a type 4 header
  2166. without payload fields.</para>
  2167. </refsect3>
  2168. <refsect3><title>Type 5: Constellation Health</title>
  2169. <para>One or more of these follow the header for type 5 messages &mdash; one
  2170. for each satellite.</para>
  2171. <para>Here is the format:</para>
  2172. <table frame="all" pgwide="0"><title>Constellation health</title>
  2173. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2174. <thead>
  2175. <row>
  2176. <entry>Name</entry>
  2177. <entry>Type</entry>
  2178. <entry>Description</entry>
  2179. </row>
  2180. </thead>
  2181. <tbody>
  2182. <row>
  2183. <entry>ident</entry>
  2184. <entry>integer</entry>
  2185. <entry>The PRN number of the satellite.</entry>
  2186. </row>
  2187. <row>
  2188. <entry>iodl</entry>
  2189. <entry>bool</entry>
  2190. <entry>True indicates that this information relates to
  2191. the satellite information in an accompanying type 1 or type 9
  2192. message.</entry>
  2193. </row>
  2194. <row>
  2195. <entry>health</entry>
  2196. <entry>integer</entry>
  2197. <entry>0 indicates that the satellite is healthy. Any other value
  2198. indicates a problem (coding is not known).</entry>
  2199. </row>
  2200. <row>
  2201. <entry>snr</entry>
  2202. <entry>integer</entry>
  2203. <entry>The carrier/noise ratio of the received signal in
  2204. the range 25 to 55 dB(Hz).</entry>
  2205. </row>
  2206. <row>
  2207. <entry>health_en</entry>
  2208. <entry>bool</entry>
  2209. <entry>If set to True it indicates that the satellite is
  2210. healthy even if the satellite navigation data says it is
  2211. unhealthy.</entry>
  2212. </row>
  2213. <row>
  2214. <entry>new_data</entry>
  2215. <entry>bool</entry>
  2216. <entry>True indicates that the IOD for this satellite will
  2217. soon be updated in type 1 or 9 messages.</entry>
  2218. </row>
  2219. <row>
  2220. <entry>los_warning</entry>
  2221. <entry>bool</entry>
  2222. <entry>Line-of-sight warning. True indicates that the
  2223. satellite will shortly go unhealthy.</entry>
  2224. </row>
  2225. <row>
  2226. <entry>tou</entry>
  2227. <entry>integer</entry>
  2228. <entry>Healthy time remaining in seconds.</entry>
  2229. </row>
  2230. </tbody>
  2231. </tgroup>
  2232. </table>
  2233. </refsect3>
  2234. <refsect3><title>Type 6: Null</title>
  2235. <para>This just indicates a null message. There are no payload fields.</para>
  2236. </refsect3>
  2237. <refsect3><title>Unknown message</title>
  2238. <para>This format is used to dump message words in hexadecimal when the
  2239. message type field doesn't match any of the known ones.</para>
  2240. <para>Here is the format:</para>
  2241. <table frame="all" pgwide="0"><title>Unknown Message</title>
  2242. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2243. <thead>
  2244. <row>
  2245. <entry>Name</entry>
  2246. <entry>Type</entry>
  2247. <entry>Description</entry>
  2248. </row>
  2249. </thead>
  2250. <tbody>
  2251. <row>
  2252. <entry>data</entry>
  2253. <entry>list</entry>
  2254. <entry>A list of strings.</entry>
  2255. </row>
  2256. </tbody>
  2257. </tgroup>
  2258. </table>
  2259. <para>Each string in the array is a hex literal representing 30 bits
  2260. of information, after parity checks and inversion. The high two bits
  2261. should be ignored.</para>
  2262. </refsect3>
  2263. <refsect3><title>Type 7: Radio Beacon Almanac</title>
  2264. <para>Here is the format:</para>
  2265. <table frame="all" pgwide="0"><title>Constellation health</title>
  2266. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2267. <thead>
  2268. <row>
  2269. <entry>Name</entry>
  2270. <entry>Type</entry>
  2271. <entry>Description</entry>
  2272. </row>
  2273. </thead>
  2274. <tbody>
  2275. <row>
  2276. <entry>lat</entry>
  2277. <entry>real</entry>
  2278. <entry>Latitude in degrees, of the LF transmitter
  2279. antenna for the station for which this is an almanac. North
  2280. is positive.</entry>
  2281. </row>
  2282. <row>
  2283. <entry>lon</entry>
  2284. <entry>real</entry>
  2285. <entry>Longitude in degrees, of the LF transmitter
  2286. antenna for the station for which this is an almanac.
  2287. East is positive.</entry>
  2288. </row>
  2289. <row>
  2290. <entry>range</entry>
  2291. <entry>integer</entry>
  2292. <entry>Published range of the station in km.</entry>
  2293. </row>
  2294. <row>
  2295. <entry>frequency</entry>
  2296. <entry>real</entry>
  2297. <entry>Station broadcast frequency in kHz.</entry>
  2298. </row>
  2299. <row>
  2300. <entry>health</entry>
  2301. <entry>integer</entry>
  2302. <entry>&lt;health&gt; is the health of the station for
  2303. which this is an almanac. If it is non-zero, the station is
  2304. issuing suspect data and should not be used for fixes. The
  2305. ITU and RTCM104 standards differ about the mode detailed
  2306. interpretation of the &lt;health&gt; field and even about its
  2307. bit width.<!--
  2308. From itu p.9 just under the type7 msg figure:
  2309. *** Radiobeacon health:
  2310. 00 (0) Radiobeacon operation normal
  2311. 01 (1) No integrity monitor operating
  2312. 10 (2) No information available
  2313. 11 (3) Do not use this radiobeacon
  2314. RTCM104, in the other hand, makes it 3 bits wide.
  2315. The Sager documentation said health has the same meaning as in the header,
  2316. but this cannot be true unless the field is 3 bits wide.
  2317. --></entry>
  2318. </row>
  2319. <row>
  2320. <entry>station_id</entry>
  2321. <entry>integer</entry>
  2322. <entry>The id of the transmitter. This is not the same
  2323. as the reference id in the header, the latter being the id of
  2324. the reference receiver. <!-- John Sager noted: "However I know
  2325. of at least one station that gets it wrong." --></entry>
  2326. </row>
  2327. <row>
  2328. <entry>bitrate</entry>
  2329. <entry>integer</entry>
  2330. <entry>The transmitted bitrate.</entry>
  2331. </row>
  2332. </tbody>
  2333. </tgroup>
  2334. </table>
  2335. <para>Here's an example:</para>
  2336. <programlisting>
  2337. {"class":"RTCM2","type":9,"station_id":268,"zcount":252.6,
  2338. "seqnum":4,"length":5,"station_health":0,
  2339. "satellites":[
  2340. {"ident":13,"udre":0,"iod":3,"prc":-25.940,"rrc":0.066},
  2341. {"ident":2,"udre":0,"iod":73,"prc":0.920,"rrc":-0.080},
  2342. {"ident":8,"udre":0,"iod":22,"prc":23.820,"rrc":0.014}
  2343. ]}
  2344. </programlisting>
  2345. </refsect3>
  2346. <refsect3><title>Type 13: GPS Time of Week</title>
  2347. <para>Here are the payload members of a type 13 (Groumf Tramitter Parameters)
  2348. message:</para>
  2349. <table frame="all" pgwide="0"><title>Ground Transmitter Parameters</title>
  2350. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2351. <thead>
  2352. <row>
  2353. <entry>Name</entry>
  2354. <entry>Type</entry>
  2355. <entry>Description</entry>
  2356. </row>
  2357. </thead>
  2358. <tbody>
  2359. <row>
  2360. <entry>status</entry>
  2361. <entry>bool</entry>
  2362. <entry>If True, signals user to expect a type 16 explanatory
  2363. message associated with this station. Probably indicates some
  2364. sort of unusual event.</entry>
  2365. </row>
  2366. <row>
  2367. <entry>rangeflag</entry>
  2368. <entry>bool</entry>
  2369. <entry>If True, indicates that the estimated range is
  2370. different from that found in the type 7 message (which contains the
  2371. beacon's listed range). Generally indicates a range reduction due to
  2372. causes such as poor ionospheric conditions or reduced transmission
  2373. power.</entry>
  2374. </row>
  2375. <row>
  2376. <entry>lat</entry>
  2377. <entry>real</entry>
  2378. <entry>Degrees latitude, signed.
  2379. Positive is N, negative is S.</entry>
  2380. </row>
  2381. <row>
  2382. <entry>lon</entry>
  2383. <entry>real</entry>
  2384. <entry>Degrees longitude, signed.
  2385. Positive is E, negative is W.</entry>
  2386. </row>
  2387. <row>
  2388. <entry>range</entry>
  2389. <entry>integer</entry>
  2390. <entry>Transmission range in km (1-1024).</entry>
  2391. </row>
  2392. </tbody>
  2393. </tgroup>
  2394. </table>
  2395. <para>This message type replaces message type 3 (Reference Station Parameters)
  2396. in RTCM 2.3.</para>
  2397. </refsect3>
  2398. <refsect3><title>Type 14: GPS Time of Week</title>
  2399. <para>Here are the payload members of a type 14 (GPS Time of Week)
  2400. message:</para>
  2401. <table frame="all" pgwide="0"><title>Reference Station Parameters</title>
  2402. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2403. <thead>
  2404. <row>
  2405. <entry>Name</entry>
  2406. <entry>Type</entry>
  2407. <entry>Description</entry>
  2408. </row>
  2409. </thead>
  2410. <tbody>
  2411. <row>
  2412. <entry>week</entry>
  2413. <entry>integer</entry>
  2414. <entry>GPS week (0-123).</entry>
  2415. </row>
  2416. <row>
  2417. <entry>hour</entry>
  2418. <entry>integer</entry>
  2419. <entry>Hour of week (0-167).</entry>
  2420. </row>
  2421. <row>
  2422. <entry>leapsecs</entry>
  2423. <entry>integer</entry>
  2424. <entry>Leap Seconds (0-63).</entry>
  2425. </row>
  2426. </tbody>
  2427. </tgroup>
  2428. </table>
  2429. <para>Here's an example:</para>
  2430. <programlisting>
  2431. {"class":"RTCM2","type":14,"station_id":652,"zcount":1657.2,
  2432. "seqnum":3,"length":1,"station_health":6,"week":601,"hour":109,
  2433. "leapsecs":15}
  2434. </programlisting>
  2435. </refsect3>
  2436. <refsect3><title>Type 16: Special Message</title>
  2437. <table frame="all" pgwide="0"><title>Special Message</title>
  2438. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2439. <thead>
  2440. <row>
  2441. <entry>Name</entry>
  2442. <entry>Type</entry>
  2443. <entry>Description</entry>
  2444. </row>
  2445. </thead>
  2446. <tbody>
  2447. <row>
  2448. <entry>message</entry>
  2449. <entry>string</entry>
  2450. <entry>A text message sent by the beacon operator.</entry>
  2451. </row>
  2452. </tbody>
  2453. </tgroup>
  2454. </table>
  2455. </refsect3>
  2456. <refsect3><title>Type 31: Correction data</title>
  2457. <para>One or more GLONASS satellite objects follow the header for type
  2458. 1 or type 9 messages. Here is the format:</para>
  2459. <table frame="all" pgwide="0"><title>Satellite object</title>
  2460. <tgroup cols="3" align="left" colsep="1" rowsep="1">
  2461. <thead>
  2462. <row>
  2463. <entry>Name</entry>
  2464. <entry>Type</entry>
  2465. <entry>Description</entry>
  2466. </row>
  2467. </thead>
  2468. <tbody>
  2469. <row>
  2470. <entry>ident</entry>
  2471. <entry>integer</entry>
  2472. <entry>The PRN number of the satellite for which this is
  2473. correction data.</entry>
  2474. </row>
  2475. <row>
  2476. <entry>udre</entry>
  2477. <entry>integer</entry>
  2478. <entry>User Differential Range Error (0-3). See the
  2479. table following for values.</entry>
  2480. </row>
  2481. <row>
  2482. <entry>change</entry>
  2483. <entry>boolean</entry>
  2484. <entry>Change-of-ephemeris bit.</entry>
  2485. </row>
  2486. <row>
  2487. <entry>tod</entry>
  2488. <entry>uinteger</entry>
  2489. <entry>Count of 30-second periods since the top of the
  2490. hour.</entry>
  2491. </row>
  2492. <row>
  2493. <entry>prc</entry>
  2494. <entry>real</entry>
  2495. <entry>The pseudorange error in meters for this
  2496. satellite as measured by the beacon reference receiver at the
  2497. epoch indicated by the z_count in the parent
  2498. record.</entry>
  2499. </row>
  2500. <row>
  2501. <entry>rrc</entry>
  2502. <entry>real</entry>
  2503. <entry>The rate of change of pseudorange error in
  2504. meters/sec for this satellite as measured by the beacon
  2505. reference receiver at the epoch indicated by the z_count field
  2506. in the parent record. This is used to calculate pseudorange
  2507. errors at other epochs, if required by the GPS
  2508. receiver.</entry>
  2509. </row>
  2510. </tbody>
  2511. </tgroup>
  2512. </table>
  2513. <para>Here's an example:</para>
  2514. <programlisting>
  2515. {"class":"RTCM2","type":31,"station_id":652,"zcount":1642.2,
  2516. "seqnum":0,"length":14,"station_health":6,
  2517. "satellites":[
  2518. {"ident":5,"udre":0,"change":false,"tod":0,"prc":132.360,"rrc":0.000},
  2519. {"ident":15,"udre":0,"change":false,"tod":0,"prc":134.840,"rrc":0.002},
  2520. {"ident":14,"udre":0,"change":false,"tod":0,"prc":141.520,"rrc":0.000},
  2521. {"ident":6,"udre":0,"change":false,"tod":0,"prc":127.000,"rrc":0.000},
  2522. {"ident":21,"udre":0,"change":false,"tod":0,"prc":128.780,"rrc":0.000},
  2523. {"ident":22,"udre":0,"change":false,"tod":0,"prc":125.260,"rrc":0.002},
  2524. {"ident":20,"udre":0,"change":false,"tod":0,"prc":117.280,"rrc":-0.004},
  2525. {"ident":16,"udre":0,"change":false,"tod":17,"prc":113.460,"rrc":0.018}
  2526. ]}
  2527. </programlisting>
  2528. </refsect3>
  2529. </refsect2>
  2530. </refsect1>
  2531. <refsect1 id='dump-format3'><title>RTCM3 DUMP FORMAT</title>
  2532. <para>The support for RTCM104v3 dumping is incomplete and buggy. Do not
  2533. attempt to use it for production! Anyone interested in it should read
  2534. the source code.</para>
  2535. </refsect1>
  2536. <refsect1 id='ais'><title>AIS DUMP FORMATS</title>
  2537. <para>AIS support is an extension. It may not be present if your
  2538. instance of <application>gpsd</application> has been built with
  2539. a restricted feature set.</para>
  2540. <para>AIS packets are dumped as JSON objects with class "AIS". Each
  2541. AIS report object contains a "type" field giving the AIS message type
  2542. and a "scaled" field telling whether the remainder of the fields are
  2543. dumped in scaled or unscaled form. (These will be emitted before any
  2544. type-specific fields.) It will also contain a "device" field naming
  2545. the data source. Other fields have names and types as specified in
  2546. the <citetitle>AIVDM/AIVDO Protocol Decoding</citetitle> document on
  2547. the GPSD project website; each message field table may be directly
  2548. interpreted as a specification for the members of the corresponding
  2549. JSON object type.</para>
  2550. <para>By default, certain scaling and conversion operations are
  2551. performed for JSON output. Latitudes and longitudes are scaled to
  2552. decimal degrees rather than the native AIS unit of 1/10000th of a
  2553. minute of arc. Ship (but not air) speeds are scaled to knots rather
  2554. than tenth-of-knot units. Rate of turn may appear as "nan" if is
  2555. unavailable, or as one of the strings "fastright" or "fastleft" if it
  2556. is out of the AIS encoding range; otherwise it is quadratically mapped
  2557. back to the turn sensor number in degrees per minute. Vessel draughts
  2558. are converted to decimal meters rather than native AIS
  2559. decimeters. Various other scaling conversions are described in
  2560. <citetitle>"AIVDM/AIVDO Protocol Decoding"</citetitle>.</para>
  2561. </refsect1>
  2562. <refsect1 id='subframe'><title>SUBFRAME DUMP FORMATS</title>
  2563. <para>Subframe support is always compiled into
  2564. <application>gpsd</application> but many GPSes do not output subframe data
  2565. or the <application>gpsd</application> driver may not support subframes.
  2566. </para>
  2567. <para>Subframe packets are dumped as JSON objects with class "SUBFRAME".
  2568. Each subframe report object contains a "frame" field giving the subframe
  2569. number, a "tSV" field for the transmitting satellite number, a "TOW17"
  2570. field containing the 17 MSBs of the start of the next 12-second message
  2571. and a "scaled" field telling whether the remainder of the fields are
  2572. dumped in scaled or unscaled form. It will also contain a "device" field
  2573. naming the data source. Each SUBFRAME object will have a sub-object
  2574. specific to that subframe page type. Those sub-object fields have names
  2575. and types similar to those specified in the IS-GPS-200E document; each
  2576. message field table may be directly interpreted as a specification for
  2577. the members of the corresponding JSON object type.</para>
  2578. </refsect1>
  2579. <refsect1 id='see_also'><title>SEE ALSO</title>
  2580. <para>
  2581. <citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum>
  2582. </citerefentry>,
  2583. <citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum>
  2584. </citerefentry>,
  2585. </para>
  2586. </refsect1>
  2587. <refsect1 id='maintainer'><title>AUTHOR</title>
  2588. <para>The protocol was designed and documented by Eric S. Raymond.</para>
  2589. </refsect1>
  2590. </refentry>