driver28.html revision 132452
1131036Snjl<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2131036Snjl 3131036Snjl<html> 4131036Snjl 5131036Snjl <head> 6131036Snjl <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 7131036Snjl <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> 8131036Snjl <title>Shared memoy Driver</title> 9131036Snjl <link href="../scripts/style.css" type="text/css" rel="stylesheet"> 10131036Snjl </head> 11131036Snjl 12131036Snjl <body> 13131036Snjl <h3>Shared Memory Driver</h3> 14131036Snjl <hr> 15131036Snjl <h4>Synopsis</h4> 16131036Snjl <p>Address: 127.127.28.<i>u</i><br> 17131036Snjl Reference ID: <tt>SHM</tt><br> 18131036Snjl Driver ID: <tt>SHM</tt></p> 19131036Snjl <h4>Description</h4> 20131036Snjl <p>This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3</p> 21131036Snjl <h4>Structure of shared memory-segment</h4> 22131036Snjl <pre>struct shmTime { 23131036Snjl int mode; /* 0 - if valid set 24131036Snjl * use values, 25131036Snjl * clear valid 26131036Snjl * 1 - if valid set 27131036Snjl * if count before and after read of 28131036Snjl * values is equal, 29131036Snjl * use values 30131036Snjl * clear valid 31131036Snjl */ 32131036Snjl int count; 33131036Snjl time_t clockTimeStampSec; /* external clock */ 34131036Snjl int clockTimeStampUSec; /* external clock */ 35131036Snjl time_t receiveTimeStampSec; /* internal clock, when external value was received */ 36131036Snjl int receiveTimeStampUSec; /* internal clock, when external value was received */ 37131036Snjl int leap; 38131036Snjl int precision; 39131036Snjl int nsamples; 40131036Snjl int valid; 41131036Snjl int dummy[10]; 42131036Snjl};</pre> 43131036Snjl <h4>Operation mode=0</h4> 44131036Snjl <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 45131036Snjl <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and the valid-flag is cleared.</p> 46131036Snjl <p>If not set, a timeout is reported to ntp, nothing else happend</p> 47131036Snjl <h4>Operation mode=1</h4> 48131036Snjl <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 49131036Snjl <p>If set, the count-field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered count is compared to the count now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The valid flag is cleared.</p> 50131036Snjl <p>If not set, a timeout is reported to ntp, nothing else happend</p> 51131036Snjl <h4>Fudge Factors</h4> 52131036Snjl <dl> 53131036Snjl <dt><tt>time1 <i>time</i></tt> 54131036Snjl <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. 55131036Snjl <dt><tt>time2 <i>time</i></tt> 56136270Snjl <dd>Not used by this driver. 57136270Snjl <dt><tt>stratum <i>number</i></tt> 58136270Snjl <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. 59136270Snjl <dt><tt>refid <i>string</i></tt> 60131036Snjl <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>SHM</tt>. 61131036Snjl <dt><tt>flag1 0 | 1</tt> 62131036Snjl <dd>Not used by this driver. 63136270Snjl <dt><tt>flag2 0 | 1</tt> 64131036Snjl <dd>Not used by this driver. 65131036Snjl <dt><tt>flag3 0 | 1</tt> 66131036Snjl <dd>Not used by this driver. 67131036Snjl <dt><tt>flag4 0 | 1</tt> 68131036Snjl <dd>Not used by this driver. 69131036Snjl <h4>Additional Information</h4> 70131036Snjl <p><a href="../refclock.html">Reference Clock Drivers</a></p> 71131036Snjl </dl> 72131036Snjl <hr> 73131036Snjl <script type="text/javascript" language="javascript" src="../scripts/footer.txt"></script> 74131036Snjl </body> 75131036Snjl 76131036Snjl</html>