PL SDK - Software Development Kit  5.4.0
API Reference
wpsapi.h
Go to the documentation of this file.
1 
63 #ifndef _WPSAPI_H_
64 #define _WPSAPI_H_
65 
66 #if defined WPSAPI_EXTENSION && !defined WPSAPI_STATIC
67 # error WPSAPI_EXTENSION can be used only with WPSAPI_STATIC
68 #endif
69 
74 #if defined WPSAPI_STATIC && !defined WPSAPI_EXTENSION
75 # define WPSAPI_EXPORT
76 #else
77 # if __GNUC__ >= 4
78 # define WPSAPI_EXPORT __attribute__((visibility("default")))
79 # elif defined _WIN32
80 # ifdef WPSAPI_INTERNAL
81 # define WPSAPI_EXPORT __declspec(dllexport)
82 # else
83 # define WPSAPI_EXPORT __declspec(dllimport)
84 # endif
85 # else
86 # define WPSAPI_EXPORT
87 # endif
88 #endif
89 
90 #ifdef _WIN32
91 # define WPSAPI_CALL __cdecl
92 #else
93 # define WPSAPI_CALL
94 #endif
95 
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 
107 typedef enum
108 {
112  WPS_OK = 0,
113 
120 
125 
130 
135 
140 
145 
150 
157 
164 
171 
178 
187 
194 
201 
208 
215 
222 
229 
235  WPS_NOMEM = 98,
236 
240  WPS_ERROR = 99
242 
248 typedef enum
249 {
250  WPS_STOP = 0,
251  WPS_CONTINUE = 1
253 
258 typedef struct
259 {
263  const char* username;
264 
268  const char* realm;
270 
279 typedef enum
280 {
285 
291 
298 
302 typedef struct
303 {
307  char* name;
308 
312  char code[3];
313 } WPS_NameCode;
314 
322 typedef struct
323 {
328 
332  char** address_line;
333 
349  char* city;
350 
354  char* postal_code;
355 
359  char* county;
360 
364  char* province;
365 
370 
374  char* region;
375 
380 
391  char* city_sub;
393 
399 typedef enum
400 {
404 
408 typedef struct
409 {
411 
414  double latitude;
415  double longitude;
417 
422  double hpe;
423 
432  double score;
433 
439  unsigned short nap;
440 
448  double speed;
449 
458  double bearing;
459 
468 
474  unsigned short ncell;
475 
481  unsigned short nlac;
482 
488  unsigned short nsat;
489 
495  unsigned short historicalLocationCount;
496 
503  unsigned char withIP;
504 
510  unsigned char hasScore;
511 
520  unsigned id;
521 
530  char* ip;
531 
540  unsigned char* hash;
541 
549  unsigned hashLength;
550 
624  unsigned char* signature;
625 
633  unsigned signatureLength;
634 
645  unsigned long timestamp;
646 
652  double altitude;
653 
660 
667  unsigned long age;
668 } WPS_Location;
669 
679 typedef struct
680 {
684  char* ip;
685 
687 
690  double latitude;
691  double longitude;
693 
702 
711 WPSAPI_EXPORT const char* WPSAPI_CALL
713 
723 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
725 
732 WPSAPI_EXPORT void WPSAPI_CALL
734 
769 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
771  WPS_StreetAddressLookup street_address_lookup,
772  WPS_Location** location);
773 
811  (WPSAPI_CALL *WPS_LocationCallback)(void* arg,
812  WPS_ReturnCode code,
813  const WPS_Location* location,
814  const void* reserved);
815 
833 (WPSAPI_CALL *WPS_CertifiedLocationCallback)(void* arg,
834  WPS_ReturnCode code,
835  const WPS_Location** locations,
836  unsigned nlocations,
837  const void* reserved);
838 
896 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
898  WPS_StreetAddressLookup street_address_lookup,
899  unsigned long period,
900  unsigned iterations,
901  WPS_LocationCallback callback,
902  void* arg);
903 
928 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
930  WPS_StreetAddressLookup street_address_lookup,
932  void* arg);
933 
972 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
974  WPS_StreetAddressLookup street_address_lookup,
975  const unsigned char* salt,
976  unsigned saltLen,
978  void* arg);
979 
1021 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1023  WPS_StreetAddressLookup street_address_lookup,
1024  WPS_IPLocation** location);
1025 
1091 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1093  const unsigned char* key,
1094  unsigned key_length,
1095  unsigned char** token,
1096  unsigned* token_size);
1097 
1161 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1163  const unsigned char* key,
1164  unsigned key_length,
1165  const unsigned char* token,
1166  unsigned token_size,
1167  WPS_Location** location);
1168 
1174 WPSAPI_EXPORT void WPSAPI_CALL
1175 WPS_free_offline_token(unsigned char* token);
1176 
1180 WPSAPI_EXPORT void WPSAPI_CALL
1182 
1186 WPSAPI_EXPORT void WPSAPI_CALL
1188 
1202 WPSAPI_EXPORT void WPSAPI_CALL
1203 WPS_set_proxy(const char* address,
1204  int port,
1205  const char* user,
1206  const char* password);
1207 
1215 WPSAPI_EXPORT void WPSAPI_CALL
1216 WPS_set_server_url(const char* url);
1217 
1225 WPSAPI_EXPORT void WPSAPI_CALL
1226 WPS_set_user_agent(const char* ua);
1227 
1254 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1255 WPS_set_local_files_path(const char** paths);
1256 
1270 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1271 WPS_set_tier2_area(const char* dirpath, unsigned size);
1272 
1304  (WPSAPI_CALL *WPS_TilingCallback)(void* arg,
1305  unsigned tileNumber,
1306  unsigned tileTotal);
1307 
1366 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1368  const char* dirpath,
1369  unsigned maxDataSizePerSession,
1370  unsigned maxDataSizeTotal,
1371  WPS_TilingCallback callback,
1372  void* arg);
1373 
1379 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1380 WPS_tiling(const char* dirpath,
1381  unsigned maxDataSizePerSession,
1382  unsigned maxDataSizeTotal,
1383  WPS_TilingCallback callback,
1384  void* arg);
1385 
1401 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1402 WPS_set_key(const char* key);
1403 
1420 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1421 WPS_set_auth(const char* key, const char* sku);
1422 
1442 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1443 WPS_set_auth_token(const char* token);
1444 
1462 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1464 
1564 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1566  const WPS_SimpleAuthentication* new_authentication);
1567 
1586 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1588  const WPS_Location* location);
1589 
1595 typedef enum
1596 {
1601 
1606 
1614 
1623 
1629 typedef struct
1630 {
1643  unsigned size;
1644 
1646 
1649  double latitude;
1650  double longitude;
1652 
1656  unsigned radius;
1657 
1662 
1671  unsigned long period;
1672 } WPS_GeoFence;
1673 
1679 typedef void* WPS_GeoFenceHandle;
1680 
1730  (WPSAPI_CALL *WPS_GeoFenceCallback)(void* arg,
1731  const WPS_GeoFence* geofence,
1732  const WPS_Location* location,
1733  const void* reserved);
1734 
1795 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1797  WPS_GeoFenceCallback callback,
1798  void* arg,
1799  WPS_GeoFenceHandle* handle);
1800 
1812 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1814 
1824 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1826 
1834 WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL
1835 WPS_set_tunable(const char* key, const char* value);
1836 
1837 #ifdef __cplusplus
1838 }
1839 #endif
1840 
1841 #endif // _WPSAPI_H_
WPS_SimpleAuthentication::realm
const char * realm
Definition: wpsapi.h:268
WPS_GeoFence
Definition: wpsapi.h:1630
WPS_Continuation
WPS_Continuation
Definition: wpsapi.h:249
WPS_IPLocation::latitude
double latitude
Definition: wpsapi.h:690
WPS_GeoFence::longitude
double longitude
Definition: wpsapi.h:1650
WPS_ERROR_FILE_IO
@ WPS_ERROR_FILE_IO
Definition: wpsapi.h:156
WPS_Location::nlac
unsigned short nlac
Definition: wpsapi.h:481
WPS_GEOFENCE_ERROR
@ WPS_GEOFENCE_ERROR
Definition: wpsapi.h:186
WPS_Location::latitude
double latitude
Definition: wpsapi.h:414
WPS_IPLocation
Definition: wpsapi.h:680
WPS_ERROR_LOCATION_CANNOT_BE_DETERMINED
@ WPS_ERROR_LOCATION_CANNOT_BE_DETERMINED
Definition: wpsapi.h:144
WPS_NOMEM
@ WPS_NOMEM
Definition: wpsapi.h:235
WPS_Location::signature
unsigned char * signature
Definition: wpsapi.h:624
WPS_ERROR_INVALID_FILE_FORMAT
@ WPS_ERROR_INVALID_FILE_FORMAT
Definition: wpsapi.h:163
WPS_ReturnCode
WPS_ReturnCode
Definition: wpsapi.h:108
WPS_StreetAddress::province
char * province
Definition: wpsapi.h:364
WPS_ERROR
@ WPS_ERROR
Definition: wpsapi.h:240
WPS_ERROR_LOCATION_SETTING_DISABLED
@ WPS_ERROR_LOCATION_SETTING_DISABLED
Definition: wpsapi.h:207
WPS_StreetAddress::state
WPS_NameCode state
Definition: wpsapi.h:369
WPS_StreetAddress::street_number
char * street_number
Definition: wpsapi.h:327
WPS_ERROR_SERVICE_EXPIRED
@ WPS_ERROR_SERVICE_EXPIRED
Definition: wpsapi.h:228
WPS_GeoFence::latitude
double latitude
Definition: wpsapi.h:1649
WPS_geofence_cancel
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_geofence_cancel(WPS_GeoFenceHandle handle)
WPS_signed_certified_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_signed_certified_location(const WPS_SimpleAuthentication *authentication, WPS_StreetAddressLookup street_address_lookup, const unsigned char *salt, unsigned saltLen, WPS_CertifiedLocationCallback callback, void *arg)
WPS_IPLocation::street_address
WPS_StreetAddress * street_address
Definition: wpsapi.h:700
WPS_LOCATION_TYPE_3D
@ WPS_LOCATION_TYPE_3D
Definition: wpsapi.h:402
WPS_GeoFence::radius
unsigned radius
Definition: wpsapi.h:1656
WPS_tiling
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_tiling(const char *dirpath, unsigned maxDataSizePerSession, unsigned maxDataSizeTotal, WPS_TilingCallback callback, void *arg)
WPS_CertifiedLocationCallback
WPS_Continuation(WPSAPI_CALL * WPS_CertifiedLocationCallback)(void *arg, WPS_ReturnCode code, const WPS_Location **locations, unsigned nlocations, const void *reserved)
Definition: wpsapi.h:833
WPS_set_tiling
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_tiling(const WPS_SimpleAuthentication *authentication, const char *dirpath, unsigned maxDataSizePerSession, unsigned maxDataSizeTotal, WPS_TilingCallback callback, void *arg)
WPS_StreetAddressLookup
WPS_StreetAddressLookup
Definition: wpsapi.h:280
WPS_GEOFENCE_ENTER
@ WPS_GEOFENCE_ENTER
Definition: wpsapi.h:1600
WPS_ERROR_TIMEOUT
@ WPS_ERROR_TIMEOUT
Definition: wpsapi.h:170
WPS_IPLocation::ip
char * ip
Definition: wpsapi.h:684
WPS_StreetAddress::country
WPS_NameCode country
Definition: wpsapi.h:379
WPS_certified_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_certified_location(const WPS_SimpleAuthentication *authentication, WPS_StreetAddressLookup street_address_lookup, WPS_CertifiedLocationCallback callback, void *arg)
WPS_ERROR_SERVER_UNAVAILABLE
@ WPS_ERROR_SERVER_UNAVAILABLE
Definition: wpsapi.h:139
WPS_NOT_APPLICABLE
@ WPS_NOT_APPLICABLE
Definition: wpsapi.h:177
WPS_NameCode
Definition: wpsapi.h:303
WPS_StreetAddress::county
char * county
Definition: wpsapi.h:359
WPS_GeoFenceHandle
void * WPS_GeoFenceHandle
Definition: wpsapi.h:1679
WPS_free_location
WPSAPI_EXPORT void WPSAPI_CALL WPS_free_location(WPS_Location *)
WPS_Location::ncell
unsigned short ncell
Definition: wpsapi.h:474
WPS_Location::timestamp
unsigned long timestamp
Definition: wpsapi.h:645
WPS_GeoFenceType
WPS_GeoFenceType
Definition: wpsapi.h:1596
WPS_set_proxy
WPSAPI_EXPORT void WPSAPI_CALL WPS_set_proxy(const char *address, int port, const char *user, const char *password)
WPS_GeoFence::size
unsigned size
Definition: wpsapi.h:1643
WPS_load
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_load()
WPS_offline_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_offline_location(const WPS_SimpleAuthentication *authentication, const unsigned char *key, unsigned key_length, const unsigned char *token, unsigned token_size, WPS_Location **location)
WPS_StreetAddress::postal_code
char * postal_code
Definition: wpsapi.h:354
WPS_LOCATION_TYPE_2D
@ WPS_LOCATION_TYPE_2D
Definition: wpsapi.h:401
WPS_STOP
@ WPS_STOP
Definition: wpsapi.h:250
WPS_register_user
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_register_user(const WPS_SimpleAuthentication *authentication, const WPS_SimpleAuthentication *new_authentication)
WPS_NOT_SUPPORTED
@ WPS_NOT_SUPPORTED
Definition: wpsapi.h:221
WPS_ip_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_ip_location(const WPS_SimpleAuthentication *authentication, WPS_StreetAddressLookup street_address_lookup, WPS_IPLocation **location)
WPS_ERROR_SCANNER_NOT_FOUND
@ WPS_ERROR_SCANNER_NOT_FOUND
Definition: wpsapi.h:119
WPS_ERROR_UNAUTHORIZED
@ WPS_ERROR_UNAUTHORIZED
Definition: wpsapi.h:134
WPS_StreetAddress::region
char * region
Definition: wpsapi.h:374
WPS_StreetAddress
Definition: wpsapi.h:323
WPS_OK
@ WPS_OK
Definition: wpsapi.h:112
WPS_Location::hash
unsigned char * hash
Definition: wpsapi.h:540
WPS_tune_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_tune_location(const WPS_SimpleAuthentication *authentication, const WPS_Location *location)
WPS_ERROR_NO_WIFI_IN_RANGE
@ WPS_ERROR_NO_WIFI_IN_RANGE
Definition: wpsapi.h:129
WPS_GeoFence::type
WPS_GeoFenceType type
Definition: wpsapi.h:1661
WPS_Location::withIP
unsigned char withIP
Definition: wpsapi.h:503
WPS_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_location(const WPS_SimpleAuthentication *authentication, WPS_StreetAddressLookup street_address_lookup, WPS_Location **location)
WPS_set_server_url
WPSAPI_EXPORT void WPSAPI_CALL WPS_set_server_url(const char *url)
WPS_Location::hashLength
unsigned hashLength
Definition: wpsapi.h:549
WPS_ERROR_LOCATION_NOT_PERMITTED
@ WPS_ERROR_LOCATION_NOT_PERMITTED
Definition: wpsapi.h:214
WPS_LocationCallback
WPS_Continuation(WPSAPI_CALL * WPS_LocationCallback)(void *arg, WPS_ReturnCode code, const WPS_Location *location, const void *reserved)
Definition: wpsapi.h:811
WPS_GEOFENCE_INSIDE
@ WPS_GEOFENCE_INSIDE
Definition: wpsapi.h:1613
WPS_offline_token
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_offline_token(const WPS_SimpleAuthentication *authentication, const unsigned char *key, unsigned key_length, unsigned char **token, unsigned *token_size)
WPS_FULL_STREET_ADDRESS_LOOKUP
@ WPS_FULL_STREET_ADDRESS_LOOKUP
Definition: wpsapi.h:296
WPS_unload
WPSAPI_EXPORT void WPSAPI_CALL WPS_unload()
WPS_ERROR_NOT_TUNED
@ WPS_ERROR_NOT_TUNED
Definition: wpsapi.h:193
WPS_Location::hpe
double hpe
Definition: wpsapi.h:422
WPS_NameCode::name
char * name
Definition: wpsapi.h:307
WPS_IPLocation::longitude
double longitude
Definition: wpsapi.h:691
WPS_Location::id
unsigned id
Definition: wpsapi.h:520
WPS_GEOFENCE_LEAVE
@ WPS_GEOFENCE_LEAVE
Definition: wpsapi.h:1605
WPS_SimpleAuthentication::username
const char * username
Definition: wpsapi.h:263
WPS_periodic_location
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_periodic_location(const WPS_SimpleAuthentication *authentication, WPS_StreetAddressLookup street_address_lookup, unsigned long period, unsigned iterations, WPS_LocationCallback callback, void *arg)
WPS_free_offline_token
WPSAPI_EXPORT void WPSAPI_CALL WPS_free_offline_token(unsigned char *token)
WPS_GeoFence::period
unsigned long period
Definition: wpsapi.h:1671
WPS_Location::signatureLength
unsigned signatureLength
Definition: wpsapi.h:633
WPS_StreetAddress::address_line
char ** address_line
Definition: wpsapi.h:332
WPS_Location::type
WPS_LocationType type
Definition: wpsapi.h:659
WPS_Location::hasScore
unsigned char hasScore
Definition: wpsapi.h:510
WPS_set_tunable
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_tunable(const char *key, const char *value)
WPS_version
WPSAPI_EXPORT const char *WPSAPI_CALL WPS_version()
WPS_Location
Definition: wpsapi.h:409
WPS_SimpleAuthentication
Definition: wpsapi.h:259
WPS_Location::altitude
double altitude
Definition: wpsapi.h:652
WPS_Location::historicalLocationCount
unsigned short historicalLocationCount
Definition: wpsapi.h:495
WPS_set_key
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_key(const char *key)
WPS_Location::street_address
WPS_StreetAddress * street_address
Definition: wpsapi.h:467
WPS_Location::speed
double speed
Definition: wpsapi.h:448
WPS_Location::age
unsigned long age
Definition: wpsapi.h:667
WPS_geofence_set
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_geofence_set(const WPS_GeoFence *geofence, WPS_GeoFenceCallback callback, void *arg, WPS_GeoFenceHandle *handle)
WPS_geofence_cancel_all
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_geofence_cancel_all()
WPS_Location::nsat
unsigned short nsat
Definition: wpsapi.h:488
WPS_GEOFENCE_OUTSIDE
@ WPS_GEOFENCE_OUTSIDE
Definition: wpsapi.h:1621
WPS_free_ip_location
WPSAPI_EXPORT void WPSAPI_CALL WPS_free_ip_location(WPS_IPLocation *)
WPS_set_user_agent
WPSAPI_EXPORT void WPSAPI_CALL WPS_set_user_agent(const char *ua)
WPS_CONTINUE
@ WPS_CONTINUE
Definition: wpsapi.h:251
WPS_ERROR_PROXY_UNAUTHORIZED
@ WPS_ERROR_PROXY_UNAUTHORIZED
Definition: wpsapi.h:149
WPS_set_auth
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_auth(const char *key, const char *sku)
WPS_set_local_files_path
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_local_files_path(const char **paths)
WPS_GeoFenceCallback
WPS_Continuation(WPSAPI_CALL * WPS_GeoFenceCallback)(void *arg, const WPS_GeoFence *geofence, const WPS_Location *location, const void *reserved)
Definition: wpsapi.h:1730
WPS_set_registration_user
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_registration_user(const WPS_SimpleAuthentication *authentication)
WPS_Location::longitude
double longitude
Definition: wpsapi.h:415
WPS_set_tier2_area
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_tier2_area(const char *dirpath, unsigned size)
WPS_ERROR_NOT_SIGNED
@ WPS_ERROR_NOT_SIGNED
Definition: wpsapi.h:200
WPS_StreetAddress::city_sub
char * city_sub
Definition: wpsapi.h:391
WPS_TilingCallback
WPS_Continuation(WPSAPI_CALL * WPS_TilingCallback)(void *arg, unsigned tileNumber, unsigned tileTotal)
Definition: wpsapi.h:1304
WPS_ERROR_WIFI_NOT_AVAILABLE
@ WPS_ERROR_WIFI_NOT_AVAILABLE
Definition: wpsapi.h:124
WPS_Location::ip
char * ip
Definition: wpsapi.h:530
WPS_Location::bearing
double bearing
Definition: wpsapi.h:458
WPS_NO_STREET_ADDRESS_LOOKUP
@ WPS_NO_STREET_ADDRESS_LOOKUP
Definition: wpsapi.h:284
WPS_LocationType
WPS_LocationType
Definition: wpsapi.h:400
WPS_StreetAddress::city
char * city
Definition: wpsapi.h:349
WPS_LIMITED_STREET_ADDRESS_LOOKUP
@ WPS_LIMITED_STREET_ADDRESS_LOOKUP
Definition: wpsapi.h:290
WPS_Location::nap
unsigned short nap
Definition: wpsapi.h:439
WPS_set_auth_token
WPSAPI_EXPORT WPS_ReturnCode WPSAPI_CALL WPS_set_auth_token(const char *token)
WPS_Location::score
double score
Definition: wpsapi.h:432