Update dependencies 88/134588/3 submit/tizen/20170620.103311
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 19 Jun 2017 09:37:28 +0000 (18:37 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 19 Jun 2017 09:43:59 +0000 (18:43 +0900)
- Common/RPi: remove dependency with wifi-direct
- Rename TIZEN_FEATURE_RPI to TIZEN_FEATURE_HEADLESS

Change-Id: Ie1ad15e478b0b0bb1a95101d430f724121868a8b
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
15 files changed:
CMakeLists.txt
include/mobileap_bluetooth.h
include/mobileap_handler.h
include/mobileap_notification.h
include/mobileap_usb.h
packaging/mobileap-agent.spec
src/mobileap_bluetooth.c
src/mobileap_common.c
src/mobileap_handler.c
src/mobileap_main.c
src/mobileap_network.c
src/mobileap_notification.c
src/mobileap_softap.c
src/mobileap_usb.c
src/mobileap_wifi.c

index 4262db4..31fd6fa 100755 (executable)
@@ -1,20 +1,68 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(mobileap-agent C)
 
-SET(SRCS src/mobileap_softap.c
+## Default
+SET(BASE_SRCS src/mobileap_softap.c
        src/mobileap_main.c
        src/mobileap_wifi.c
+       src/mobileap_common.c
+       src/mobileap_network.c
+       src/mobileap_iptables.c
+       src/gdbus/mobileap_dbus.c
+)
+
+SET(BASE_PKGS alarm-service
+       appcore-common
+       appsvc
+       capi-network-bluetooth
+       capi-network-connection
+       capi-network-wifi-manager
+       capi-system-info
+       dbus-1
+       deviced
+       dlog
+       dpm
+       gio-2.0
+       gio-unix-2.0
+       libcrypto
+       libtzplatform-config
+       notification
+       syspopup-caller
+       key-manager
+       vconf)
+
+
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+## Redefine for COMMON
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "COMMON")
+SET(SRCS ${BASE_SRCS}
+       src/mobileap_usb.c
+       src/mobileap_bluetooth.c
+       src/mobileap_handler.c
+       src/mobileap_notification.c)
+SET(PKGS "${BASE_PKGS}")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "COMMON")
+
+## Redefine for TM1
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "TM1")
+SET(SRCS ${BASE_SRCS}
        src/mobileap_usb.c
        src/mobileap_bluetooth.c
        src/mobileap_handler.c
-       src/mobileap_common.c
        src/mobileap_notification.c
-       src/mobileap_network.c
-       src/mobileap_iptables.c
        src/mobileap_p2p.c
        src/mobileap_wfd.c
-       src/gdbus/mobileap_dbus.c
 )
+SET(PKGS "${BASE_PKGS} capi-network-wifi-direct")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "TM1")
+
+## Redefine for RPI
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "RPI")
+SET(SRCS ${BASE_SRCS})
+SET(PKGS "${BASE_PKGS}")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "RPI")
+
 
 SET(CMAKE_INSTALL_PREFIX /usr)
 
@@ -23,18 +71,11 @@ SET(APP_NAME mobileap-agent)
 SET(APP_DIR ${CMAKE_INSTALL_PREFIX}/bin)
 SET(INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
 
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
 INCLUDE_DIRECTORIES(${INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED gio-2.0 gio-unix-2.0 dbus-1 dlog  deviced vconf notification capi-network-connection capi-network-bluetooth syspopup-caller
-               appcore-common capi-network-wifi-manager capi-network-wifi-direct alarm-service appsvc libcrypto key-manager libtzplatform-config dpm
-               capi-system-info)
+pkg_check_modules(pkgs REQUIRED ${PKGS})
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -72,9 +113,13 @@ IF(TIZEN_FEATURE_ENABLE_IPV6)
        ADD_DEFINITIONS(-DTIZEN_FEATURE_ENABLE_IPV6)
 ENDIF(TIZEN_FEATURE_ENABLE_IPV6)
 
-IF(TIZEN_FEATURE_RPI)
-       ADD_DEFINITIONS(-DTIZEN_FEATURE_RPI)
-ENDIF(TIZEN_FEATURE_RPI)
+IF(TIZEN_FEATURE_HEADLESS)
+       ADD_DEFINITIONS(-DTIZEN_FEATURE_HEADLESS)
+ENDIF(TIZEN_FEATURE_HEADLESS)
+
+IF(TIZEN_FEATURE_ENABLE_WIFI_DIRECT)
+       ADD_DEFINITIONS(-DTIZEN_FEATURE_ENABLE_WIFI_DIRECT)
+ENDIF(TIZEN_FEATURE_ENABLE_WIFI_DIRECT)
 
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -pie")
 
index 5baaf6a..049b674 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __MOBILEAP_BLUETOOTH_H__
 #define __MOBILEAP_BLUETOOTH_H__
 
-#ifndef TIZEN_FEATURE_RPI
 #include "mobileap_softap.h"
 
 #define PS_RECHECK_INTERVAL 500
@@ -31,5 +30,4 @@ gboolean tethering_enable_bt_tethering(Tethering *obj,
                GDBusMethodInvocation *context, mobile_ap_address_type_e address_type);
 gboolean tethering_disable_bt_tethering(Tethering *obj,
                GDBusMethodInvocation *context, mobile_ap_address_type_e address_type);
-#endif
 #endif /* __MOBILEAP_BLUETOOTH_H__ */
index d644d31..2296a66 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __MOBILEAP_HANDLER_H__
 #define __MOBILEAP_HANDLER_H__
 
-#ifndef TIZEN_FEATURE_RPI
 #include <time.h>
 #include <alarm.h>
 
@@ -36,4 +35,3 @@ void _start_timeout_cb(mobile_ap_type_e type, time_t end_time);
 void _stop_timeout_cb(mobile_ap_type_e type);
 void _deinit_timeout_cb(mobile_ap_type_e type);
 #endif
-#endif
index 8ca6bd1..ea74e5a 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __MOBILEAP_NOTIFICATION_H__
 #define __MOBILEAP_NOTIFICATION_H__
 
-#ifndef TIZEN_FEATURE_RPI
 #include <appcore-common.h>
 #include <notification.h>
 #include <tzplatform_config.h>
@@ -58,4 +57,3 @@ void _create_tethering_active_noti(void);
 void _create_bt_tethering_active_noti(void);
 void _create_security_restriction_noti(mobile_ap_type_e type);
 #endif
-#endif
index 65d2877..80d14ba 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __MOBILEAP_USB_H__
 #define __MOBILEAP_USB_H__
 
-#ifndef TIZEN_FEATURE_RPI
 #include "mobileap_softap.h"
 
 void __handle_usb_disconnect_cb(keynode_t *key, void *data);
@@ -28,5 +27,4 @@ gboolean tethering_enable_usb_tethering(Tethering *obj,
                                                GDBusMethodInvocation *context);
 gboolean tethering_disable_usb_tethering(Tethering *obj,
                                                GDBusMethodInvocation *context);
-#endif
 #endif /* __MOBILEAP_USB_H__ */
index 5f7d37a..33c0d9e 100644 (file)
@@ -1,6 +1,6 @@
 Name: mobileap-agent
 Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.98
+Version: 1.0.99
 Release: 1
 Group: System/Network
 License: Apache-2.0
@@ -19,7 +19,6 @@ BuildRequires: pkgconfig(capi-network-bluetooth)
 BuildRequires: pkgconfig(syspopup-caller)
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(appcore-common)
-BuildRequires: pkgconfig(capi-network-wifi-direct)
 BuildRequires: pkgconfig(capi-network-wifi-manager)
 BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(alarm-service)
@@ -39,6 +38,7 @@ Mobile AP daemon for setting tethering environments
 %ifarch %{arm}
 %package extension-TM1
 Summary: Extension for mobile TM1
+BuildRequires: pkgconfig(capi-network-wifi-direct)
 Requires: %{name} = %{version}-%{release}
 %description extension-TM1
 Mobile AP daemon for setting tethering environments for mobile TM1
@@ -61,11 +61,13 @@ export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
 %ifarch %{arm}
 # Build for TM1
-%cmake -DCMAKE_BUILD_TYPE="" \
-       -DTIZEN_FEATURE_MULTICAST=1 \
-       -DTIZEN_FEATURE_WLAN_BOARD_SPRD=1 \
-       -DTIZEN_FEATURE_ENABLE_IPV6=1 \
-       .
+%cmake -DCMAKE_BUILD_TYPE="TM1" \
+   -DTIZEN_FEATURE_ENABLE_IPV6=1 \
+   -DTIZEN_FEATURE_ENABLE_WIFI_DIRECT=1 \
+   -DTIZEN_FEATURE_HEADLESS=0 \
+   -DTIZEN_FEATURE_MULTICAST=1 \
+   -DTIZEN_FEATURE_WLAN_BOARD_SPRD=1 \
+.
 
 %make_install
 mv %{buildroot}%{_bindir}/mobileap-agent %{_builddir}/%{name}-%{version}/mobileap-agent.tm1
@@ -73,9 +75,12 @@ mv %{buildroot}%{_bindir}/mobileap-agent %{_builddir}/%{name}-%{version}/mobilea
 make %{?jobs:-j%jobs}
 
 # Build for RPi
-%cmake -DCMAKE_BUILD_TYPE="" \
+%cmake -DCMAKE_BUILD_TYPE="RPI" \
+       -DTIZEN_FEATURE_ENABLE_IPV6=0 \
+       -DTIZEN_FEATURE_ENABLE_WIFI_DIRECT=0 \
+       -DTIZEN_FEATURE_HEADLESS=1 \
        -DTIZEN_FEATURE_MULTICAST=1 \
-       -DTIZEN_FEATURE_RPI=1 \
+       -DTIZEN_FEATURE_WLAN_BOARD_SPRD=0 \
        .
 
 %make_install
@@ -85,9 +90,12 @@ make %{?jobs:-j%jobs}
 %endif
 
 # Build for Common
-%cmake -DCMAKE_BUILD_TYPE="" \
-       -DTIZEN_FEATURE_MULTICAST=1 \
+%cmake -DCMAKE_BUILD_TYPE="COMMON" \
        -DTIZEN_FEATURE_ENABLE_IPV6=1 \
+       -DTIZEN_FEATURE_ENABLE_WIFI_DIRECT=0 \
+       -DTIZEN_FEATURE_HEADLESS=0 \
+       -DTIZEN_FEATURE_MULTICAST=1 \
+       -DTIZEN_FEATURE_WLAN_BOARD_SPRD=0 \
        .
 
 make %{?jobs:-j%jobs}
@@ -113,14 +121,12 @@ cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.MobileapA
 
 %post
 /bin/chmod +x /opt/etc/dump.d/module.d/tethering_dump.sh
-#/usr/sbin/setcap cap_dac_override,cap_fowner,cap_net_bind_service,cap_net_admin,cap_net_raw+eip /usr/bin/mobileap-agent
 
 %ifarch %{arm}
 %post extension-TM1
 pushd %{_bindir}
 mv mobileap-agent.tm1 mobileap-agent
 popd
-#/usr/sbin/setcap cap_dac_override,cap_fowner,cap_net_bind_service,cap_net_admin,cap_net_raw+eip /usr/bin/mobileap-agent
 %preun extension-TM1
 rm %{_bindir}/mobileap-agent
 
index f606a59..935b3f4 100755 (executable)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#ifndef TIZEN_FEATURE_RPI
 #include <stdio.h>
 #include <glib.h>
 #include <dbus/dbus.h>
@@ -947,4 +946,3 @@ static void __bt_nap_ipv6_connection_changed(bool connected, const char *remote_
        return;
 }
 #endif /* TIZEN_FEATURE_ENABLE_IPV6 */
-#endif /* TIZEN_FEATURE_RPI */
index bf3b85a..b57ffcc 100755 (executable)
@@ -26,7 +26,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <dbus/dbus.h>
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
 #include <dpm/device-policy-manager.h>
 #include <dpm/restriction.h>
 #endif
@@ -39,7 +39,7 @@
 
 static GSList *station_list = NULL;
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
 /* DPM */
 device_policy_manager_h dpm = NULL;
 int wifi_tethering_id = 0;
@@ -105,10 +105,12 @@ void _send_dbus_station_info(const char *member, mobile_ap_station_info_t *info)
 void _update_station_count(int count)
 {
        static int prev_cnt = 0;
+#ifndef TIZEN_FEATURE_HEADLESS
        int wifi_count = 0;
        int bt_count = 0;
        int usb_count = 0;
        mobile_ap_type_e type;
+#endif
 
        if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI_AP))
                return;
@@ -122,11 +124,10 @@ void _update_station_count(int count)
                return;
        }
 
+#ifndef TIZEN_FEATURE_HEADLESS
        if (count == 0) {
                prev_cnt = 0;
-#ifndef TIZEN_FEATURE_RPI
                _delete_connected_noti();
-#endif
                return;
        }
 
@@ -145,13 +146,12 @@ void _update_station_count(int count)
        else
                type = MOBILE_AP_TYPE_MAX;
 
-#ifndef TIZEN_FEATURE_RPI
        if (prev_cnt == 0)
                _create_connected_noti(type, count);
        else
                _update_connected_noti(type, count);
-#endif
        prev_cnt = count;
+#endif
        return;
 }
 
@@ -618,7 +618,7 @@ int _get_tethering_type_from_ip(const char *ip, mobile_ap_type_e *type)
        return MOBILE_AP_ERROR_INVALID_PARAM;
 }
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
 static void __policy_chnaged_cb(const char *name, const char *value, void *data)
 {
        Tethering *obj = _get_tethering_obj();
index 7aa6dc0..32bf045 100644 (file)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#ifndef TIZEN_FEATURE_RPI
 #include <glib.h>
 #include <dbus/dbus.h>
 #include <stdlib.h>
@@ -483,4 +482,3 @@ void _deinit_timeout_cb(mobile_ap_type_e type)
        DBG("-\n");
        return;
 }
-#endif
index 125b755..0d2255e 100755 (executable)
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
 #include <dd-display.h>
 #endif
 #include <vconf.h>
 #include <net_connection.h>
 #include <appcore-common.h>
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
 #include <alarm.h>
 #endif
 
@@ -176,7 +176,7 @@ gboolean _terminate_mobileap_agent(gpointer user_data)
                return FALSE;
        }
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (_is_trying_bt_operation()) {
                DBG("BT operation is going on\n");
                return FALSE;
@@ -188,10 +188,12 @@ gboolean _terminate_mobileap_agent(gpointer user_data)
        }
 #endif
 
+#ifdef TIZZEN_FEATURE_WIFI_DIRECT
        if (_is_trying_p2p_operation()) {
                DBG("P2P operation is going on\n");
                return FALSE;
        }
+#endif
 
        DBG("All tethering / AP's are turned off\n");
        g_main_loop_quit(mainloop);
@@ -202,7 +204,7 @@ gboolean _terminate_mobileap_agent(gpointer user_data)
 
 void _block_device_sleep(void)
 {
-#ifdef TIZEN_FEATURE_RPI
+#ifdef TIZEN_FEATURE_HEADLESS
        return;
 #else
        int ret = 0;
@@ -217,7 +219,7 @@ void _block_device_sleep(void)
 
 void _unblock_device_sleep(void)
 {
-#ifdef TIZEN_FEATURE_RPI
+#ifdef TIZEN_FEATURE_HEADLESS
        return;
 #else
        int ret = 0;
@@ -339,7 +341,7 @@ gboolean tethering_disable(Tethering *obj, GDBusMethodInvocation *context)
        else
                _disable_wifi_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV4);
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (_mobileap_get_ipv6_state(MOBILE_AP_STATE_BT))
                _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV6);
        else
@@ -518,7 +520,9 @@ static void __handle_dnsmasq_dhcp_status_changed_cb(GDBusConnection *connection,
        char *ip_addr = NULL;
        char *mac = NULL;
        char *name = NULL;
+#ifndef TIZEN_FEATURE_HEADLESS
        char *bt_remote_device_name = NULL;
+#endif
        mobile_ap_type_e type = MOBILE_AP_TYPE_MAX;
        mobile_ap_station_info_t *info = NULL;
        int n_station = 0;
@@ -561,7 +565,7 @@ static void __handle_dnsmasq_dhcp_status_changed_cb(GDBusConnection *connection,
                        else
                                info->hostname = g_strdup(name);
                }
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                else if (type == MOBILE_AP_TYPE_BT) {
                        _bt_get_remote_device_name(mac, &bt_remote_device_name);
                        if (bt_remote_device_name == NULL)
@@ -583,7 +587,7 @@ static void __handle_dnsmasq_dhcp_status_changed_cb(GDBusConnection *connection,
 
                _get_station_count((gconstpointer)type,
                                _slist_find_station_by_interface, &n_station);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                if (n_station == 1)
                        _stop_timeout_cb(type);
 #endif
@@ -632,7 +636,7 @@ static void on_bus_acquired_cb(GDBusConnection *connection, const gchar *name,
        } else {
                DBG("Export sucessss");
        }
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        g_signal_connect(tethering_obj, "handle-enable-wifi-tethering",
                        G_CALLBACK(tethering_enable_wifi_tethering), NULL);
        g_signal_connect(tethering_obj, "handle-enable-bt-tethering",
@@ -691,11 +695,12 @@ static void on_bus_acquired_cb(GDBusConnection *connection, const gchar *name,
                        G_CALLBACK(tethering_push_wps_button), NULL);
 
        /* For P2P Tethering */
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
        g_signal_connect(tethering_obj, "handle-enable-p2p-tethering",
                        G_CALLBACK(tethering_p2p_enable), NULL);
        g_signal_connect(tethering_obj, "handle-disable-p2p-tethering",
                        G_CALLBACK(tethering_p2p_disable), NULL);
-
+#endif
 #endif
 
        g_signal_connect(softap_obj, "handle-enable",
@@ -712,7 +717,7 @@ static void on_bus_acquired_cb(GDBusConnection *connection, const gchar *name,
                        G_CALLBACK(softap_push_wps_button), NULL);
 
        _init_network((void *)tethering_obj);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _register_vconf_cb((void *)tethering_obj);
 #endif
 
@@ -799,7 +804,7 @@ int main(int argc, char **argv)
        }
 
        /* Platform modules */
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (appcore_set_i18n(MOBILEAP_LOCALE_COMMON_PKG, MOBILEAP_LOCALE_COMMON_RES) < 0)
                ERR("appcore_set_i18n is failed\n");
 #endif
@@ -811,7 +816,7 @@ int main(int argc, char **argv)
 
        _register_wifi_station_handler();
        _init_wifi_manager();
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        ret = alarmmgr_init(APPNAME);
        if (ret != ALARMMGR_RESULT_SUCCESS) {
                ERR("alarmmgr_init(%s) is failed : %d\n", APPNAME, ret);
@@ -825,13 +830,13 @@ int main(int argc, char **argv)
 #endif
        g_main_loop_run(mainloop);
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _deinit_dpm();
 
        alarmmgr_fini();
 #endif
        _deinit_wifi_manager();
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _unregister_vconf_cb();
 #endif
        _unregister_wifi_station_handler();
index 12314b5..0b9748c 100644 (file)
@@ -376,7 +376,7 @@ static void __handle_open_network_error(void)
                _disable_wifi_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV4);
        DBG("_disable_wifi_tethering returns %d\n", ret);
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (_mobileap_get_ipv6_state(MOBILE_AP_STATE_BT))
                ret = _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV6);
        else
index bceeff3..49f4a35 100644 (file)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#ifndef TIZEN_FEATURE_RPI
 #include <glib.h>
 #include <dbus/dbus.h>
 #include <stdio.h>
@@ -586,4 +585,3 @@ void _create_security_restriction_noti(mobile_ap_type_e type)
 
        return;
 }
-#endif
index eacb3bf..260a308 100755 (executable)
@@ -62,10 +62,6 @@ static guint hostapd_io_source = 0;
 static char dns_addr[INET_ADDRSTRLEN] = "0.0.0.0";
 GSList *sta_timer_list = NULL;
 
-#if TIZEN_FEATURE_WLAN_BOARD_SPRD
-static char *saved_wifi_if_addr = NULL;
-#endif
-
 #ifdef TIZEN_FEATURE_ENABLE_IPV6
 static pid_t nat64_pid = 0;
 static pid_t dns64_pid = 0;
@@ -173,7 +169,7 @@ static int __execute_hostapd(const mobile_ap_type_e type, const char *ssid,
        else
                hw_mode = g_strdup(mode);
 
-#ifdef TIZEN_FEATURE_RPI
+#ifdef TIZEN_FEATURE_HEADLESS
        snprintf(buf, sizeof(buf), HOSTAPD_RPI_CONF,
                        WIFI_IF,
                        HOSTAPD_CTRL_INTF_DIR,
@@ -684,7 +680,7 @@ static gboolean __hostapd_monitor_cb(GIOChannel *source)
        _get_station_count((gconstpointer)type,
                        _slist_find_station_by_interface, &n_station);
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (n_station == 0) {
                if (type == MOBILE_AP_TYPE_WIFI)
                        _start_timeout_cb(type, time(NULL) + TETHERING_CONN_TIMEOUT);
@@ -1874,7 +1870,7 @@ static gboolean __send_station_event_cb(gpointer data)
 
                _get_station_count((gconstpointer)type,
                                _slist_find_station_by_interface, &n_station);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                if (n_station == 0) {
                        if (type == MOBILE_AP_TYPE_WIFI)
                                _start_timeout_cb(type, time(NULL) + TETHERING_CONN_TIMEOUT);
@@ -1994,7 +1990,7 @@ SUCCESS:
 
        _get_station_count((gconstpointer)type,
                        _slist_find_station_by_interface, &n_station);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (n_station == 1)
                _stop_timeout_cb(type);
 #endif
index 60a110e..4f5304a 100755 (executable)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#ifndef TIZEN_FEATURE_RPI
 #include <glib.h>
 #include <dbus/dbus.h>
 #include <stdio.h>
@@ -468,4 +467,3 @@ gboolean _is_trying_usb_operation(void)
 {
        return (g_context ? TRUE : FALSE || in_progress);
 }
-#endif
index 651409c..0b2fb1a 100755 (executable)
@@ -21,7 +21,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include <wifi-manager.h>
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
 #include <wifi-direct.h>
+#endif
 #include <ckmc/ckmc-manager.h>
 
 #include "mobileap.h"
@@ -77,6 +79,7 @@ softap_settings_t *_get_softap_settings()
        return &obj_softap_settings;
 }
 
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
 static void _wifi_direct_state_cb(int error_code, wifi_direct_device_state_e state, void *user_data)
 {
        bool wifi_state = false;
@@ -125,7 +128,7 @@ static void _wifi_direct_state_cb(int error_code, wifi_direct_device_state_e sta
                        ERR("_enable_wifi_tethering is failed\n");
                } else {
                        tethering_emit_wifi_on((Tethering *)obj);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                        _create_tethering_active_noti();
 #endif
                }
@@ -155,6 +158,7 @@ DONE:
        DBG("-\n");
        return;
 }
+#endif
 
 static void __wifi_manager_activated_cb(wifi_manager_error_e result, void *user_data)
 {
@@ -192,7 +196,7 @@ static void __wifi_manager_deactivated_cb(wifi_manager_error_e result, void *use
                } else {
                        prev_wifi_on = TRUE;
                        tethering_emit_wifi_on(obj);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                        _create_tethering_active_noti();
 #endif
                }
@@ -271,6 +275,7 @@ static int __turn_on_wifi(void)
        return MOBILE_AP_ERROR_NONE;
 }
 
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
 static gboolean __is_wifi_direct_on(void)
 {
        int wifi_direct_state = 0;
@@ -315,6 +320,7 @@ static int __turn_off_wifi_direct(void *obj)
 
        return MOBILE_AP_ERROR_NONE;
 }
+#endif
 
 static mobile_ap_error_code_e __update_softap_settings(softap_settings_t *st,
        gchar *ssid, gchar *passphrase, gchar* mode, gint channel, int hide_mode,
@@ -433,7 +439,7 @@ mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
                return ret;
        }
        tethering_emit_wifi_on(obj);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _create_tethering_active_noti();
 #endif
 
@@ -554,7 +560,7 @@ mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
                _mobileap_clear_state(MOBILE_AP_STATE_WIFI);
                goto DONE;
        }
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _delete_timeout_noti();
        _init_timeout_cb(MOBILE_AP_TYPE_WIFI, (void *)obj);
        _start_timeout_cb(MOBILE_AP_TYPE_WIFI, time(NULL) + TETHERING_CONN_TIMEOUT);
@@ -598,7 +604,7 @@ mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj, mobile_ap_address
        }
 
        _flush_ip_address(WIFI_IF);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _deinit_timeout_cb(type);
 #endif
 
@@ -700,7 +706,7 @@ mobile_ap_error_code_e _enable_soft_ap(Softap *obj,
                goto DONE;
        }
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _delete_timeout_noti();
        _init_timeout_cb(MOBILE_AP_TYPE_WIFI_AP, (void *)obj);
        _start_timeout_cb(MOBILE_AP_TYPE_WIFI_AP, time(NULL) + WIFI_AP_CONN_TIMEOUT);
@@ -738,7 +744,7 @@ mobile_ap_error_code_e _disable_soft_ap(Softap *obj)
        _del_routing_rule(WIFI_IF);
        _del_interface_routing(WIFI_IF, IP_ADDRESS_SOFTAP);
        _flush_ip_address(WIFI_IF);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        _deinit_timeout_cb(type);
 #endif
        if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE)
@@ -830,7 +836,7 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
        }
        g_context = context;
 
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
        if (!_is_allowed(MOBILE_AP_TYPE_WIFI)) {
                DBG("DPM policy restricts Wi-Fi tethering\n");
                ret = MOBILE_AP_ERROR_NOT_PERMITTED;
@@ -869,6 +875,7 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
                prev_wifi_on = TRUE;
        }
 
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
        if (__is_wifi_direct_on() == TRUE) {
                DBG("Wi-Fi and Wi-Fi direct are turned on\n");
                if (__turn_off_wifi_direct(obj) != MOBILE_AP_ERROR_NONE) {
@@ -879,6 +886,7 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
 
                return TRUE;
        }
+#endif
 
        wifi_manager_is_activated(wifi_manager, &wifi_state);
        if (wifi_state == true) {
@@ -899,7 +907,7 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
                ERR("_enable_wifi_tethering is failed\n");
        } else {
                tethering_emit_wifi_on(obj);
-#ifndef TIZEN_FEATURE_RPI
+#ifndef TIZEN_FEATURE_HEADLESS
                _create_tethering_active_noti();
 #endif
                ret_val = TRUE;
@@ -1290,6 +1298,7 @@ gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context,
                wifi_recovery_timeout_id = 0;
        }
 
+#ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
        if (__is_wifi_direct_on() == TRUE) {
                DBG("Wi-Fi and Wi-Fi direct are turned on\n");
                if (__turn_off_wifi_direct(obj) != MOBILE_AP_ERROR_NONE) {
@@ -1300,6 +1309,7 @@ gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context,
 
                return TRUE;
        }
+#endif
 
        wifi_manager_is_activated(wifi_manager, &wifi_state);
        if (wifi_state == true) {