summaryrefslogtreecommitdiff
path: root/doc/explan_ntpshm.c.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/explan_ntpshm.c.xml')
-rw-r--r--doc/explan_ntpshm.c.xml49
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/explan_ntpshm.c.xml b/doc/explan_ntpshm.c.xml
new file mode 100644
index 00000000..88ff86de
--- /dev/null
+++ b/doc/explan_ntpshm.c.xml
@@ -0,0 +1,49 @@
+<sect1 id="ntpshm.c"><title><filename>ntpshm.c</filename></title>
+<informaltable frame='all' pgwide='1'>
+<tgroup cols='2'>
+<colspec colname='c1'></colspec>
+<colspec colname='c2'></colspec>
+<spanspec spanname='s1' namest='c1' nameend='c2'></spanspec>
+
+<thead>
+<row>
+ <entry>Functions:-</entry><entry>This puts time information into a shared memory segment for the ntp daemon to use.</entry>
+</row>
+</thead>
+
+<tbody>
+<row>
+ <entry><function>static struct shmTime *getShmTime(int unit)</function></entry>
+ <entry><para>This requests a block of shared memory to communicate to the ntp daemon. It returns a pointer to the memory on success or NULL on failure.</para></entry>
+</row>
+<row>
+ <entry><function>void ntpshm_init(struct gps_context_t *context, bool enablepps)</function></entry>
+ <entry><para>Attaches all ntp shared memeory segments.</para></entry>
+</row>
+<row>
+ <entry><function>int ntpshm_alloc(struct gps_context_t *context)</function></entry>
+ <entry><para>This allocates a free ntp shared memory segment.</para><para>If one is available, initialise it for use and flag it as in use.</para><para>Returns the segment number on success or -1 on failure.</para></entry>
+</row>
+<row>
+ <entry><function>bool ntpshm_free(struct gps_context_t *context, int segment)</function></entry>
+ <entry><para>This releases a previously allocated ntp shared memory segment. Indicates the outcome by returning true (success) or false.</para></entry>
+</row>
+<row>
+ <entry><function>int ntpshm_put(struct gps_device_t *session, double fixtime)</function></entry>
+ <entry><para>If the shared memory index allocated to the session is valid and the <function>shmTime</function> structure of the session is valid, store the time of the fix.</para><para>Success is indicated by a return value of 1 and errors are indicated by a return value of 0.</para></entry>
+</row>
+<row>
+ <entry><function>int ntpshm_pps(struct gps_device_t *session, struct timeval *tv)</function></entry>
+ <entry><para>Only available if the 1PPS function is compiled in.</para><para>Checks if the shared memory structures are valid. If so, it validates that the time received is within the locking range.</para><para>If good, the time is stored in the shared memory.</para><para>A return value of 1 indicates successful update; 0 indicates there is a problem with the shared memory structures and -1 indicates that the time could not be locked to.</para></entry>
+</row>
+</tbody>
+
+<tfoot>
+<row>
+ <entry spanname='s1' align='left'>Notes based on <function>$Id: ntpshm.c 3771 2006-11-02 05:15:20Z esr $</function></entry>
+</row>
+</tfoot>
+
+</tgroup>
+</informaltable>
+</sect1>