From: Seonah Moon Date: Thu, 6 Apr 2017 04:59:07 +0000 (+0900) Subject: Removed dependencies for RPi3 X-Git-Tag: accepted/tizen/unified/20170406.173406^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F123549%2F2;p=platform%2Fcore%2Fconnectivity%2Fmobileap-agent.git Removed dependencies for RPi3 Change-Id: Ic51c97d12fcca34cdccb791abff3d8b826539e89 Signed-off-by: Seonah Moon --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c0ca37..973faa6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,10 @@ 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) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -pie") ADD_CUSTOM_COMMAND( diff --git a/include/mobileap_bluetooth.h b/include/mobileap_bluetooth.h index f232394..5baaf6a 100644 --- a/include/mobileap_bluetooth.h +++ b/include/mobileap_bluetooth.h @@ -18,6 +18,7 @@ #ifndef __MOBILEAP_BLUETOOTH_H__ #define __MOBILEAP_BLUETOOTH_H__ +#ifndef TIZEN_FEATURE_RPI #include "mobileap_softap.h" #define PS_RECHECK_INTERVAL 500 @@ -26,9 +27,9 @@ void _bt_get_remote_device_name(const char *mac, char **name); mobile_ap_error_code_e _disable_bt_tethering(Tethering *obj, mobile_ap_address_type_e address_type); gboolean _is_trying_bt_operation(void); - 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__ */ diff --git a/include/mobileap_handler.h b/include/mobileap_handler.h index f221dce..d644d31 100644 --- a/include/mobileap_handler.h +++ b/include/mobileap_handler.h @@ -18,6 +18,7 @@ #ifndef __MOBILEAP_HANDLER_H__ #define __MOBILEAP_HANDLER_H__ +#ifndef TIZEN_FEATURE_RPI #include #include @@ -34,5 +35,5 @@ void _init_timeout_cb(mobile_ap_type_e type, void *user_data); 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 diff --git a/include/mobileap_notification.h b/include/mobileap_notification.h index ea74e5a..8ca6bd1 100644 --- a/include/mobileap_notification.h +++ b/include/mobileap_notification.h @@ -18,6 +18,7 @@ #ifndef __MOBILEAP_NOTIFICATION_H__ #define __MOBILEAP_NOTIFICATION_H__ +#ifndef TIZEN_FEATURE_RPI #include #include #include @@ -57,3 +58,4 @@ 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 diff --git a/include/mobileap_softap.h b/include/mobileap_softap.h index 20d1c5e..52dd8f2 100755 --- a/include/mobileap_softap.h +++ b/include/mobileap_softap.h @@ -146,7 +146,7 @@ #define HOSTAPD_WPS_DEVICE_TYPE "6-0050F204-1" #define HOSTPAD_WPS_CONFIG_METHODS "label virtual_display virtual_push_button keypad" -#ifndef TIZEN_FEATURE_WLAN_BOARD_SPRD + #define HOSTAPD_CONF "interface=%s\n" \ "driver=nl80211\n" \ "ctrl_interface=%s\n" \ @@ -159,20 +159,6 @@ "accept_mac_file=%s\n" \ "deny_mac_file=%s\n" \ "ieee80211n=1\n" -#else -#define HOSTAPD_CONF "interface=%s\n" \ - "driver=nl80211\n" \ - "ctrl_interface=%s\n" \ - "ssid=%s\n" \ - "channel=%d\n" \ - "ignore_broadcast_ssid=%d\n" \ - "hw_mode=%s\n" \ - "max_num_sta=%d\n" \ - "macaddr_acl=%d\n" \ - "accept_mac_file=%s\n" \ - "deny_mac_file=%s\n" \ - "ieee80211n=1\n" \ - "wowlan_triggers=any\n" #define HOSTAPD_WPS_CONF "interface=%s\n" \ "driver=nl80211\n" \ @@ -195,7 +181,17 @@ "wpa=2\n" \ "rsn_pairwise=CCMP\n" \ "wpa_psk=%s\n" -#endif + +#define HOSTAPD_RPI_CONF "interface=%s\n" \ + "driver=nl80211\n" \ + "ctrl_interface=%s\n" \ + "ssid=%s\n" \ + "channel=%d\n" \ + "ignore_broadcast_ssid=%d\n" \ + "hw_mode=%s\n" \ + "max_num_sta=%d\n" \ + "ieee80211n=1\n" + #define HOSTAPD_DEBUG_FILE "/var/log/hostapd.log" #define HOSTAPD_REQ_MAX_LEN 128 diff --git a/include/mobileap_usb.h b/include/mobileap_usb.h index deff959..65d2877 100644 --- a/include/mobileap_usb.h +++ b/include/mobileap_usb.h @@ -18,14 +18,15 @@ #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); mobile_ap_error_code_e _disable_usb_tethering(Tethering *obj); gboolean _is_trying_usb_operation(void); - gboolean tethering_enable_usb_tethering(Tethering *obj, GDBusMethodInvocation *context); gboolean tethering_disable_usb_tethering(Tethering *obj, GDBusMethodInvocation *context); +#endif #endif /* __MOBILEAP_USB_H__ */ diff --git a/packaging/mobileap-agent.spec b/packaging/mobileap-agent.spec index ef35481..1ebfd50 100644 --- a/packaging/mobileap-agent.spec +++ b/packaging/mobileap-agent.spec @@ -1,6 +1,6 @@ Name: mobileap-agent Summary: Mobile AP daemon for setting tethering environments -Version: 1.0.87 +Version: 1.0.88 Release: 1 Group: System/Network License: Apache-2.0 @@ -37,13 +37,18 @@ Requires: dnsmasq %description Mobile AP daemon for setting tethering environments -%ifarch %{arm} %package extension-TM1 Summary: Extension for mobile TM1 Requires: %{name} = %{version}-%{release} %description extension-TM1 Mobile AP daemon for setting tethering environments for mobile TM1 -%endif + +%package extension-RPi +Summary: Extension for mobile RPi +Requires: %{name} = %{version}-%{release} +%description extension-RPi +Mobile AP daemon for setting tethering environments for mobile RPi + %prep %setup -q @@ -54,7 +59,6 @@ export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" -%ifarch %{arm} # Build for TM1 %cmake -DCMAKE_BUILD_TYPE="" \ -DTIZEN_FEATURE_MULTICAST=1 \ @@ -66,9 +70,19 @@ export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" mv %{buildroot}%{_bindir}/mobileap-agent %{_builddir}/%{name}-%{version}/mobileap-agent.tm1 make %{?jobs:-j%jobs} -%endif -# Build for non-TM1 +# Build for RPi +%cmake -DCMAKE_BUILD_TYPE="" \ + -DTIZEN_FEATURE_MULTICAST=1 \ + -DTIZEN_FEATURE_RPI=1 \ + . + +%make_install +mv %{buildroot}%{_bindir}/mobileap-agent %{_builddir}/%{name}-%{version}/mobileap-agent.rpi + +make %{?jobs:-j%jobs} + +# Build for Common %cmake -DCMAKE_BUILD_TYPE="" \ -DTIZEN_FEATURE_MULTICAST=1 \ -DTIZEN_FEATURE_ENABLE_IPV6=1 \ @@ -79,9 +93,8 @@ make %{?jobs:-j%jobs} %install %make_install -%ifarch %{arm} mv %{_builddir}/%{name}-%{version}/mobileap-agent.tm1 %{buildroot}%{_bindir} -%endif +mv %{_builddir}/%{name}-%{version}/mobileap-agent.rpi %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d cp mobileap-agent.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/mobileap-agent.conf @@ -98,7 +111,6 @@ cp %{SOURCE2} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.MobileapA /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 @@ -106,7 +118,13 @@ 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 -%endif + +%post extension-RPi +pushd %{_bindir} +mv mobileap-agent.rpi mobileap-agent +popd +%preun extension-RPi +rm %{_bindir}/mobileap-agent %files %manifest mobileap-agent.manifest @@ -121,9 +139,10 @@ rm %{_bindir}/mobileap-agent /opt/etc/dump.d/module.d/tethering_dump.sh %license LICENSE.APLv2.0 -%ifarch %{arm} %files extension-TM1 %defattr(-,root,root,-) %{_bindir}/mobileap-agent.tm1 -%endif +%files extension-RPi +%defattr(-,root,root,-) +%{_bindir}/mobileap-agent.rpi diff --git a/src/mobileap_bluetooth.c b/src/mobileap_bluetooth.c index d5bc13d..1c5f78e 100755 --- a/src/mobileap_bluetooth.c +++ b/src/mobileap_bluetooth.c @@ -15,6 +15,7 @@ * limitations under the License. */ +#ifndef TIZEN_FEATURE_RPI #include #include #include @@ -941,4 +942,5 @@ static void __bt_nap_ipv6_connection_changed(bool connected, const char *remote_ DBG("-"); return; } -#endif +#endif /* TIZEN_FEATURE_ENABLE_IPV6 */ +#endif /* TIZEN_FEATURE_RPI */ diff --git a/src/mobileap_common.c b/src/mobileap_common.c index fa2b275..bf3b85a 100755 --- a/src/mobileap_common.c +++ b/src/mobileap_common.c @@ -26,8 +26,10 @@ #include #include #include +#ifndef TIZEN_FEATURE_RPI #include #include +#endif #include "mobileap_common.h" #include "mobileap_wifi.h" @@ -37,6 +39,7 @@ static GSList *station_list = NULL; +#ifndef TIZEN_FEATURE_RPI /* DPM */ device_policy_manager_h dpm = NULL; int wifi_tethering_id = 0; @@ -45,6 +48,7 @@ int usb_tethering_id = 0; static bool allow_wifi_tethering = true; static bool allow_bt_tethering = true; static bool allow_usb_tethering = true; +#endif gint _slist_find_station_by_interface(gconstpointer a, gconstpointer b) { @@ -120,7 +124,9 @@ void _update_station_count(int count) if (count == 0) { prev_cnt = 0; +#ifndef TIZEN_FEATURE_RPI _delete_connected_noti(); +#endif return; } @@ -139,11 +145,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; return; } @@ -611,6 +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 static void __policy_chnaged_cb(const char *name, const char *value, void *data) { Tethering *obj = _get_tethering_obj(); @@ -718,3 +726,4 @@ void _deinit_dpm(void) dpm_remove_policy_changed_cb(dpm, usb_tethering_id); dpm_manager_destroy(dpm); } +#endif diff --git a/src/mobileap_handler.c b/src/mobileap_handler.c index c0f6df3..902e370 100644 --- a/src/mobileap_handler.c +++ b/src/mobileap_handler.c @@ -15,6 +15,7 @@ * limitations under the License. */ +#ifndef TIZEN_FEATURE_RPI #include #include #include @@ -486,3 +487,4 @@ void _deinit_timeout_cb(mobile_ap_type_e type) DBG("-\n"); return; } +#endif diff --git a/src/mobileap_main.c b/src/mobileap_main.c index 8208af2..fcb24a0 100755 --- a/src/mobileap_main.c +++ b/src/mobileap_main.c @@ -23,12 +23,17 @@ #include #include #include +#ifndef TIZEN_FEATURE_RPI #include +#endif #include #include #include #include + +#ifndef TIZEN_FEATURE_RPI #include +#endif #include "mobileap_softap.h" #include "mobileap_handler.h" @@ -164,6 +169,7 @@ gboolean _terminate_mobileap_agent(gpointer user_data) return FALSE; } +#ifndef TIZEN_FEATURE_RPI if (_is_trying_bt_operation()) { DBG("BT operation is going on\n"); return FALSE; @@ -173,7 +179,7 @@ gboolean _terminate_mobileap_agent(gpointer user_data) DBG("USB operation is going on\n"); return FALSE; } - +#endif DBG("All tethering / AP's are turned off\n"); g_main_loop_quit(mainloop); mainloop = NULL; @@ -183,6 +189,9 @@ gboolean _terminate_mobileap_agent(gpointer user_data) void _block_device_sleep(void) { +#ifdef TIZEN_FEATURE_RPI + return; +#else int ret = 0; ret = display_lock_state(LCD_OFF, STAY_CUR_STATE, 0); @@ -190,10 +199,14 @@ void _block_device_sleep(void) ERR("PM control [ERROR] result = %d\n", ret); else DBG("PM control [SUCCESS]\n"); +#endif } void _unblock_device_sleep(void) { +#ifdef TIZEN_FEATURE_RPI + return; +#else int ret = 0; ret = display_unlock_state(LCD_OFF, PM_SLEEP_MARGIN); @@ -201,6 +214,7 @@ void _unblock_device_sleep(void) ERR("PM control [ERROR] result = %d\n", ret); else DBG("PM control [SUCCESS]\n"); +#endif } int _init_tethering(mobile_ap_address_type_e address_type) @@ -310,12 +324,14 @@ gboolean tethering_disable(Tethering *obj, GDBusMethodInvocation *context) else _disable_wifi_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV4); +#ifndef TIZEN_FEATURE_RPI if (_mobileap_get_ipv6_state(MOBILE_AP_STATE_BT)) _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV6); else _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV4); _disable_usb_tethering(obj); +#endif tethering_complete_disable(obj, context, MOBILE_AP_DISABLE_CFM, ret); @@ -529,13 +545,16 @@ static void __handle_dnsmasq_dhcp_status_changed_cb(GDBusConnection *connection, info->hostname = g_strdup(MOBILE_AP_NAME_UNKNOWN); else info->hostname = g_strdup(name); - } else if (type == MOBILE_AP_TYPE_BT) { + } +#ifndef TIZEN_FEATURE_RPI + else if (type == MOBILE_AP_TYPE_BT) { _bt_get_remote_device_name(mac, &bt_remote_device_name); if (bt_remote_device_name == NULL) info->hostname = g_strdup(MOBILE_AP_NAME_UNKNOWN); else info->hostname = bt_remote_device_name; } +#endif time(&tm); info->tm = tm; if (_add_station_info(info) != MOBILE_AP_ERROR_NONE) { @@ -549,8 +568,10 @@ 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 if (n_station == 1) _stop_timeout_cb(type); +#endif _send_dbus_station_info("DhcpConnected", info); } else if (!g_strcmp0(signal_name, "DhcpLeaseDeleted")) { @@ -596,7 +617,7 @@ static void on_bus_acquired_cb(GDBusConnection *connection, const gchar *name, } else { DBG("Export sucessss"); } - +#ifndef TIZEN_FEATURE_RPI 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", @@ -661,6 +682,7 @@ static void on_bus_acquired_cb(GDBusConnection *connection, const gchar *name, G_CALLBACK(tethering_set_wps_pin), NULL); g_signal_connect(tethering_obj, "handle-push-wps-button", G_CALLBACK(tethering_push_wps_button), NULL); +#endif g_signal_connect(softap_obj, "handle-enable", G_CALLBACK(softap_enable), NULL); @@ -676,7 +698,9 @@ 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 _register_vconf_cb((void *)tethering_obj); +#endif conn_sig_id = g_dbus_connection_signal_subscribe(connection, NULL, DNSMASQ_DBUS_INTERFACE, "DhcpConnected", NULL, NULL, G_DBUS_SIGNAL_FLAGS_NONE, @@ -755,8 +779,10 @@ int main(int argc, char **argv) return 0; } /* Platform modules */ +#ifndef TIZEN_FEATURE_RPI if (appcore_set_i18n(MOBILEAP_LOCALE_COMMON_PKG, MOBILEAP_LOCALE_COMMON_RES) < 0) ERR("appcore_set_i18n is failed\n"); +#endif if (vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &mobileap_state) < 0) { ERR("vconf_get_int is failed\n"); @@ -769,6 +795,7 @@ int main(int argc, char **argv) if (ret != WIFI_ERROR_NONE) ERR("wifi_initialize() is failed : %d\n", ret); +#ifndef TIZEN_FEATURE_RPI ret = alarmmgr_init(APPNAME); if (ret != ALARMMGR_RESULT_SUCCESS) { ERR("alarmmgr_init(%s) is failed : %d\n", APPNAME, ret); @@ -779,19 +806,22 @@ int main(int argc, char **argv) } _init_dpm(); - +#endif g_main_loop_run(mainloop); +#ifndef TIZEN_FEATURE_RPI _deinit_dpm(); alarmmgr_fini(); - +#endif ret = wifi_deinitialize(); if (ret != WIFI_ERROR_NONE) ERR("wifi_deinitialize() is failed : %d\n", ret); _mh_core_reset_mac(); +#ifndef TIZEN_FEATURE_RPI _unregister_vconf_cb(); +#endif _unregister_wifi_station_handler(); _deinit_network(); diff --git a/src/mobileap_network.c b/src/mobileap_network.c index 467ff74..5ac0d98 100644 --- a/src/mobileap_network.c +++ b/src/mobileap_network.c @@ -376,16 +376,16 @@ 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 if (_mobileap_get_ipv6_state(MOBILE_AP_STATE_BT)) ret = _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV6); else ret = _disable_bt_tethering(obj, MOBILE_AP_ADDRESS_TYPE_IPV4); - DBG("_disable_bt_tethering returns %d\n", ret); ret = _disable_usb_tethering(obj); DBG("_disable_usb_tethering returns %d\n", ret); - +#endif tethering_emit_net_closed(obj); } diff --git a/src/mobileap_notification.c b/src/mobileap_notification.c index 49f4a35..bceeff3 100644 --- a/src/mobileap_notification.c +++ b/src/mobileap_notification.c @@ -15,6 +15,7 @@ * limitations under the License. */ +#ifndef TIZEN_FEATURE_RPI #include #include #include @@ -585,3 +586,4 @@ void _create_security_restriction_noti(mobile_ap_type_e type) return; } +#endif diff --git a/src/mobileap_softap.c b/src/mobileap_softap.c index bd37e57..48fc380 100755 --- a/src/mobileap_softap.c +++ b/src/mobileap_softap.c @@ -173,7 +173,16 @@ static int __execute_hostapd(const mobile_ap_type_e type, const char *ssid, else hw_mode = g_strdup(mode); - /* Default conf. */ +#ifdef TIZEN_FEATURE_RPI + snprintf(buf, sizeof(buf), HOSTAPD_RPI_CONF, + WIFI_IF, + HOSTAPD_CTRL_INTF_DIR, + ssid, + channel, + hide_mode ? 2 : 0, + hw_mode, + max_sta); +#else snprintf(buf, sizeof(buf), HOSTAPD_CONF, WIFI_IF, HOSTAPD_CTRL_INTF_DIR, @@ -185,10 +194,15 @@ static int __execute_hostapd(const mobile_ap_type_e type, const char *ssid, mac_filter, HOSTAPD_ALLOWED_LIST, HOSTAPD_BLOCKED_LIST); +#endif conf = g_strdup(buf); free(hw_mode); +#ifdef TIZEN_FEATURE_WLAN_BOARD_SPRD + snprintf(buf, sizeof(buf), "wowlan_triggers=any\n"); +#endif + /* Vendor elements conf. */ if (type == MOBILE_AP_TYPE_WIFI) { snprintf(buf, sizeof(buf), @@ -670,12 +684,14 @@ static gboolean __hostapd_monitor_cb(GIOChannel *source) _get_station_count((gconstpointer)type, _slist_find_station_by_interface, &n_station); +#ifndef TIZEN_FEATURE_RPI if (n_station == 0) { if (type == MOBILE_AP_TYPE_WIFI) _start_timeout_cb(type, time(NULL) + TETHERING_CONN_TIMEOUT); else if (type == MOBILE_AP_TYPE_WIFI_AP) _start_timeout_cb(type, time(NULL) + WIFI_AP_CONN_TIMEOUT); } +#endif DONE: return TRUE; } @@ -1825,12 +1841,14 @@ static gboolean __send_station_event_cb(gpointer data) _get_station_count((gconstpointer)type, _slist_find_station_by_interface, &n_station); +#ifndef TIZEN_FEATURE_RPI if (n_station == 0) { if (type == MOBILE_AP_TYPE_WIFI) _start_timeout_cb(type, time(NULL) + TETHERING_CONN_TIMEOUT); else if (type == MOBILE_AP_TYPE_WIFI_AP) _start_timeout_cb(type, time(NULL) + WIFI_AP_CONN_TIMEOUT); } +#endif } return FALSE; @@ -1943,9 +1961,10 @@ SUCCESS: _get_station_count((gconstpointer)type, _slist_find_station_by_interface, &n_station); +#ifndef TIZEN_FEATURE_RPI if (n_station == 1) _stop_timeout_cb(type); - +#endif _send_dbus_station_info("DhcpConnected", info); return FALSE; diff --git a/src/mobileap_usb.c b/src/mobileap_usb.c index 4f5304a..60a110e 100755 --- a/src/mobileap_usb.c +++ b/src/mobileap_usb.c @@ -15,6 +15,7 @@ * limitations under the License. */ +#ifndef TIZEN_FEATURE_RPI #include #include #include @@ -467,3 +468,4 @@ gboolean _is_trying_usb_operation(void) { return (g_context ? TRUE : FALSE || in_progress); } +#endif diff --git a/src/mobileap_wifi.c b/src/mobileap_wifi.c index 570a6be..33634b7 100755 --- a/src/mobileap_wifi.c +++ b/src/mobileap_wifi.c @@ -107,7 +107,9 @@ 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 _create_tethering_active_noti(); +#endif } } else { ret = _enable_soft_ap((Softap *)obj, wifi_settings.ssid, wifi_settings.key, @@ -172,7 +174,9 @@ static void __wifi_deactivated_cb(wifi_error_e result, void *user_data) } else { prev_wifi_on = TRUE; tethering_emit_wifi_on(obj); +#ifndef TIZEN_FEATURE_RPI _create_tethering_active_noti(); +#endif } } else { ret = _enable_soft_ap((Softap *)obj, wifi_settings.ssid, wifi_settings.key, @@ -411,7 +415,9 @@ mobile_ap_error_code_e _reload_softap_settings(Tethering *obj, return ret; } tethering_emit_wifi_on(obj); +#ifndef TIZEN_FEATURE_RPI _create_tethering_active_noti(); +#endif return MOBILE_AP_ERROR_NONE; } @@ -574,10 +580,11 @@ 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 _delete_timeout_noti(); - _init_timeout_cb(MOBILE_AP_TYPE_WIFI, (void *)obj); _start_timeout_cb(MOBILE_AP_TYPE_WIFI, time(NULL) + TETHERING_CONN_TIMEOUT); +#endif if (address_type != MOBILE_AP_ADDRESS_TYPE_IPV6) { _add_interface_routing(WIFI_IF, IP_ADDRESS_SOFTAP); @@ -654,10 +661,11 @@ mobile_ap_error_code_e _enable_wifi_ap(Tethering *obj, _mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP); goto DONE; } - +#ifndef TIZEN_FEATURE_RPI _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); +#endif _add_interface_routing(WIFI_IF, IP_ADDRESS_SOFTAP); _add_routing_rule(WIFI_IF); @@ -691,7 +699,9 @@ mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj, mobile_ap_address } _flush_ip_address(WIFI_IF); +#ifndef TIZEN_FEATURE_RPI _deinit_timeout_cb(type); +#endif if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE) ERR("_remove_station_info_all is failed. Ignore it.\n"); @@ -741,7 +751,9 @@ mobile_ap_error_code_e _disable_wifi_ap(Tethering *obj) _del_routing_rule(WIFI_IF); _del_interface_routing(WIFI_IF, IP_ADDRESS_SOFTAP); _flush_ip_address(WIFI_IF); +#ifndef TIZEN_FEATURE_RPI _deinit_timeout_cb(type); +#endif if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE) ERR("_remove_station_info_all is failed. Ignore it.\n"); @@ -831,9 +843,11 @@ mobile_ap_error_code_e _enable_soft_ap(Softap *obj, goto DONE; } +#ifndef TIZEN_FEATURE_RPI _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); +#endif _add_interface_routing(WIFI_IF, IP_ADDRESS_SOFTAP); _add_routing_rule(WIFI_IF); #ifdef TIZEN_FEATURE_MULTICAST @@ -867,8 +881,9 @@ 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 _deinit_timeout_cb(type); - +#endif if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE) ERR("_remove_station_info_all is failed. Ignore it.\n"); @@ -955,12 +970,14 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj, } g_context = context; +#ifndef TIZEN_FEATURE_RPI if (!_is_allowed(MOBILE_AP_TYPE_WIFI)) { DBG("DPM policy restricts Wi-Fi tethering\n"); ret = MOBILE_AP_ERROR_NOT_PERMITTED; _create_security_restriction_noti(MOBILE_AP_TYPE_WIFI); goto DONE; } +#endif #ifdef TIZEN_FEATURE_ENABLE_IPV6 DBG("[MOON] ipv6 feature is enabled"); @@ -1028,7 +1045,9 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj, ERR("_enable_wifi_tethering is failed\n"); } else { tethering_emit_wifi_on(obj); +#ifndef TIZEN_FEATURE_RPI _create_tethering_active_noti(); +#endif ret_val = TRUE; }