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

📄 wgps.h

📁 自己做的基于PPC2003的GPS信号接收程序
💻 H
📖 第 1 页 / 共 2 页
字号:
//   rgdwSatellitesInViewSignalToNoiseRatio 
//     Signal to noise ratio of the satellites in view of the GPS hardware. Higher numbers indicate greater 
//     signal strength. 
//
//  Remarks:
//    The majority of the fields in this structure are translations from the fields defined by the NMEA. 
//    For more information about NMEA standard, including additional description of the nature of the fields, 
//    see this NMEA Web site.
typedef struct _GPS_POSITION {
   DWORD dwVersion;					// Be used.
   DWORD dwSize;
   DWORD dwValidFields;				// Be used.
   DWORD dwFlags;					// Be used.
   SYSTEMTIME stUTCTime;			// Be used.
   double dblLatitude;				// Be used.
   double dblLongitude;				// Be used.
   float  flSpeed;					// Be used.
   float  flHeading;				// Be used.
   double dblMagneticVariation;		// Be used.
   float  flAltitudeWRTSeaLevel;
   float  flAltitudeWRTEllipsoid;
   GPS_FIX_QUALITY     FixQuality;
   GPS_FIX_TYPE        FixType;
   GPS_FIX_SELECTION   SelectionType;
   float flPositionDilutionOfPrecision;
   float flHorizontalDilutionOfPrecision;
   float flVerticalDilutionOfPrecision;
   DWORD dwSatelliteCount;
   DWORD rgdwSatellitesUsedPRNs[GPS_MAX_SATELLITES];
   DWORD dwSatellitesInView;
   DWORD rgdwSatellitesInViewPRNs[GPS_MAX_SATELLITES];
   DWORD rgdwSatellitesInViewElevation[GPS_MAX_SATELLITES];
   DWORD rgdwSatellitesInViewAzimuth[GPS_MAX_SATELLITES];
   DWORD rgdwSatellitesInViewSignalToNoiseRatio[GPS_MAX_SATELLITES];
} GPS_POSITION, *PGPS_POSITION;

// Contains information about the GPS Intermediate Driver and GPS hardware used by the GPS Intermediate Driver.
//
// Members:
//   dwVersion 
//     Version of the GPS Intermediate Driver expected by the application. Must be set before the structure is 
//     passed to GPSGetDeviceState. Must be GPS_VERSION_1. 
//   dwSize 
//     Size of the structure, in bytes. Must be set before the structure is passed to GPSGetDeviceState. 
//   dwServiceState 
//     State of the GPS Intermediate Driver. Contains one of the SERVICE_STATE values defined IOCTL_SERVICE_STATUS. 
//   dwDeviceState 
//     State of the driver controlling the GPS hardware. Contains one of the SERVICE_STATE values defined 
//     in IOCTL_SERVICE_STATUS. 
//   ftLastDataReceived 
//     Most recent time the GPS Intermediate Driver received information from the GPS hardware. This time is based 
//     on UTC according to the local system clock, not the clock information used by GPS satellites. 
//   szGPSDriverPrefix 
//     Prefix string used to open the GPS hardware. This entry is defined by the CommPort registry entry for hardware 
//     that connects through a serial (or virtual serial) interface. This entry is empty when the GPS Intermediate 
//     Driver reads information from static files. For more information about GPS hardware registry settings, 
//     see GPS Intermediate Driver GPS Hardware Registry Settings. 
//   szGPSMultiplexPrefix 
//     Prefix string used to open the GPS Intermediate Driver multiplexer. This entry is defined by 
//     the DriverInterface registry entry in the Multiplexer key. For more information about multiplexer registry settings, 
//     see GPS Intermediate Driver Multiplexer Registry Settings. 
//     For more information about accessing data using the GPS Intermediate Driver multiplexer, see Accessing Raw GPS Data. 
//   szGPSFriendlyName 
//     Friendly name of the GPS hardware currently used by the GPS Intermediate Driver. This entry is defined by 
//     the FriendlyName registry entry. For more information about this registry entry, see GPS Intermediate Driver Input 
//     Source Registry Settings. 
typedef struct _GPS_DEVICE {
   DWORD    dwVersion;				// Be used.
   DWORD    dwSize;
   DWORD    dwServiceState;
   DWORD    dwDeviceState;			// Be used.
   FILETIME ftLastDataReceived;		// Be used.
   WCHAR    szGPSDriverPrefix[GPS_MAX_PREFIX_NAME];
   WCHAR    szGPSMultiplexPrefix[GPS_MAX_PREFIX_NAME];
   WCHAR    szGPSFriendlyName[GPS_MAX_FRIENDLY_NAME];
} *PGPS_DEVICE, GPS_DEVICE;

//
//  FUNCTION: GPSOpenDevice()
//
//  PURPOSE: Creates a connection to the GPS Intermediate Driver.
//
//  COMMENTS: 
//
//  Parameters:
//    hNewLocationData 
//      Handle to a Windows CE event created using CreateEvent, or NULL. 
//      The GPS Intermediate Driver signals the passed event whenever it has new GPS location information. 
//    hDeviceStateChange 
//      Handle to a Windows CE event created using CreateEvent, or NULL. 
//      The GPS Intermediate Driver signals the passed event whenever the state of the device changes. 
//    szDeviceName 
//      Reserved. Must be NULL. 
//    dwFlags 
//      Reserved. Must be 0. 
//
//  Return Values:
//    If successful, returns a handle to the GPS Intermediate Driver. 
//    If unsuccessful, returns NULL. 
//
HANDLE GPSOpenDevice(HANDLE hNewLocationData, HANDLE hDeviceStateChange, const WCHAR *szDeviceName, DWORD dwFlags);

//
//  FUNCTION: GPSGetPosition()
//
//  PURPOSE: Retrieves location information, including latitude and longitude.
//
//  COMMENTS: 
//
//  Parameters:
//    hGPSDevice 
//      Handle returned by a call to GPSOpenDevice. 
//      This parameter can also be NULL. If NULL, the GPS Intermediate Driver does not turn on the GPS hardware, 
//      but does return data if the data has already been received (through some other use of the GPS 
//      Intermediate Driver), and the data satisfies the criteria set by the dwMaximumAge parameter. 
//      Passing NULL enables applications that can use location information, but do not require it, 
//      to retrieve existing data without requiring that the GPS hardware consume power. 
//    pGPSPosition 
//      Pointer to a GPS_POSITION structure. On return, this structure is filled with location data 
//      obtained by the GPS Intermediate Driver. The dwValidFields member of the GPS_POSITION instance 
//      specifies which fields of the instance are valid. 
//    dwMaximumAge 
//      Maximum age, in milliseconds, of location information. The GPS Intermediate Driver only returns 
//      information that has been received within the time specified by this parameter. 
//      Any information that is older than this age is not returned. The elements of the GPS_POSITION 
//      instance that are valid for the given dwMaximumAge value are specified in the dwValidFields 
//      element of the instance. 
//    dwFlags 
//      Reserved. Must be 0. 
//
//  Return Values:
//    If successful, returns ERROR_SUCCESS. 
//    If unsuccessful, returns an error code.
//
DWORD GPSGetPosition(HANDLE hGPSDevice, GPS_POSITION *pGPSPosition, DWORD dwMaximumAge, DWORD dwFlags);

//
//  FUNCTION: GPSGetDeviceState()
//
//  PURPOSE: Retrieves information about the current state of the GPS hardware.
//
//  COMMENTS: 
//
//  Parameters:
//    pGPSDevice 
//      Pointer to a GPS_DEVICE structure. On return, this structure is filled with 
//      device data for the GPS hardware managed by the GPS Intermediate Driver. 

//  Return Values:
//    If successful, returns ERROR_SUCCESS. 
//    If unsuccessful, returns an error code.
//
DWORD GPSGetDeviceState(GPS_DEVICE *pGPSDe);

//
//  FUNCTION: GPSCloseDevice()
//
//  PURPOSE: Closes the connection to the GPS Intermediate Driver.
//
//  COMMENTS: 
//
//  Parameters:
//    hGPSDevice 
//      Handle returned by a call to GPSOpenDevice. 
//
//  Return Values:
//    If successful, returns ERROR_SUCCESS. 
//    If unsuccessful, returns an error code.
//
DWORD GPSCloseDevice(HANDLE hGPSDev);

#ifdef __cplusplus
}
#endif


#endif // __WGPS_H__

⌨️ 快捷键说明

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