Click here to Skip to main content
15,868,141 members
Articles / Mobile Apps

Using the Skyhook Wireless XPS Positioning Service in Managed Code

Rate me:
Please Sign up or sign in to vote.
4.95/5 (15 votes)
20 Jan 2009CPOL28 min read 88.5K   1.4K   57  
Wrapper and sample programs demonstrating the use of the Skyhook Wireless XPS SDK (hybrid position system using GPS, WiFi Positioning, and Celltower positioning)
#pragma once

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the WPSPROXY_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// WPSPROXY_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef WPSPROXY_EXPORTS
#define WPSPROXY_API __declspec(dllexport)
#else
#define WPSPROXY_API __declspec(dllimport)
#endif

#include "wpsapi.h"
	
typedef WPS_Continuation (*WiFiLocationDelegate)(
								WPS_ReturnCode result,
								double	Latitude,
								double Longitude,
								double	hpe,
								int	nap,
								double	speed,
								double	bearing,
								LPWSTR	AddressNumber,
								LPWSTR	AddressLine,
								LPWSTR	City,
								LPWSTR	StateName,
								LPWSTR	StateCode,
								LPWSTR	PostalCode,
								LPWSTR	County,
								LPWSTR	Region,
								LPWSTR	CountryName,
								LPWSTR	CountryCode,
								LPWSTR  Province
								);

typedef WPS_Continuation (*TilingDelegate)(
								UINT tileNumber,
								UINT tileTotal
								);

extern "C" WPSPROXY_API void SetProxy( const LPWSTR address, int port, const LPWSTR user, const LPWSTR password);
extern "C" WPSPROXY_API void SetServerUrl(const LPWSTR url);
extern "C" WPSPROXY_API void SetUserAgent(const LPWSTR ua);
extern "C" WPSPROXY_API WPS_ReturnCode SetTier2Area(const LPWSTR dirpath, unsigned size);
extern "C" WPSPROXY_API WPS_ReturnCode  RegisterUser(LPWSTR existingUser, LPWSTR existingRealm, LPWSTR newUser, LPWSTR newRealm);

extern "C" WPSPROXY_API WPS_ReturnCode Tiling(LPWSTR dirPath, UINT maxDataPerSession, UINT maxDataSizeTotal, TilingDelegate* callback);

extern "C" WPSPROXY_API WPS_ReturnCode PeriodicLocation(LPWSTR userName, LPWSTR realm, WPS_StreetAddressLookup lookupType, unsigned long period, unsigned long iterations, WiFiLocationDelegate* callback);

extern "C" WPSPROXY_API WPS_ReturnCode SetLocalFilesPath(LPWSTR *path, int pathCount);

extern "C" WPSPROXY_API WPS_ReturnCode GetIPLocation (
	LPWSTR	userName,
	LPWSTR	realm, 
	WPS_StreetAddressLookup lookupType,
	double* Latitude,
	double* Longitude,
	LPWSTR	IPAddress,
	LPWSTR	AddressNumber,
	LPWSTR	AddressLine,
	LPWSTR	City,
	LPWSTR	StateName,
	LPWSTR	StateCode,
	LPWSTR	PostalCode,
	LPWSTR	County,
	LPWSTR	Region,
	LPWSTR	CountryName,
	LPWSTR	CountryCode,
	LPWSTR  Province
	);

  extern "C"  WPSPROXY_API WPS_ReturnCode GetWiFiLocation(
								LPWSTR userName, 
								LPWSTR realm, 
								WPS_StreetAddressLookup lookupType, 
								double*	Latitude,
								double* Longitude,
								double*	hpe,
								int*	nap,
								double*	speed,
								double*	bearing,
								LPWSTR	AddressNumber,
								LPWSTR	AddressLine,
								LPWSTR	City,
								LPWSTR	StateName,
								LPWSTR	StateCode,
								LPWSTR	PostalCode,
								LPWSTR	County,
								LPWSTR	Region,
								LPWSTR	CountryName,
								LPWSTR	CountryCode,
								LPWSTR  Province
								);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
I attended Southern Polytechnic State University and earned a Bachelors of Science in Computer Science and later returned to earn a Masters of Science in Software Engineering. I've largely developed solutions that are based on a mix of Microsoft technologies with open source technologies mixed in. I've got an interest in astronomy and you'll see that interest overflow into some of my code project articles from time to time.



Twitter:@j2inet

Instagram: j2inet


Comments and Discussions