Devuan fork of gpsd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.8 KiB

  1. <sect1 id="isgps.c"><title><filename>isgps.c</filename></title>
  2. <informaltable frame='all' pgwide='1'>
  3. <tgroup cols='2'>
  4. <colspec colname='c1'></colspec>
  5. <colspec colname='c2'></colspec>
  6. <spanspec spanname='s1' namest='c1' nameend='c2'></spanspec>
  7. <thead>
  8. <row>
  9. <entry>Functions:-</entry><entry>This contains low level handling
  10. for the data transmission format of the satellite downlink and the
  11. RTCM2 radio data stream. ESR comments <quote>You are not expected to
  12. understand any of this.</quote>. Let's try anyhow.</entry>
  13. </row>
  14. </thead>
  15. <tfoot>
  16. <row>
  17. <entry spanname='s1' align='left'>Notes based on code as of Mon Apr 5 21:38:06 2010 -0400.</entry>
  18. </row>
  19. </tfoot>
  20. <tbody>
  21. <row>
  22. <entry><function>static unsigned char parity_array[]</function></entry>
  23. <entry><para>An array of parity values to allow fast lookup instead of calculation.</para></entry>
  24. </row>
  25. <row>
  26. <entry><function>static unsigned int reverse_bits[]</function></entry>
  27. <entry><para>An array of conversion values to allow fast lookup instead of calculation.</para></entry>
  28. </row>
  29. <row>
  30. <entry><function>unsigned int isgps_parity(isgps30bits_t th)</function></entry>
  31. <entry><para>Calculate the ISGPS parity for the incoming 30 bit
  32. word. This involves lots of masking (with preset values or values
  33. searched through <function>parity_array[]</function>) and
  34. shifting</para></entry>
  35. </row>
  36. <row>
  37. <entry><function>void isgps_init(struct gps_packet_t *session)</function></entry>
  38. <entry><para>Initialise the ISGPS data for the current session.</para></entry>
  39. </row>
  40. <row>
  41. <entry><function>enum isgpsstat_t isgps_decode(struct gps_packet_t *session, bool (*preamble_match)(isgps30bits_t *), bool (*length_check)(struct gps_packet_t *), size_t maxlen, unsigned int c)</function></entry>
  42. <entry><para>Check the validity of the ISGPS word tag (incoming data
  43. <function>unsigned int c</function>) and exit with an error if it is
  44. not valid.</para><para>If the session has not already locked with
  45. the datastream, loop through the data and try and sync up. If sync
  46. is achieved, exit early with an indication of sync, or fall through
  47. still marked unsynced.</para><para>If the session is already locked
  48. to the datastream, read the data into the session buffer. All the
  49. while, take care that the datastream is not corrupted. Any error
  50. will result in an early return with an appropriate error code. At
  51. the end of this section, return the status of the
  52. operations.</para><para>Finally, if the above two sections failed,
  53. exit with an error indicating that lock was not
  54. achieved.</para></entry>
  55. </row>
  56. <row>
  57. <entry><function>void isgps_output_magnavox(isgps30bits_t *ip, unsigned int len, FILE *fp)</function></entry>
  58. <entry><para>Ship an IS-GPS-200 message to standard output in Magnavox format.</para></entry>
  59. </row>
  60. </tbody>
  61. </tgroup>
  62. </informaltable>
  63. </sect1>