⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpslib.htm

📁 在你的应用程序中添加对GPS(全球定位系统)的支持
💻 HTM
📖 第 1 页 / 共 3 页
字号:

<p><font face="Arial"><em>lpszEntry</em> The name of the GPS device to retrieve settings
for.<br>
<em>IpGpsDevInfo </em>Pointer to a <a href="#GPSDEVINFO">GPSDEVINFO</a> structure which
will be filled in upon return from this function.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Retrieves the settings for a specified GPS device given its name. If
lpszEntry is set to NULL, then the settings for the default GPS receiver will be
retrieved.</font></p>

<p class="crt"><font face="Arial"><strong>See Also</strong></font></p>

<p><font face="Arial"><a href="#GpsSetDevice">GpsSetDevice</a>, <a href="#GpsEnumDevices">GpsEnumDevices</a>,
<a href="#GPSDEVINFO">GPSDEVINFO</a></font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><a name="GpsSetDevice"></a><big><strong>GpsSetDevice</strong></big></font></p>

<p><font face="Arial">BOOL GpsSetDevice(LPCTSTR lpszEntry, LPCGPSDEVINFO <em>lpGpsDevInfo</em>);</font></p>

<p><font face="Arial"><strong>Return Value</strong></font></p>

<p><font face="Arial">TRUE if the device settings were successfully updated otherwise
FALSE.</font></p>

<p><font face="Arial"><strong>Parameters</strong></font></p>

<p><font face="Arial"><em>lpszEntry</em> The name of the GPS device to update settings
for.<br>
<em>IpGpsDevInfo </em>Pointer to a constant <a href="#GPSDEVINFO">GPSDEVINFO</a> structure
which contains the parameters to update.</font></p>

<p><font face="Arial"><strong>Remarks</strong></font></p>

<p><font face="Arial">Updates the settings for a specified GPS device given its name. You
would normally call <a href="#GpsGetDevice">GpsGetDevice</a> prior to calling this
function to ensure that <em>lpGpsDevInfo </em>contains valid members.</font></p>

<p class="crt"><font face="Arial"><strong>See Also</strong></font></p>

<p><font face="Arial"><a href="#GpsGetDevice">GpsGetDevice</a>, <a href="#GpsEnumDevices">GpsEnumDevices</a>,
<a href="#GPSDEVINFO">GPSDEVINFO</a></font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p class="crt"><font face="Arial"><big><a name="structures"></a><font class="MissingLink"
meta="_WIN32_SetWindowText"><big><strong>Structures used by GPSLIB</strong></big></font></big></font></p>

<p class="crt">&nbsp;</p>

<p class="crt"><font face="Arial"><a name="GPSDEVINFO"></a><font class="MissingLink"
meta="_WIN32_SetWindowText"><strong>GPSDEVINFO Structure</strong></font></font></p>

<p class="crt"><font face="Arial">typedef struct tagGPSDEVINFO<br>
{<br>
&nbsp;&nbsp;&nbsp; TCHAR szDeviceName[ GPS_MaxDeviceName + 1 ];<br>
&nbsp;&nbsp;&nbsp; BOOL bDefaultReceiver;<br>
&nbsp;&nbsp;&nbsp; WORD wCommPort;<br>
&nbsp;&nbsp;&nbsp; DWORD dwCommBaudRate;<br>
&nbsp;&nbsp;&nbsp; WORD wCommDataBits;<br>
&nbsp;&nbsp;&nbsp; WORD wCommParity;<br>
&nbsp;&nbsp;&nbsp; WORD wCommStopBits;<br>
} GPSDEVINFO;</font></p>

<p class="crt"><font face="Arial">The <span class="op">GPSDEVINFO</span> structure
represents a GPS receivers device properties. </font></p>

<p class="crt">&nbsp;</p>

<p class="crt"><font face="Arial"><strong>Members</strong></font></p>

<table width="563">
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>szDeviceName</strong></font></td>
    <td width="423"><font face="Arial">The name of the GPS Device</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>bDefaultReceiver</strong></font></td>
    <td width="423"><font face="Arial">TRUE if this device is the default receiver else FALSE</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wCommPort</strong></font></td>
    <td width="423"><font face="Arial">The serial communications port this GPS receiver is
    connected to</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwCommBaudRate</strong></font></td>
    <td width="423"><font face="Arial">The baud rate used to connect to this device.</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wCommDataBits</strong></font></td>
    <td width="423"><font face="Arial">Data bits of the comms port used to connect to this
    device</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wCommParity</strong></font></td>
    <td width="423"><font face="Arial">Enum of the type of parity used to connect to this
    device. This member is one of the following enums:</font><p><font face="Arial"><em>GpsParityNone</em><br>
    <em>GpsParityOdd</em><br>
    <em>GpsParityEven</em><br>
    <em>GpsParityMark</em><br>
    <em>GpsParitySpace</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wCommStopBits</strong></font></td>
    <td width="423"><font face="Arial">Enum of the stop bits used to connect to this device.
    This member is one of the following enums:</font><p><font face="Arial"><em>GpsStopBits1</em><br>
    <em>GpsStopBits1Point5</em><br>
    <em>GpsStopBits2</em></font></td>
  </tr>
</table>

<p class="crt"><font face="Arial"><strong>See Also</strong></font></p>

<p class="crt"><font face="Arial"><a href="#GpsEnumDevices">GpsEnumDevices</a></font></p>

<p class="crt">&nbsp;</p>

<p class="crt"><font face="Arial"><a name="GPSPOSITION"></a><strong>GPSPOSITION Structure</strong></font></p>

<p class="crt"><font face="Arial">typedef struct tagGPSPOSITION<br>
{<br>
&nbsp;&nbsp;&nbsp; BOOL bNorthing;<br>
&nbsp;&nbsp;&nbsp; DWORD dwLatitude;<br>
&nbsp;&nbsp;&nbsp; BOOL bEasting;<br>
&nbsp;&nbsp;&nbsp; DWORD dwLongitude;<br>
&nbsp;&nbsp;&nbsp; DWORD dwBearing;<br>
&nbsp;&nbsp;&nbsp; DWORD dwSpeed;<br>
&nbsp;&nbsp;&nbsp; WORD wFixYear;<br>
&nbsp;&nbsp;&nbsp; WORD wFixMonth;<br>
&nbsp;&nbsp;&nbsp; WORD wFixDay;<br>
&nbsp;&nbsp;&nbsp; WORD wFixHour;<br>
&nbsp;&nbsp;&nbsp; WORD wFixMinute;<br>
&nbsp;&nbsp;&nbsp; WORD wFixSecond;<br>
&nbsp;&nbsp;&nbsp; WORD nSatellites;<br>
&nbsp;&nbsp;&nbsp; DWORD dwAntennaAltitude;<br>
&nbsp;&nbsp;&nbsp; WORD wQualityIndicator;<br>
} GPSPOSITION; <br>
</font></p>

<p class="crt"><font face="Arial"><strong>Members</strong></font></p>

<table width="563">
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>bNorthing</strong></font></td>
    <td width="423"><font face="Arial">TRUE if reported position is north of the equator else
    FALSE. </font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwLatitude</strong></font></td>
    <td width="423"><font face="Arial">Latitude of the reported position in hundredths of
    seconds of a degree. This value along with bNorthing is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>bEasting</strong></font></td>
    <td width="423"><font face="Arial">TRUE if reported position is east of the Greenwich
    Prime Meridian else FALSE</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwLongitude</strong></font></td>
    <td width="423"><font face="Arial">Longitude in hundredths of seconds of a degree. This
    value along with bEasting is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwBearing</strong></font></td>
    <td width="423"><font face="Arial">The bearing in hundredths of degrees East of North.
    This value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em>. This corresponds
    to the compass direction in which the receiver is travelling.</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwSpeed</strong></font></td>
    <td width="423"><font face="Arial">Speed in Centimeters / Hour. This value is retrieved
    from the NMEA command <em>&quot;GPRMC&quot;</em>. This corresponds to the speed at which
    the receiver is travelling.</font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixYear</strong></font></td>
    <td width="423"><font face="Arial">The year in which the GPS location fix was taken. This
    value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixMonth</strong></font></td>
    <td width="423"><font face="Arial">The month in which the GPS location fix was taken. This
    value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixDay</strong></font></td>
    <td width="423"><font face="Arial">The day in which the GPS location fix was taken. This
    value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixHour</strong></font></td>
    <td width="423"><font face="Arial">The hour in which the GPS location fix was taken. This
    value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixMinute</strong></font></td>
    <td width="423"><font face="Arial">The minute in which the GPS location fix was taken.
    This value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wFixSecond</strong></font></td>
    <td width="423"><font face="Arial">The second in which the GPS location fix was taken.
    This value is retrieved from the NMEA command <em>&quot;GPRMC&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>nSatellites</strong>&nbsp; </font></td>
    <td width="423"><font face="Arial">The number of satellites in view. This value is
    retrieved from the NMEA command <em>&quot;GPGGA&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>dwAntennaAltitude</strong></font></td>
    <td width="423"><font face="Arial">Altitude of the receiver in Centimeters above mean sea
    level. This value is retrieved from the NMEA command <em>&quot;GPGGA&quot;</em></font></td>
  </tr>
  <tr>
    <td width="132" valign="top"><font face="Arial"><strong>wQualityIndicator</strong></font></td>
    <td width="423"><font face="Arial">Enum of the GPS Quality Indicator. This value is
    retrieved from the NMEA command <em>&quot;GPGGA&quot;</em>. This member is one of the
    following enums: </font><p><font face="Arial"><em>GpsQualityFixNotAvailable</em><br>
    <em>GpsQualityFix</em><br>
    <em>GpsQualityDifferentialFix</em></font></td>
  </tr>
</table>

<p class="crt">&nbsp;</p>

<p class="crt">&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><a name="Shareware"></a><font color="#000000" size="4"><strong>SHAREWARE
NOTICE:</strong></font></font></p>

<p><font color="#000000" size="3" face="Arial">GPSLIB is shareware and this trial version
is a fully functional evaluation copy. This means that you are free to evaluate GPSLIB for
up to 30 days. After this period if you are still using GPSLIB and/or wish to include it
in a project of yours, then you are legally obliged to register GPSLIB with the author.
Registration will entitle you to comprehensive email support from the author. The cost is
$20 US dollars. I do not support online registration for this product yet so you must
register via normal post. Remember to include your email address in your letter so that I
can quickly confirm receipt of your registration. Payment should be made by cheque and be
made out to:</font></p>

<address>
  <font color="#000000" size="3" face="Arial">PJ Naughter,<br>
  Cahore,<br>
  Ballygarrett,<br>
  Gorey,<br>
  Co. Wexford.<br>
  </font>
</address>

<p><font color="#000000" size="3" face="Arial">The registration fee is very small and its
a great incentive for me to keep improving GPSLIB. Once I have received the registration
you are entitled to unlimted email support for GPSLIB.</font></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><big><a name="Enhancements"></a></big><font color="#000000" size="4"><strong>PLANNED
ENHANCEMENTS</strong></font> </font>

<ul>
  <li><font color="#000000" size="3" face="Arial">Provide a prebuilt &quot;GPS.BAS&quot; file
    to allow Visual Basic developers to start developing with GPSLIB without them having to
    &quot;Declare&quot; the GPSLIB functions, enums and structures themselves.</font></li>
  <li><font color="#000000" size="3" face="Arial">Provide an MFC wrapper class to provide a
    C++ interface to GPSL</font><font face="Arial"><font size="3"><font color="#000000">IB</font></font><big>.</big></font></li>
  <li><font color="#000000" size="3" face="Arial">Remove dependency of GPSLIB control panel
    applet upon MFC. This should help reduce the size of it significantly.</font></li>
  <li><font color="#000000" size="3" face="Arial">Rebase the GPSLIB DLLs to improve the load
    time of client applications.</font></li>
  <li><font color="#000000" size="3" face="Arial">Provide support for multiple client
    applications using the same GPS device at the same time. An interesting technical
    challenge which will require development of a framework similar to the way TAPI is
    implemented.</font></li>
  <li><font color="#000000" size="3" face="Arial">If you have any other suggested improvements
    for GPSLIB, please let me know so that I can incorporate them into the next release of
    GPSLIB.</font></li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><font face="Arial"><a name="Contact"></a><font color="#000000" size="4"><strong>CONTACTING
THE AUTHOR</strong></font></font></p>

<p><font color="#000000" size="3" face="Arial">PJ Naughter<br>
Email: <a href="mailto:pjn@indigo..ie">pjn@indigo.ie</a><br>
Web: <a href="http://indigo.ie/~pjn">http://indigo.ie/~pjn</a><br>
26th August 1998<br>
</font></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -