driver28.html revision 182007
1132451Sroberto<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2132451Sroberto 3132451Sroberto<html> 4132451Sroberto 5132451Sroberto <head> 6132451Sroberto <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 7132451Sroberto <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> 8132451Sroberto <title>Shared memoy Driver</title> 9182007Sroberto <link href="scripts/style.css" type="text/css" rel="stylesheet"> 10132451Sroberto </head> 11132451Sroberto 12132451Sroberto <body> 13132451Sroberto <h3>Shared Memory Driver</h3> 14132451Sroberto <hr> 15132451Sroberto <h4>Synopsis</h4> 16132451Sroberto <p>Address: 127.127.28.<i>u</i><br> 17132451Sroberto Reference ID: <tt>SHM</tt><br> 18132451Sroberto Driver ID: <tt>SHM</tt></p> 19132451Sroberto <h4>Description</h4> 20132451Sroberto <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> 21132451Sroberto <h4>Structure of shared memory-segment</h4> 22132451Sroberto <pre>struct shmTime { 23132451Sroberto int mode; /* 0 - if valid set 24132451Sroberto * use values, 25132451Sroberto * clear valid 26132451Sroberto * 1 - if valid set 27132451Sroberto * if count before and after read of 28132451Sroberto * values is equal, 29132451Sroberto * use values 30132451Sroberto * clear valid 31132451Sroberto */ 32132451Sroberto int count; 33132451Sroberto time_t clockTimeStampSec; /* external clock */ 34132451Sroberto int clockTimeStampUSec; /* external clock */ 35132451Sroberto time_t receiveTimeStampSec; /* internal clock, when external value was received */ 36132451Sroberto int receiveTimeStampUSec; /* internal clock, when external value was received */ 37132451Sroberto int leap; 38132451Sroberto int precision; 39132451Sroberto int nsamples; 40132451Sroberto int valid; 41132451Sroberto int dummy[10]; 42132451Sroberto};</pre> 43132451Sroberto <h4>Operation mode=0</h4> 44132451Sroberto <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 45132451Sroberto <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> 46132451Sroberto <p>If not set, a timeout is reported to ntp, nothing else happend</p> 47132451Sroberto <h4>Operation mode=1</h4> 48132451Sroberto <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 49132451Sroberto <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> 50132451Sroberto <p>If not set, a timeout is reported to ntp, nothing else happend</p> 51132451Sroberto <h4>Fudge Factors</h4> 52132451Sroberto <dl> 53132451Sroberto <dt><tt>time1 <i>time</i></tt> 54132451Sroberto <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. 55132451Sroberto <dt><tt>time2 <i>time</i></tt> 56132451Sroberto <dd>Not used by this driver. 57132451Sroberto <dt><tt>stratum <i>number</i></tt> 58132451Sroberto <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. 59132451Sroberto <dt><tt>refid <i>string</i></tt> 60132451Sroberto <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>SHM</tt>. 61132451Sroberto <dt><tt>flag1 0 | 1</tt> 62132451Sroberto <dd>Not used by this driver. 63132451Sroberto <dt><tt>flag2 0 | 1</tt> 64132451Sroberto <dd>Not used by this driver. 65132451Sroberto <dt><tt>flag3 0 | 1</tt> 66132451Sroberto <dd>Not used by this driver. 67132451Sroberto <dt><tt>flag4 0 | 1</tt> 68132451Sroberto <dd>Not used by this driver. 69132451Sroberto <h4>Additional Information</h4> 70132451Sroberto <p><a href="../refclock.html">Reference Clock Drivers</a></p> 71132451Sroberto </dl> 72132451Sroberto <hr> 73182007Sroberto <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 74132451Sroberto </body> 75132451Sroberto 76132451Sroberto</html>