+# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+#
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(wfd-manager C)
+PROJECT(wifi-direct-manager C CXX)
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 gobject-2.0 dlog libnl-2.0 capi-appfw-application vconf aul libsystemd-login capi-system-info libtzplatform-config ${MDM_REQUIRED_PKGS})
-FOREACH(flag ${pkgs_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/oem
- )
-
-IF(TIZEN_ENABLE_PRD)
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/prd/include
- )
-ENDIF(TIZEN_ENABLE_PRD)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror -fPIE")
-SET(CMAKE_C_FLAGS_DEBUG "O0 -g -fPIE")
-SET(CMAKE_C_FLAGS_RELEASE "O2 -fPIE")
+SET(DAEMON "wfd-manager")
+SET(PLUGIN "wifi-direct-plugin-wpasupplicant")
SET(ARCH "${ARCHITECTURE}")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DUSE_DLOG")
+IF(TIZEN_ARCH_64)
+ ADD_DEFINITIONS(-DTIZEN_ARCH_64)
+ENDIF(TIZEN_ARCH_64)
IF(TIZEN_TETHERING_ENABLE)
- ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE)
+ ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE)
ENDIF(TIZEN_TETHERING_ENABLE)
-IF(TIZEN_ARCH_64)
- ADD_DEFINITIONS(-DTIZEN_ARCH_64)
-ENDIF(TIZEN_ARCH_64)
-
IF(TIZEN_DEBUG_DBUS_VALUE)
- ADD_DEFINITIONS(-DTIZEN_DEBUG_DBUS_VALUE)
+ ADD_DEFINITIONS(-DTIZEN_DEBUG_DBUS_VALUE)
ENDIF(TIZEN_DEBUG_DBUS_VALUE)
-SET(SRCS
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-manager.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-state.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-peer.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-group.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-session.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-event.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-service.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-asp.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-util.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-dbus.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-error.c
- ${CMAKE_SOURCE_DIR}/src/wifi-direct-iface.c
- ${CMAKE_SOURCE_DIR}/oem/wifi-direct-oem.c
- )
-
-IF(TIZEN_ENABLE_PRD)
- SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/prd/src/wifi-direct-prd.c)
-ENDIF(TIZEN_ENABLE_PRD)
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl)
-
-
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh.in ${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/dhcpd.conf.in ${CMAKE_SOURCE_DIR}/files/dhcpd.conf @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/p2p_supp.conf.in ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/p2p_supp.sh.in ${CMAKE_SOURCE_DIR}/files/p2p_supp.sh @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip.in ${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh @ONLY)
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh DESTINATION ${BIN_DIR})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.sh DESTINATION ${SBIN_DIR})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/ccode.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh DESTINATION ${BIN_DIR})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf DESTINATION ${TZ_SYS_ETC})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/dhcpd.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh DESTINATION ${BIN_DIR})
+ADD_SUBDIRECTORY(src)
IF("${ARCH}" MATCHES "^arm.*|.*86.*")
ADD_SUBDIRECTORY(plugin/wpasupplicant/ctrl_iface_dbus)
ADD_SUBDIRECTORY(prd/plugin/wpasupplicant/ctrl_iface_dbus)
ENDIF()
ENDIF(TIZEN_ENABLE_PRD)
+
+ADD_SUBDIRECTORY(files)
--- /dev/null
+# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+#
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh.in ${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/dhcpd.conf.in ${CMAKE_SOURCE_DIR}/files/dhcpd.conf @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/p2p_supp.conf.in ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/p2p_supp.sh.in ${CMAKE_SOURCE_DIR}/files/p2p_supp.sh @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip.in ${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh.in ${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh @ONLY)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/udhcp_script.non-autoip DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-server.sh DESTINATION ${BIN_DIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.sh DESTINATION ${SBIN_DIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/ccode.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/dhcpd-notify.sh DESTINATION ${BIN_DIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/p2p_supp.conf DESTINATION ${TZ_SYS_ETC})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/dhcpd.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-manager.conf DESTINATION ${TZ_SYS_RO_ETC}/wifi-direct)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/wifi-direct-dhcp.sh DESTINATION ${BIN_DIR})
Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
-Version: 1.2.257
+Version: 1.2.258
Release: 1
Group: Network & Connectivity/Wireless
License: Apache-2.0
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(wifi-direct-plugin-wpasupplicant C)
+# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+#
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/oem)
+INCLUDE_DIRECTORIES(PLUGIN_SRCS include)
+
+SET(PLUGIN_SRCS
+ wfd-plugin-wpasupplicant.c
+ dbus/wfd-plugin-supplicant-dbus.c
+ )
+
+pkg_check_modules(plugin_pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog)
-# Set required packages
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog)
-FOREACH(flag ${pkgs_CFLAGS})
+FOREACH(flag ${plugin_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/oem)
-INCLUDE_DIRECTORIES(SRCS include)
+INCLUDE_DIRECTORIES($(plugin_pkgs_INCLUDE_DIRS))
+LINK_DIRECTORIES($(plugin_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")
-SET(SRCS
- wfd-plugin-wpasupplicant.c
- dbus/wfd-plugin-supplicant-dbus.c
- )
-
# library build
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+ADD_LIBRARY(${PLUGIN} SHARED ${PLUGIN_SRCS})
+TARGET_LINK_LIBRARIES(${PLUGIN} ${plugin_pkgs_LDFLAGS})
#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
+SET_TARGET_PROPERTIES(${PLUGIN} PROPERTIES PREFIX "" OUTPUT_NAME ${PLUGIN})
# install
-INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${LIB_DIR})
+INSTALL(TARGETS ${PLUGIN} LIBRARY DESTINATION lib)
{
__WDP_LOG_FUNC_ENTER__;
wfd_oem_asp_service_s *data = NULL;
- int res = 0;
+ int res = -1;
if (!g_pd) {
WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
__WDP_LOG_FUNC_EXIT__;
- return -1;
+ return res;
}
if (!config) {
WDP_LOGE("no configurable data found");
__WDP_LOG_FUNC_EXIT__;
- return -1;
+ return res;
}
if (!g_pd->activated) {
WDP_LOGE("Wi-Fi Direct is not activated");
__WDP_LOG_FUNC_EXIT__;
- return -1;
+ return res;
}
ws_stop_scan();
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(wifi-direct-plugin-wpasupplicant C)
+# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+#
-# Set required packages
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog)
-FOREACH(flag ${pkgs_CFLAGS})
+pkg_check_modules(plugin_pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 dlog)
+
+FOREACH(flag ${plugin_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/oem)
-INCLUDE_DIRECTORIES(SRCS include)
+INCLUDE_DIRECTORIES(PLUGIN_SRCS include)
+
+SET(PLUGIN_SRCS
+ wfd-plugin-wpasupplicant-emul.c
+ )
+
+INCLUDE_DIRECTORIES($(plugin_pkgs_INCLUDE_DIRS))
+#LINK_DIRECTORIES($(plugin_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")
-SET(SRCS
- wfd-plugin-wpasupplicant-emul.c
- )
-
# library build
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+ADD_LIBRARY(${PLUGIN} SHARED ${PLUGIN_SRCS})
+TARGET_LINK_LIBRARIES(${PLUGIN} ${plugin_pkgs_LDFLAGS})
#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
+SET_TARGET_PROPERTIES(${PLUGIN} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
# install
-INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
+INSTALL(TARGETS ${PLUGIN} LIBRARY DESTINATION lib)
--- /dev/null
+# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+#
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/oem
+ )
+
+IF(TIZEN_ENABLE_PRD)
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/prd/include
+ )
+ENDIF(TIZEN_ENABLE_PRD)
+
+AUX_SOURCE_DIRECTORY(./ SRCS)
+SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/oem/wifi-direct-oem.c)
+IF(TIZEN_ENABLE_PRD)
+ SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/prd/src/wifi-direct-prd.c)
+ENDIF(TIZEN_ENABLE_PRD)
+
+PKG_CHECK_MODULES(daemon_pkgs REQUIRED capi-network-wifi-direct glib-2.0
+ gio-2.0 gobject-2.0 dlog libnl-2.0 capi-appfw-application vconf aul
+ libsystemd-login capi-system-info libtzplatform-config ${MDM_REQUIRED_PKGS})
+
+FOREACH(flag ${daemon_pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+INCLUDE_DIRECTORIES($(daemon_pkgs_INCLUDE_DIRS))
+LINK_DIRECTORIES($(daemon_pkgs_LIBRARY_DIRS))
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror -fPIE")
+SET(CMAKE_C_FLAGS_DEBUG "O0 -g -fPIE")
+SET(CMAKE_C_FLAGS_RELEASE "O2 -fPIE")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+ADD_EXECUTABLE(${DAEMON} ${SRCS})
+
+TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LDFLAGS} -ldl)
+INSTALL(TARGETS ${DAEMON} DESTINATION bin)
#include <unistd.h>
#include <time.h>
#include <errno.h>
+#include <string.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <string.h>
#include <glib.h>
*/
#include <stdlib.h>
+#include <string.h>
#include <wifi-direct.h>
#include <sys/utsname.h>
#include <time.h>
#include <errno.h>
+#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#include <string.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <glib.h>
#include "wifi-direct-util.h"
#include "wifi-direct-log.h"
-
static char *_wfd_state_string(int state)
{
switch (state) {