summaryrefslogtreecommitdiff
path: root/doc/explan_ntpshm.c.xml
blob: 88ff86deb72d1ab3c20b9c9b2a8500ba75e16b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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>