IPosNav::SetData

This method sends data to either the Positioning and Navigation device or the registry.

Syntax

HRESULT SetData( hPNDevice hPN, LPVOID pBuffer, DWORD dwSize, PNData_t Data_Type );

Parameters

hPN
Handle to the Positioning and Navigation device to use
pBuffer
Pointer to a buffer to hold the data. The format is determined by Data_Type.
dwSize
Specifies, in bytes, the size of pBuffer
Data_Type
The following Positioning and Navigation device data types can be set.
Value
Description
Structure type
PN_DT_ACCURACY Accuracy data PNACCURACY
PN_DT_ALMANAC Almanac data PNALMANAC
PN_DT_CONFIG Configuration data PNCONFIG
PN_DT_DEVICE Device profile data PNDEVICE
PN_DT_DEVICESTATE Device state data PNDEVSTATE
PN_DT_POSITION Longitude, latitude, and altitude position data PNPOSITION
PN_DT_SETTINGS Settings data PNSETTINGS
PN_DT_STATION Station data PNSTATION
PN_DT_TIME Time data PNTIME
PN_DT_TM Time data PNTM

Return Values

One of the values described in the following table is returned.

Value
Description
S_OK Success
E_FAIL An unspecified error occurred.
E_INVALIDARG One or more arguments are invalid.
E_NOTIMPL Ability to set the specified data type, such as PN_DT_VELOCITY, is not implemented.
PNAPI_E_DEVICEUNAVAILABLE The Positioning and Navigation device is unavailable; it could be unplugged or dead.
PNAPI_E_NOACCESS The application has insufficient permissions.

Remarks

Position and time can be set to enable the Positioning and Navigation device to find its position more quickly.

The configuration data in the PNCONFIG structure is stored in the registry by this method. The settings contained are also used to update the configuration of the Positioning and Navigation device. If any parameters do not apply to the Positioning and Navigation device, they are ignored by the position and navigation API (PNAPI).

Almanac data is GPS-specific and is received from the Positioning and Navigation device by the IPosNav::GetData method. The almanac details are stored in the registry only through the PNCONFIG structure. The almanac data should not be altered. It provides accurate GPS satellite position data. If almanac data is passed to this method, the system may acquire a GPS satellite position faster.

PNAPI enables various OEM-defined PNData_t enumerations to be passed through this method so that specific features can be made available. OEM vendors should provide details about how they have implemented their structures.

All data is received from the Positioning and Navigation device except PNCONFIG data, which is taken from the registry.

Only applications with read/write permission can use this method, except when the user wishes to change permissions.

The PNTIME structure contains an accurate time in Universal Coordinated Time (UTC), also known as Greenwich mean time (GMT).

See Also

IPosNav::GetData