# Set required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(PKGS_BLE REQUIRED
+pkg_check_modules(PKGS_WIFI_LOCATION REQUIRED
dlog
gio-2.0
gio-unix-2.0
glib-2.0
ua-plugins
capi-system-info
+ capi-network-wifi-location
)
-FOREACH(flag ${PKGS_BLE_CFLAGS})
+FOREACH(flag ${PKGS_WIFI_LOCATION_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -D_FORTIFY_SOURCE=2 -O")
ENDFOREACH(flag)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-#INCLUDE_DIRECTORIES(${PKGS_INCLUDE_DIRS})
-#LINK_DIRECTORIES(${PKGS_LIBRARY_DIRS})
-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
#define __WIFI_LOCATION_PLUGIN_H__
#include <ua-plugin.h>
+#include "wifi-location.h"
#include "log.h"
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(ua-plugins)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(capi-network-wifi-location)
%if 0%{?gtests:1}
BuildRequires: pkgconfig(gmock)
-DSBIN_DIR=%{_sbindir} \
-DNETWORK_FW_DATADIR=%{NETWORK_FW_DATADIR} \
-DDBDIR=%{DBDIR} \
- -DSUPPORT_BLE_ADV=%{?leadv:1}%{!?leadv:0} \
-DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
make %{?jobs:-j%jobs}
%cmake
%install
-mkdir -p %{buildroot}{NETWORK_FW_DATADIR}/ua/lib/sensor
-cp -af *.so %{buildroot}{NETWORK_FW_DATADIR}/ua/lib/sensor
+mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/network/ua/lib/sensor
+cp -af *.so %{buildroot}/%{TZ_SYS_RO_SHARE}/network/ua/lib/sensor
%make_install
%post -p /sbin/ldconfig
#include <stdlib.h>
#include <string.h>
#include <glib.h>
-#include <system_info.h>
#include "wifi-location-plugin.h"
#include "wifi-location-plugin-util.h"
/* TODO: Check wifi location system support */
- /* TODO: Initialize wifi-location */
+ /* Initialize wifi-location */
+ ret = wifi_location_initialize();
+ retv_if_with_log(WIFI_LOCATION_ERROR_NONE != ret,
+ UAS_STATUS_FAIL, "return %d", ret);
uas_cbs = callbacks;
FUNC_EXIT;
- return ret;
+ return UAS_STATUS_SUCCESS;
}
static int deinit(void)
dev_list = NULL;
}
- /* TODO: Deinitialize wifi-location */
+ /* Deinitialize wifi-location */
+ ret = wifi_location_deinitialize();
+ retv_if_with_log(WIFI_LOCATION_ERROR_NONE != ret,
+ UAS_STATUS_FAIL, "return %d", ret);
+
uas_cbs = NULL;
FUNC_EXIT;
- return ret;
+ return UAS_STATUS_SUCCESS;
}
static int get_state(int *state)