SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -fPIC -Wall -Werror")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
IF("${ARCH}" STREQUAL "arm")
ENDIF("${ARCH}" STREQUAL "arm")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
int location_preference_get_country_code(location_service_h service, char** country_code);
/**
+ * @brief Sets the account.
+ * @param[in] location_service The memory pointer of location service handle.
+ * It must be converted into location_service_h by GET_LOCATION_SERVICE().
+ * @param[in] maps_key The maps key
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #LOCATION_PREFERENCE_ERROR_NONE Successful
+ * @retval #LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see GET_LOCATION_SERVICE()
+ * @see location_preference_get_maps_key()
+ */
+int location_preference_set_maps_key(location_service_h service, const char* maps_key);
+
+/**
+ * @brief Gets the account.
+ * @param[in] location_service The memory pointer of location service handle.
+ * It must be converted into location_service_h by GET_LOCATION_SERVICE().
+ * @param[out] maps_key The maps key
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #LOCATION_PREFERENCE_ERROR_NONE Successful
+ * @retval #LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see GET_LOCATION_SERVICE()
+ * @see location_preference_set_maps_key()
+ */
+int location_preference_get_maps_key(location_service_h service, char** maps_key);
+
+/**
* @}
*/
int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);
/**
+ * @brief Gets the current position information.
+ * @details
+ * The result is current altitude, latitude, longitude, climb, direction, speed, level, horizontal and verticalwith a measurement timestamp.
+ *
+ * If @a altitude is negative, only altitude and latitude are available (fix status is 2D).
+ * If @a altitude is positive, fix status is 3D and returned altitude value is the result of measurement.
+ *
+ * @param[in] manager The location manager handle
+ * @param[out] altitude The current altitude (meters)
+ * @param[out] latitude The current latitude [-90.0 ~ 90.0] (degrees)
+ * @param[out] longitude The current longitude [-180.0 ~ 180.0] (degrees)
+ * @param[out] climb The climb (km/h)
+ * @param[out] direction The direction, degrees from the north
+ * @param[out] speed The speed (km/h)
+ * @param[out] level The accuracy level
+ * @param[out] horizontal The horizontal accuracy (meters)
+ * @param[out] vertical The vertical accuracy (meters)
+ * @param[out] timestamp The timestamp (time when measurement took place or 0 if valid)
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #LOCATIONS_ERROR_NONE Successful
+ * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
+ * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled
+ * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
+ */
+int location_manager_get_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);
+
+/**
* @brief Gets the current velocity information.
* @details
* The result is current climb, direction, and speed, with a measurement timestamp.
int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);
/**
+ * @brief Gets the last location information.
+ * @details The @a altitude, @a latitude, @a longitude, @a climb, @a direction, @a speed and @c timestamp values should be 0, if there is no record of any previous position information.
+ * @details If @a altitude is negative, only altitude and latitude are available (fix status is 2D).
+ * @details If @a altitude is positive, fix status is 3D and returned altitude value is the result of measurement.
+ * @param[in] manager The location manager handle
+ * @param[out] altitude The current altitude (meters)
+ * @param[out] latitude The current latitude [-90.0 ~ 90.0] (degrees)
+ * @param[out] longitude The current longitude [-180.0 ~ 180.0] (degrees)
+ * @param[out] climb The climb (km/h)
+ * @param[out] direction The direction, degrees from the north
+ * @param[out] speed The speed (km/h)
+ * @param[out] level The accuracy level
+ * @param[out] horizontal The horizontal accuracy (meters)
+ * @param[out] vertical The vertical accuracy (meters)
+ * @param[out] timestamp The timestamp (time when measurement took place or 0 if valid)
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #LOCATIONS_ERROR_NONE Successful
+ * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
+ * @pre The location manager handle must be created by location_manager_create()
+ */
+int location_manager_get_last_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);
+
+
+/**
* @brief Gets the last velocity information which is recorded.
* @details
* The @a climb, @a direction and @a speed values should be 0, if there is no record of any previous velocity information.
#sbs-git:slp/api/location-manager capi-location-manager 0.1.0 d1ee09a32e8bc0e9ed48ece37c641a7393c086c5
Name: capi-location-manager
Summary: A Location Manager library in Tizen Native API
-Version: 0.1.9
+Version: 0.1.11
Release: 1
Group: System/Libraries
License: Apache License, Version 2.0
return ret;
}
-int location_bounds_create_rect(location_coords_s top_left, location_coords_s bottom_right, location_bounds_h * bounds)
+EXPORT_API int location_bounds_create_rect(location_coords_s top_left, location_coords_s bottom_right, location_bounds_h * bounds)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_CHECK_CONDITION(top_left.latitude>=-90 && top_left.latitude<=90,LOCATION_BOUNDS_ERROR_INVALID_PARAMETER,"LOCATION_BOUNDS_ERROR_INVALID_PARAMETER");
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_create_circle(location_coords_s center, double radius, location_bounds_h * bounds)
+EXPORT_API int location_bounds_create_circle(location_coords_s center, double radius, location_bounds_h * bounds)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_CHECK_CONDITION(radius>=0,LOCATION_BOUNDS_ERROR_INVALID_PARAMETER,"LOCATION_BOUNDS_ERROR_INVALID_PARAMETER");
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_create_polygon(location_coords_s * coords_list, int length, location_bounds_h * bounds)
+EXPORT_API int location_bounds_create_polygon(location_coords_s * coords_list, int length, location_bounds_h * bounds)
{
LOCATIONS_NULL_ARG_CHECK(coords_list);
LOCATIONS_NULL_ARG_CHECK(bounds);
return LOCATION_BOUNDS_ERROR_NONE;
}
-bool location_bounds_contains_coordinates(location_bounds_h bounds, location_coords_s coords)
+EXPORT_API bool location_bounds_contains_coordinates(location_bounds_h bounds, location_coords_s coords)
{
if (!bounds)
return FALSE;
return result;
}
-int location_bounds_get_type(location_bounds_h bounds, location_bounds_type_e * type)
+EXPORT_API int location_bounds_get_type(location_bounds_h bounds, location_bounds_type_e * type)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_NULL_ARG_CHECK(type);
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_get_rect_coords(location_bounds_h bounds, location_coords_s * top_left, location_coords_s * bottom_right)
+EXPORT_API int location_bounds_get_rect_coords(location_bounds_h bounds, location_coords_s * top_left, location_coords_s * bottom_right)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_NULL_ARG_CHECK(top_left);
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_get_circle_coords(location_bounds_h bounds, location_coords_s * center, double *radius)
+EXPORT_API int location_bounds_get_circle_coords(location_bounds_h bounds, location_coords_s * center, double *radius)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_NULL_ARG_CHECK(center);
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_foreach_polygon_coords(location_bounds_h bounds, polygon_coords_cb callback, void *user_data)
+EXPORT_API int location_bounds_foreach_polygon_coords(location_bounds_h bounds, polygon_coords_cb callback, void *user_data)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_NULL_ARG_CHECK(callback);
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_destroy(location_bounds_h bounds)
+EXPORT_API int location_bounds_destroy(location_bounds_h bounds)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
location_bounds_s *handle = (location_bounds_s *) bounds;
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_set_state_changed_cb(location_bounds_h bounds, location_bounds_state_changed_cb callback, void *user_data)
+EXPORT_API int location_bounds_set_state_changed_cb(location_bounds_h bounds, location_bounds_state_changed_cb callback, void *user_data)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
LOCATIONS_NULL_ARG_CHECK(callback);
return LOCATION_BOUNDS_ERROR_NONE;
}
-int location_bounds_unset_state_changed_cb(location_bounds_h bounds)
+EXPORT_API int location_bounds_unset_state_changed_cb(location_bounds_h bounds)
{
LOCATIONS_NULL_ARG_CHECK(bounds);
location_bounds_s *handle = (location_bounds_s *) bounds;
/*
* Public Implementation
*/
-int location_preference_foreach_available_property_keys(location_service_h service, location_preference_available_property_key_cb callback, void* user_data)
+EXPORT_API int location_preference_foreach_available_property_keys(location_service_h service, location_preference_available_property_key_cb callback, void* user_data)
{
LocationMapObject* object = NULL;
GList* keys = NULL;
}
}
-int location_preference_foreach_available_property_values(location_service_h service, const char* key, location_preference_available_property_value_cb callback, void* user_data)
+EXPORT_API int location_preference_foreach_available_property_values(location_service_h service, const char* key, location_preference_available_property_value_cb callback, void* user_data)
{
LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
LOCATION_PREFERENCE_NULL_ARG_CHECK(key);
return LOCATION_PREFERENCE_ERROR_RESULT_NOT_FOUND;
}
-int location_preference_foreach_available_languages(location_service_h service, location_preference_available_language_cb callback, void* user_data)
+EXPORT_API int location_preference_foreach_available_languages(location_service_h service, location_preference_available_language_cb callback, void* user_data)
{
LocationMapObject* object = NULL;
GList* keys = NULL;
}
}
-int location_preference_foreach_available_country_codes(location_service_h service, location_preference_available_country_code_cb callback, void* user_data)
+EXPORT_API int location_preference_foreach_available_country_codes(location_service_h service, location_preference_available_country_code_cb callback, void* user_data)
{
LocationMapObject* object = NULL;
GList* keys = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_foreach_properties(location_service_h service, location_preference_property_cb callback, void* user_data)
+EXPORT_API int location_preference_foreach_properties(location_service_h service, location_preference_property_cb callback, void* user_data)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_set(location_service_h service, const char* key, const char* value)
+EXPORT_API int location_preference_set(location_service_h service, const char* key, const char* value)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get(location_service_h service, const char* key, char** value)
+EXPORT_API int location_preference_get(location_service_h service, const char* key, char** value)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_set_provider(location_service_h service, char* provider)
+EXPORT_API int location_preference_set_provider(location_service_h service, char* provider)
{
LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
LOCATION_PREFERENCE_NULL_ARG_CHECK(provider);
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get_provider(location_service_h service, char** provider)
+EXPORT_API int location_preference_get_provider(location_service_h service, char** provider)
{
LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
LOCATION_PREFERENCE_NULL_ARG_CHECK(provider);
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get_default_provider(location_service_h service, char** provider)
+EXPORT_API int location_preference_get_default_provider(location_service_h service, char** provider)
{
LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
LOCATION_PREFERENCE_NULL_ARG_CHECK(provider);
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_foreach_supported_provider(location_service_h service, location_preference_supported_provider_cb callback , void *user_data)
+EXPORT_API int location_preference_foreach_supported_provider(location_service_h service, location_preference_supported_provider_cb callback , void *user_data)
{
LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
LOCATION_PREFERENCE_NULL_ARG_CHECK(callback);
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get_provider_name(location_service_h service, char** provider)
+EXPORT_API int location_preference_get_provider_name(location_service_h service, char** provider)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get_distance_unit(location_service_h service, location_preference_distance_unit_e* unit)
+EXPORT_API int location_preference_get_distance_unit(location_service_h service, location_preference_distance_unit_e* unit)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
}
}
-int location_preference_set_distance_unit(location_service_h service, location_preference_distance_unit_e unit)
+EXPORT_API int location_preference_set_distance_unit(location_service_h service, location_preference_distance_unit_e unit)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_get_language(location_service_h service, char** language)
+EXPORT_API int location_preference_get_language(location_service_h service, char** language)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_set_language(location_service_h service, const char* language)
+EXPORT_API int location_preference_set_language(location_service_h service, const char* language)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
}
-int location_preference_get_country_code(location_service_h service, char** country_code)
+EXPORT_API int location_preference_get_country_code(location_service_h service, char** country_code)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
-int location_preference_set_country_code(location_service_h service, const char* country_code)
+EXPORT_API int location_preference_set_country_code(location_service_h service, const char* country_code)
{
LocationMapPref* pref = NULL;
LocationMapObject* object = NULL;
return LOCATION_PREFERENCE_ERROR_NONE;
}
+
+EXPORT_API int location_preference_set_maps_key (location_service_h service, const char* maps_key)
+{
+ LocationMapPref* pref = NULL;
+ LocationMapObject* object = NULL;
+
+ LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
+ LOCATION_PREFERENCE_NULL_ARG_CHECK(maps_key);
+
+ object = LOCATION_PREFERENCE_GET_LOCATION_OBJECT(service);
+ pref = location_map_get_service_pref(object);
+ LOCATIONS_CHECK_CONDITION(pref != NULL, LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER, "LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER");
+
+ location_map_pref_set_maps_key(pref, maps_key);
+ location_map_set_service_pref(object, pref);
+ location_map_pref_free(pref);
+
+ return LOCATION_PREFERENCE_ERROR_NONE;
+}
+
+EXPORT_API int location_preference_get_maps_key (location_service_h service, char** maps_key)
+{
+ LocationMapPref* pref = NULL;
+ LocationMapObject* object = NULL;
+ char* ret = NULL;
+
+ LOCATION_PREFERENCE_NULL_ARG_CHECK(service);
+ LOCATION_PREFERENCE_NULL_ARG_CHECK(maps_key);
+
+ object = LOCATION_PREFERENCE_GET_LOCATION_OBJECT(service);
+ pref = location_map_get_service_pref(object);
+ LOCATIONS_CHECK_CONDITION(pref != NULL, LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER, "LOCATION_PREFERENCE_ERROR_INVALID_PARAMETER");
+
+ ret = location_map_pref_get_maps_key(pref);
+ if(ret != NULL)
+ *maps_key = strdup(ret);
+ else
+ *maps_key = NULL;
+
+ location_map_pref_free(pref);
+ return LOCATION_PREFERENCE_ERROR_NONE;
+
+}
\ No newline at end of file
location_manager_s *handle = (location_manager_s *) userdata;
if (type == VELOCITY_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_VELOCITY]) {
LocationVelocity *vel = (LocationVelocity *) data;
- LOCATIONS_LOGI("Current velocity: timestamp : %d, speed: %f, direction : %f, climb : %f",
- vel->timestamp, vel->speed, vel->direction, vel->climb);
+ LOCATIONS_LOGI("Current velocity: timestamp : %d", vel->timestamp);
((location_velocity_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_VELOCITY]) (vel->speed, vel->direction,
vel->climb, vel->timestamp,
handle->user_data
}
else if (type == POSITION_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION]) {
LocationPosition *pos = (LocationPosition *) data;
- LOCATIONS_LOGI("Current position: timestamp : %d, latitude : %f, altitude: %f, longitude: %f",
- pos->timestamp, pos->latitude, pos->altitude, pos->longitude);
+ LOCATIONS_LOGI("Current position: timestamp : %d", pos->timestamp);
((location_position_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION]) (pos->latitude, pos->longitude,
pos->altitude, pos->timestamp,
handle->user_data
* Public Implementation
*/
-bool location_manager_is_supported_method(location_method_e method)
+EXPORT_API bool location_manager_is_supported_method(location_method_e method)
{
LocationMethod _method = LOCATION_METHOD_NONE;
switch (method) {
return location_is_supported_method(_method);
}
-int location_manager_create(location_method_e method, location_manager_h * manager)
+EXPORT_API int location_manager_create(location_method_e method, location_manager_h * manager)
{
LOCATIONS_NULL_ARG_CHECK(manager);
if (location_init() != LOCATION_ERROR_NONE)
return LOCATIONS_ERROR_NONE;
}
-int location_manager_destroy(location_manager_h manager)
+EXPORT_API int location_manager_destroy(location_manager_h manager)
{
LOCATIONS_NULL_ARG_CHECK(manager);
location_manager_s *handle = (location_manager_s *) manager;
return LOCATIONS_ERROR_NONE;
}
-int location_manager_start(location_manager_h manager)
+EXPORT_API int location_manager_start(location_manager_h manager)
{
LOCATIONS_NULL_ARG_CHECK(manager);
location_manager_s *handle = (location_manager_s *) manager;
return LOCATIONS_ERROR_NONE;
}
-int location_manager_stop(location_manager_h manager)
+EXPORT_API int location_manager_stop(location_manager_h manager)
{
LOCATIONS_NULL_ARG_CHECK(manager);
location_manager_s *handle = (location_manager_s *) manager;
return LOCATIONS_ERROR_NONE;
}
-int location_manager_add_boundary(location_manager_h manager, location_bounds_h bounds)
+EXPORT_API int location_manager_add_boundary(location_manager_h manager, location_bounds_h bounds)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(bounds);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_remove_boundary(location_manager_h manager, location_bounds_h bounds)
+EXPORT_API int location_manager_remove_boundary(location_manager_h manager, location_bounds_h bounds)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(bounds);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_foreach_boundary(location_manager_h manager, location_bounds_cb callback, void *user_data)
+EXPORT_API int location_manager_foreach_boundary(location_manager_h manager, location_bounds_cb callback, void *user_data)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(callback);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_method(location_manager_h manager, location_method_e * method)
+EXPORT_API int location_manager_get_method(location_manager_h manager, location_method_e * method)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(method);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude,
+EXPORT_API int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude,
time_t * timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t * timestamp)
+EXPORT_API int location_manager_get_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp)
+{
+ LOCATIONS_NULL_ARG_CHECK(manager);
+ LOCATIONS_NULL_ARG_CHECK(altitude);
+ LOCATIONS_NULL_ARG_CHECK(latitude);
+ LOCATIONS_NULL_ARG_CHECK(longitude);
+ LOCATIONS_NULL_ARG_CHECK(climb);
+ LOCATIONS_NULL_ARG_CHECK(direction);
+ LOCATIONS_NULL_ARG_CHECK(speed);
+ LOCATIONS_NULL_ARG_CHECK(level);
+ LOCATIONS_NULL_ARG_CHECK(horizontal);
+ LOCATIONS_NULL_ARG_CHECK(vertical);
+ LOCATIONS_NULL_ARG_CHECK(timestamp);
+
+ location_manager_s *handle = (location_manager_s *) manager;
+ int ret;
+ LocationPosition *pos = NULL;
+ LocationVelocity *vel = NULL;
+ LocationAccuracy *acc = NULL;
+ ret = location_get_position_ext(handle->object, &pos, &vel, &acc);
+ if (ret != LOCATION_ERROR_NONE) {
+ return __convert_error_code(ret);
+ }
+
+ if (pos->status == LOCATION_STATUS_NO_FIX) {
+ *altitude = -1;
+ *latitude = -1;
+ *longitude = -1;
+ } else {
+ if (pos->status == LOCATION_STATUS_3D_FIX) {
+ *altitude = pos->altitude;
+ } else {
+ *altitude = -1;
+ }
+ *latitude = pos->latitude;
+ *longitude = pos->longitude;
+ }
+ *timestamp = pos->timestamp;
+ *climb = vel->climb;
+ *direction = vel->direction;
+ *speed = vel->speed;
+ *level = acc->level;
+ *horizontal = acc->horizontal_accuracy;
+ *vertical = acc->vertical_accuracy;
+
+ location_position_free(pos);
+ location_velocity_free(vel);
+ location_accuracy_free(acc);
+ return LOCATIONS_ERROR_NONE;
+}
+
+EXPORT_API int location_manager_get_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t * timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(climb);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e * level, double *horizontal,
+EXPORT_API int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e * level, double *horizontal,
double *vertical)
{
LOCATIONS_NULL_ARG_CHECK(manager);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude,
+EXPORT_API int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude,
time_t * timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_last_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t * timestamp)
+EXPORT_API int location_manager_get_last_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e * level, double *horizontal, double *vertical, time_t * timestamp)
+{
+ LOCATIONS_NULL_ARG_CHECK(manager);
+ LOCATIONS_NULL_ARG_CHECK(altitude);
+ LOCATIONS_NULL_ARG_CHECK(latitude);
+ LOCATIONS_NULL_ARG_CHECK(longitude);
+ LOCATIONS_NULL_ARG_CHECK(climb);
+ LOCATIONS_NULL_ARG_CHECK(direction);
+ LOCATIONS_NULL_ARG_CHECK(speed);
+ LOCATIONS_NULL_ARG_CHECK(level);
+ LOCATIONS_NULL_ARG_CHECK(horizontal);
+ LOCATIONS_NULL_ARG_CHECK(vertical);
+ LOCATIONS_NULL_ARG_CHECK(timestamp);
+
+ location_manager_s *handle = (location_manager_s *) manager;
+
+ int ret;
+ LocationPosition *last_pos = NULL;
+ LocationVelocity *last_vel = NULL;
+ LocationAccuracy *last_acc = NULL;
+ ret = location_get_last_position_ext(handle->object, &last_pos, &last_vel, &last_acc);
+ if (ret != LOCATION_ERROR_NONE) {
+ return __convert_error_code(ret);
+ }
+
+ if (last_pos->status == LOCATION_STATUS_NO_FIX) {
+ *altitude = -1;
+ *latitude = -1;
+ *longitude = -1;
+ } else {
+ if (last_pos->status == LOCATION_STATUS_3D_FIX) {
+ *altitude = last_pos->altitude;
+ } else {
+ *altitude = -1;
+ }
+ *latitude = last_pos->latitude;
+ *longitude = last_pos->longitude;
+ }
+ *timestamp = last_pos->timestamp;
+ *climb = last_vel->climb;
+ *direction = last_vel->direction;
+ *speed = last_vel->speed;
+ *level = last_acc->level;
+ *horizontal = last_acc->horizontal_accuracy;
+ *vertical = last_acc->vertical_accuracy;
+ location_position_free(last_pos);
+ location_velocity_free(last_vel);
+ location_accuracy_free(last_acc);
+ return LOCATIONS_ERROR_NONE;
+}
+
+EXPORT_API int location_manager_get_last_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t * timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(climb);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_last_accuracy(location_manager_h manager, location_accuracy_level_e * level, double *horizontal,
+EXPORT_API int location_manager_get_last_accuracy(location_manager_h manager, location_accuracy_level_e * level, double *horizontal,
double *vertical)
{
LOCATIONS_NULL_ARG_CHECK(manager);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_get_accessibility_state(location_accessibility_state_e* state)
+EXPORT_API int location_manager_get_accessibility_state(location_accessibility_state_e* state)
{
LOCATIONS_NULL_ARG_CHECK(state);
return LOCATIONS_ERROR_NONE;
}
-int location_manager_set_position_updated_cb(location_manager_h manager, location_position_updated_cb callback, int interval, void *user_data)
+EXPORT_API int location_manager_set_position_updated_cb(location_manager_h manager, location_position_updated_cb callback, int interval, void *user_data)
{
LOCATIONS_CHECK_CONDITION(interval >= 1
&& interval <= 120, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
return __set_callback(_LOCATIONS_EVENT_TYPE_POSITION, manager, callback, user_data);
}
-int location_manager_unset_position_updated_cb(location_manager_h manager)
+EXPORT_API int location_manager_unset_position_updated_cb(location_manager_h manager)
{
return __unset_callback(_LOCATIONS_EVENT_TYPE_POSITION, manager);
}
-int location_manager_set_velocity_updated_cb(location_manager_h manager, location_velocity_updated_cb callback, int interval, void *user_data)
+EXPORT_API int location_manager_set_velocity_updated_cb(location_manager_h manager, location_velocity_updated_cb callback, int interval, void *user_data)
{
LOCATIONS_CHECK_CONDITION(interval >= 1
&& interval <= 120, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
return __set_callback(_LOCATIONS_EVENT_TYPE_VELOCITY, manager, callback, user_data);
}
-int location_manager_unset_velocity_updated_cb(location_manager_h manager)
+EXPORT_API int location_manager_unset_velocity_updated_cb(location_manager_h manager)
{
return __unset_callback(_LOCATIONS_EVENT_TYPE_VELOCITY, manager);
}
-int location_manager_set_service_state_changed_cb(location_manager_h manager, location_service_state_changed_cb callback,
+EXPORT_API int location_manager_set_service_state_changed_cb(location_manager_h manager, location_service_state_changed_cb callback,
void *user_data)
{
return __set_callback(_LOCATIONS_EVENT_TYPE_SERVICE_STATE, manager, callback, user_data);
}
-int location_manager_unset_service_state_changed_cb(location_manager_h manager)
+EXPORT_API int location_manager_unset_service_state_changed_cb(location_manager_h manager)
{
return __unset_callback(_LOCATIONS_EVENT_TYPE_SERVICE_STATE, manager);
}
-int location_manager_set_zone_changed_cb(location_manager_h manager, location_zone_changed_cb callback, void *user_data)
+EXPORT_API int location_manager_set_zone_changed_cb(location_manager_h manager, location_zone_changed_cb callback, void *user_data)
{
return __set_callback(_LOCATIONS_EVENT_TYPE_BOUNDARY, manager, callback, user_data);
}
-int location_manager_unset_zone_changed_cb(location_manager_h manager)
+EXPORT_API int location_manager_unset_zone_changed_cb(location_manager_h manager)
{
return __unset_callback(_LOCATIONS_EVENT_TYPE_BOUNDARY, manager);
}
-int location_manager_get_distance(double start_latitude, double start_longitude, double end_latitude, double end_longitude, double *distance)
+EXPORT_API int location_manager_get_distance(double start_latitude, double start_longitude, double end_latitude, double end_longitude, double *distance)
{
LOCATIONS_NULL_ARG_CHECK(distance);
LOCATIONS_CHECK_CONDITION(start_latitude>=-90 && start_latitude<=90,LOCATIONS_ERROR_INVALID_PARAMETER,"LOCATIONS_ERROR_INVALID_PARAMETER");
return LOCATIONS_ERROR_NONE;
}
-int location_manager_send_command(const char *cmd)
+EXPORT_API int location_manager_send_command(const char *cmd)
{
LOCATIONS_NULL_ARG_CHECK(cmd);
// GPS Status & Satellites
////////////////////////////////////////
-int gps_status_get_nmea(location_manager_h manager, char **nmea)
+EXPORT_API int gps_status_get_nmea(location_manager_h manager, char **nmea)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(nmea);
return LOCATIONS_ERROR_NONE;
}
-int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp)
+EXPORT_API int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(num_of_active);
return LOCATIONS_ERROR_NONE;
}
-int gps_status_set_satellite_updated_cb(location_manager_h manager, gps_status_satellite_updated_cb callback, int interval, void *user_data)
+EXPORT_API int gps_status_set_satellite_updated_cb(location_manager_h manager, gps_status_satellite_updated_cb callback, int interval, void *user_data)
{
LOCATIONS_CHECK_CONDITION(interval >= 1
&& interval <= 120, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
return __set_callback(_LOCATIONS_EVENT_TYPE_SATELLITE, manager, callback, user_data);
}
-int gps_status_unset_satellite_updated_cb(location_manager_h manager)
+EXPORT_API int gps_status_unset_satellite_updated_cb(location_manager_h manager)
{
return __unset_callback(_LOCATIONS_EVENT_TYPE_SATELLITE, manager);
}
-int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data)
+EXPORT_API int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(callback);
return LOCATIONS_ERROR_NONE;
}
-int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp)
+EXPORT_API int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp)
{
LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(num_of_active);
return LOCATIONS_ERROR_NONE;
}
-int gps_status_foreach_last_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback,
+EXPORT_API int gps_status_foreach_last_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback,
void *user_data)
{
LOCATIONS_NULL_ARG_CHECK(manager);