gpsd_json.xml 83 KB

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