MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
-INCLUDE_DIRECTORIES(${INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED gio-2.0 dlog dbus-glib-1 deviced vconf notification capi-network-connection capi-network-bluetooth appcore-common capi-network-wifi capi-network-wifi-direct alarm-service appsvc libssl)
+pkg_check_modules(pkgs REQUIRED gio-2.0 gio-unix-2.0 dbus-1 dlog deviced vconf notification capi-network-connection capi-network-bluetooth appcore-common capi-network-wifi capi-network-wifi-direct alarm-service appsvc libssl)
+
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
ADD_DEFINITIONS("-DTARGET")
MESSAGE("add -DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
-
-FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=tethering ${INCLUDE_DIR}/tethering-dbus-interface.xml --mode=glib-server --output=${INCLUDE_DIR}/tethering-server-stub.h")
+IF(TIZEN_TV)
+ ADD_DEFINITIONS(-DTIZEN_TV)
+ENDIF(TIZEN_TV)
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
ADD_DEFINITIONS("-DAPPNAME=\"${APP_NAME}\"")
ADD_DEFINITIONS("-DAPP_DIR=\"${APP_DIR}\"")
+IF(TIZEN_WLAN_BOARD_SPRD)
+ ADD_DEFINITIONS(-DTIZEN_WLAN_BOARD_SPRD)
+ENDIF(TIZEN_WLAN_BOARD_SPRD)
+
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -pie")
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+ADD_CUSTOM_COMMAND(
+ WORKING_DIRECTORY
+ OUTPUT ${CMAKE_BINARY_DIR}/tethering-server-stub.c
+ COMMAND gdbus-codegen --interface-prefix org.tizen.
+ --generate-c-code tethering-server-stub
+ --c-generate-object-manager
+ --generate-docbook generated-docs
+ ${INCLUDE_DIR}/tethering-dbus-interface.xml
+ COMMENT "Generating GDBus .c/.h")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS} ${CMAKE_BINARY_DIR}/tethering-server-stub.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/org.tizen.tethering.service DESTINATION share/dbus-1/services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/org.tizen.tethering.service DESTINATION share/dbus-1/system-services)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tethering_dump.sh DESTINATION /opt/etc/dump.d/module.d/)
extern "C" {
#endif
-/* Client / Agent common */
-#define DBUS_STRUCT_UINT_STRING (dbus_g_type_get_struct ("GValueArray", \
- G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID))
-
-#define DBUS_STRUCT_STATIONS (dbus_g_type_get_struct ("GValueArray", \
- G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, \
- G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INVALID))
-
-#define DBUS_STRUCT_STATION (dbus_g_type_get_struct ("GValueArray", \
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, \
- G_TYPE_INVALID))
-
-#define DBUS_STRUCT_INTERFACE (dbus_g_type_get_struct ("GValueArray", \
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, \
- G_TYPE_STRING, G_TYPE_INVALID))
-
-
#define TETHERING_SERVICE_OBJECT_PATH "/Tethering"
#define TETHERING_SERVICE_NAME "org.tizen.tethering"
#define TETHERING_SERVICE_INTERFACE "org.tizen.tethering"
#define SIGNAL_NAME_LOW_BATTERY_MODE "low_batt_mode"
#define SIGNAL_NAME_FLIGHT_MODE "flight_mode"
#define SIGNAL_NAME_POWER_SAVE_MODE "power_save_mode"
-#define SIGNAL_NAME_DHCP_STATUS "dhcp_status"
#define SIGNAL_NAME_SECURITY_TYPE_CHANGED "security_type_changed"
#define SIGNAL_NAME_SSID_VISIBILITY_CHANGED "ssid_visibility_changed"
#define SIGNAL_NAME_PASSPHRASE_CHANGED "passphrase_changed"
-
+#define SIGNAL_NAME_DHCP_STATUS "dhcp_status"
#define SIGNAL_MSG_NOT_AVAIL_INTERFACE "Interface is not available"
#define SIGNAL_MSG_TIMEOUT "There is no connection for a while"
#define SIGNAL_MSG_SSID_VISIBLE "ssid_visible"
#define MOBILE_AP_STR_INFO_LEN 20 /**< length of the ip or mac address*/
#define MOBILE_AP_STR_HOSTNAME_LEN 33 /**< length of the hostname */
#define MOBILE_AP_NAME_UNKNOWN "UNKNOWN"
-
/**
* Mobile AP error code
*/
#define PS_RECHECK_INTERVAL 500
#define PS_RECHECK_COUNT_MAX 5
-void _bt_get_remote_device_name(TetheringObject *obj, const char *mac, char **name);
-mobile_ap_error_code_e _disable_bt_tethering(TetheringObject *obj);
+void _bt_get_remote_device_name(const char *mac, char **name);
+mobile_ap_error_code_e _disable_bt_tethering(Tethering *obj);
gboolean _is_trying_bt_operation(void);
-gboolean tethering_enable_bt_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context);
-gboolean tethering_disable_bt_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context);
+gboolean tethering_enable_bt_tethering(Tethering *obj,
+ GDBusMethodInvocation *context);
+gboolean tethering_disable_bt_tethering(Tethering *obj,
+ GDBusMethodInvocation *context);
#endif /* __MOBILEAP_BLUETOOTH_H__ */
#define __MOBILEAP_COMMON_H__
#include <glib.h>
+#include <gio/gio.h>
#include "mobileap_softap.h"
+#include <tethering-server-stub.h>
gint _slist_find_station_by_interface(gconstpointer a, gconstpointer b);
gint _slist_find_station_by_mac(gconstpointer a, gconstpointer b);
gint _slist_find_station_by_ip_addr(gconstpointer a, gconstpointer b);
-void _emit_mobileap_dbus_signal(TetheringObject *obj,
- mobile_ap_sig_e num, const gchar *message);
void _send_dbus_station_info(const char *member,
mobile_ap_station_info_t *info);
void _update_station_count(int count);
int _get_station_info(gconstpointer data, GCompareFunc func,
mobile_ap_station_info_t **si);
int _get_station_count(gconstpointer data, GCompareFunc func, int *count);
-int _station_info_foreach(GFunc func, void *user_data);
+GVariant *_station_info_foreach(void);
int _add_interface_routing(const char *interface, const in_addr_t gateway);
int _del_interface_routing(const char *interface, const in_addr_t gateway);
int _add_routing_rule(const char *interface);
int _flush_ip_address(const char *interface);
int _execute_command(const char *cmd);
int _get_tethering_type_from_ip(const char *ip, mobile_ap_type_e *type);
-
+Tethering *_get_tethering_obj(void);
#endif /* __MOBILEAP_COMMON_H__ */
} changed_state_t;
void _register_vconf_cb(void *user_data);
-void _unregister_vconf_cb(void *user_data);
+void _unregister_vconf_cb(void);
gboolean _is_power_save_survival_mode(void);
int _sp_timeout_handler(alarm_id_t alarm_id, void *user_param);
#define MH_STR_CONFIGURE_TETHERING "IDS_MOBILEAP_BODY_TAP_TO_CONFIGURE_TETHERING"
#define MH_STR_TETHERING_ACTIVE _("IDS_MOBILEAP_BODY_TETHERING_ACTIVE_ABB")
#define MH_STR_BT_VISIBILITY _("IDS_ST_BODY_BLUETOOTH_VISIBILITY_HAS_TIMED_OUT_YOUR_DEVICE_MIGHT_NOT_BE_FOUND")
-#define MH_STR_TETHERING_ENABLED _("IDS_COM_BODY_TETHERING_ENABLED")
int _create_timeout_noti(const char *icon_path);
int _delete_timeout_noti(void);
#define __MOBILEAP_SOFTAP_H__
#include <glib.h>
+#include <glib-object.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <dlog.h>
#include <vconf.h>
#include <netinet/in.h>
#define HOSTAPD_CONF_FILE "/opt/var/lib/misc/hostapd.conf"
#define HOSTAPD_CTRL_INTF_DIR "/opt/var/lib/misc/hostapd"
#define HOSTAPD_CONF_LEN 1024
+#ifndef TIZEN_WLAN_BOARD_SPRD
#define HOSTAPD_CONF "interface=%s\n" \
"driver=nl80211\n" \
"ctrl_interface=%s\n" \
"hw_mode=g\n" \
"max_num_sta=%d\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=g\n" \
+ "max_num_sta=%d\n" \
+ "ieee80211n=1\n" \
+ "wowlan_triggers=any\n"
+#endif
+
#define HOSTAPD_DEBUG_FILE "/var/log/hostapd.log"
#define HOSTAPD_REQ_MAX_LEN 128
#define HOSTAPD_RETRY_MAX 5
} softap_settings_t;
typedef struct {
- /* The parent class object state. */
- GObject parent;
-
- int init_count;
-
- softap_settings_t softap_settings;
-} TetheringObject;
-
-typedef struct {
- /* The parent class state. */
- GObjectClass parent;
-
- /* class member */
- guint signals[E_SIGNAL_MAX];
-} TetheringObjectClass;
-
-typedef struct {
unsigned int number; /* Number of connected device */
/* BSSID list of connected device */
char bssid[MOBILE_AP_MAX_WIFI_STA][MOBILE_AP_STR_INFO_LEN];
void _block_device_sleep(void);
void _unblock_device_sleep(void);
-int _init_tethering(TetheringObject *obj);
-gboolean _deinit_tethering(TetheringObject *obj);
+int _init_tethering(void);
+gboolean _deinit_tethering(void);
gboolean _mobileap_clear_state(int state);
gboolean _terminate_mobileap_agent(gpointer user_data);
#include "mobileap_softap.h"
-mobile_ap_error_code_e _disable_usb_tethering(TetheringObject *obj);
+mobile_ap_error_code_e _disable_usb_tethering(Tethering *obj);
gboolean _is_trying_usb_operation(void);
-gboolean tethering_enable_usb_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context);
-gboolean tethering_disable_usb_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context);
+gboolean tethering_enable_usb_tethering(Tethering *obj,
+ GDBusMethodInvocation *context);
+gboolean tethering_disable_usb_tethering(Tethering *obj,
+ GDBusMethodInvocation *context);
#endif /* __MOBILEAP_USB_H__ */
} wifi_saved_settings;
int _get_wifi_name_from_lease_info(const char *mac, char **name_buf);
-void _add_wifi_device_to_array(softap_device_info_t *di, GPtrArray *array);
-mobile_ap_error_code_e _enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
+mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
gchar *passphrase, int hide_mode, softap_security_type_e security_type);
-mobile_ap_error_code_e _disable_wifi_tethering(TetheringObject *obj);
+mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj);
gboolean _is_trying_wifi_operation(void);
-mobile_ap_error_code_e _reload_softap_settings(TetheringObject *obj,
+mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
gchar *ssid, gchar *key, gint hide_mode, gint security_type);
-mobile_ap_error_code_e _reload_softap_settings_for_ap(TetheringObject *obj,
+mobile_ap_error_code_e _reload_softap_settings_for_ap(Tethering *obj,
gchar *ssid, gchar *key, gint hide_mode, gint security_type);
/* Dbus method */
-mobile_ap_error_code_e _enable_wifi_ap(TetheringObject *obj, gchar *ssid,
+mobile_ap_error_code_e _enable_wifi_ap(Tethering *obj, gchar *ssid,
gchar *passphrase, int hide_mode,
softap_security_type_e security_type);
-mobile_ap_error_code_e _disable_wifi_ap(TetheringObject *obj);
-gboolean tethering_enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
- gchar *key, gint hide_mode, gint security_type,
- DBusGMethodInvocation *context);
+mobile_ap_error_code_e _disable_wifi_ap(Tethering *obj);
+gboolean tethering_enable_wifi_tethering(Tethering *obj,
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gint visibility, gint security_type);
-gboolean tethering_disable_wifi_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context);
+softap_settings_t *_get_softap_settings();
-gboolean tethering_reload_wifi_settings(TetheringObject *obj, gchar *ssid,
- gchar *key, gint visibility, gint security_type,
- DBusGMethodInvocation *context);
+gboolean tethering_disable_wifi_tethering(Tethering *obj,
+ GDBusMethodInvocation *context);
-gboolean tethering_reload_wifi_ap_settings(TetheringObject *obj, gchar *ssid,
- gchar *key, gint hide_mode,
- gint security, DBusGMethodInvocation *context);
+gboolean tethering_reload_wifi_settings(Tethering *obj,
+ GDBusMethodInvocation *context,
+ gchar *ssid, gchar *key, gint visibility, gint security_type);
-gboolean tethering_enable_wifi_ap(TetheringObject *obj, gchar *ssid,
- gchar *key, gint hide_mode, gint security_type,
- DBusGMethodInvocation *context);
+gboolean tethering_reload_wifi_ap_settings(Tethering *obj,
+ GDBusMethodInvocation *context, gchar *ssid, gchar *key,
+ gint hide_mode, gint security);
-gboolean tethering_disable_wifi_ap(TetheringObject *obj,
- DBusGMethodInvocation *context);
+gboolean tethering_enable_wifi_ap(Tethering *obj, GDBusMethodInvocation *context,
+ gchar *ssid, gchar *key, gint hide_mode, gint security_type);
+
+gboolean tethering_disable_wifi_ap(Tethering *obj,
+ GDBusMethodInvocation *context);
#endif /* __MOBILEAP_WIFI_H__ */
<!-- Method definitions -->
<method name="disable">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="enable_wifi_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="s" name="ssid" direction="in"/>
<arg type="s" name="key" direction="in"/>
<arg type="i" name="visibility" direction="in"/>
<arg type="i" name="security" direction="in"/>
- <arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
+ <method name="cont_enable_wifi_tethering">
+ </method>
+
+ <method name="cancel_enable_wifi_tethering">
+ </method>
+
<method name="disable_wifi_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="enable_bt_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
+ <method name="cont_enable_bt_tethering">
+ </method>
+
+ <method name="cancel_enable_bt_tethering">
+ </method>
+
<method name="disable_bt_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="enable_usb_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
+ <method name="cont_enable_usb_tethering">
+ </method>
+
+ <method name="cancel_enable_usb_tethering">
+ </method>
+
<method name="disable_usb_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="enable_wifi_ap">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="s" name="ssid" direction="in"/>
<arg type="s" name="key" direction="in"/>
<arg type="i" name="visibility" direction="in"/>
<arg type="i" name="security" direction="in"/>
- <arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="disable_wifi_ap">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="u" name="result" direction="out"/>
</method>
<method name="reload_wifi_settings">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="s" name="ssid" direction="in"/>
<arg type="s" name="key" direction="in"/>
<arg type="i" name="visibility" direction="in"/>
</method>
<method name="reload_wifi_ap_settings">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="s" name="ssid" direction="in"/>
<arg type="s" name="key" direction="in"/>
<arg type="i" name="visibility" direction="in"/>
</method>
<method name="get_station_info">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="a(usssu)" name="station" direction="out"/>
+ <arg type="a(a{sv})" name="station" direction="out"/>
</method>
<method name="get_data_packet_usage">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="u" name="type" direction="out"/>
<arg type="t" name="rx_data" direction="out"/>
<arg type="t" name="tx_data" direction="out"/>
<!-- Signal (D-Bus) definitions -->
<signal name="net_closed">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="sta_connected">
</signal>
<signal name="wifi_on">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="wifi_off">
</signal>
<signal name="usb_on">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="usb_off">
</signal>
<signal name="bluetooth_on">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="bluetooth_off">
</signal>
<signal name="wifi_ap_on">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="wifi_ap_off">
</signal>
<signal name="no_data_timeout">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="low_batt_mode">
- <arg type="s" name="arg1" direction="out"/>
</signal>
<signal name="flight_mode">
- <arg type="s" name="arg1" direction="out"/>
</signal>
+
<signal name="power_save_mode">
- <arg type="s" name="arg1" direction="out"/>
+ </signal>
+
+ <signal name="dhcp_status">
+ <arg type="s" name="signalName" direction="out"/>
+ <arg type="u" name="type" direction="out"/>
+ <arg type="s" name="ip" direction="out"/>
+ <arg type="s" name="mac" direction="out"/>
+ <arg type="s" name="hostName" direction="out"/>
+ <arg type="u" name="tm" direction="out"/>
</signal>
</interface>
-</node>
\ No newline at end of file
+</node>
<smack request="bt-service::platform" type="w"/>
<smack request="bt-service::public" type="w"/>
<smack request="secure-storage::tethering" type="rw"/>
- <smack request="mdm-server::admin" type="r"/>
- <smack request="mdm-server::security" type="r"/>
- <smack request="mdm-server::restriction" type="r"/>
<smack request="deviced::display" type="rw"/>
<smack request="connman" type="rw"/>
<smack request="connman::get" type="rw"/>
<smack request="alarm-server::alarm" type="w"/>
<smack request="system::use_internet" type="w"/>
<smack request="telephony_framework::api_ps_public" type="rw"/>
+ <smack request="tizen::vconf::public::r" type="rwx"/>
+ <smack request="tizen::vconf::wifidirect" type="rwx"/>
+ <smack request="tizen::vconf::tethering::admin" type="rwx"/>
+ <smack request="tizen::vconf::setting::admin" type="rl"/>
+ <smack request="wifi-direct" type="w"/>
+ <smack request="syslogd" type="w"/>
+ <smack request="tizen::vconf::public::r::platform::rw" type="rl"/>
+ <smack request="device::app_logging" type="rw"/>
+ <smack request="device::sys_logging" type="rw"/>
+ <smack request="notification::db" type="rw"/>
+ <smack request="wpasupplicant" type="rwx"/>
+ <smack request="_" type="wx"/>
+ <smack request="sdbd" type="r"/>
+ <smack request="pkgmgr::db" type="rw"/>
+ <smack request="dbus" type="rx"/>
+ <smack request="data-provider-master::notification" type="w"/>
</request>
<permit>
<smack permit="system::use_internet" type="w"/>
+ <smack permit="dbus" type="rx"/>
</permit>
</define>
<request>
<domain name="mobileap-agent"/>
</request>
<assign>
- <filesystem path="/usr/share/dbus-1/services/org.tizen.tethering.service" label="_"/>
+ <filesystem path="/usr/share/dbus-1/system-services/org.tizen.tethering.service" label="_"/>
<dbus name="org.tizen.tethering" own="mobileap-agent" bus="system">
<node name="/Tethering">
<interface name="org.tizen.tethering">
Name: mobileap-agent
Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.17
+Version: 1.0.36
Release: 1
Group: System/Network
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+
+%if "%{?tizen_profile_name}" == "tv"
+ExcludeArch: %{arm} %ix86 x86_64
+%endif
+
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(dbus-glib-1)
+BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(deviced)
BuildRequires: pkgconfig(libssl)
BuildRequires: cmake
Requires(post): /usr/bin/vconftool
+%if "%{?tizen_profile_name}" != "tv"
Requires(post): bluetooth-agent
+%endif
Requires(post): ss-server
Requires: iproute2
Requires: iptables
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
%cmake -DCMAKE_BUILD_TYPE="" \
+%if "%{?tizen_profile_name}" == "tv"
+ -DTIZEN_TV=1 \
+%endif
+%if "%{?tizen_target_name}" == "Z300H"
+ -DTIZEN_WLAN_BOARD_SPRD=1 \
+%endif
.
make %{?jobs:-j%jobs}
%make_install
%post
-/usr/bin/vconftool set -t string memory/private/mobileap-agent/ssid "" -u 0 -i -f -s system::vconf_network
-/usr/bin/vconftool set -t int memory/mobile_hotspot/connected_device "0" -u 0 -i -f -s system::vconf_network
-/usr/bin/vconftool set -t int memory/mobile_hotspot/mode "0" -u 0 -i -f -s system::vconf_network
-/usr/bin/vconftool set -t int db/mobile_hotspot/security "1" -u 5000 -f -s system::vconf_network
-/usr/bin/vconftool set -t int db/mobile_hotspot/hide "0" -u 5000 -f -s system::vconf_network
+/usr/bin/vconftool set -t string memory/private/mobileap-agent/ssid "" -u 0 -i -s system::vconf_network
/bin/chmod +x /opt/etc/dump.d/module.d/tethering_dump.sh
%files
%manifest mobileap-agent.manifest
%defattr(-,root,root,-)
-/usr/share/dbus-1/services/org.tizen.tethering.service
+/usr/share/dbus-1/system-services/org.tizen.tethering.service
+
%{_bindir}/mobileap-agent
/opt/etc/dump.d/module.d/tethering_dump.sh
#include <stdio.h>
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <bluetooth.h>
+#ifndef TIZEN_TV
+#include <bluetooth_internal.h>
+#endif
#include "mobileap_softap.h"
#include "mobileap_common.h"
{NULL, NULL, IP_ADDRESS_BT_3},
{NULL, NULL, IP_ADDRESS_BT_4}};
-static DBusGMethodInvocation *g_context = NULL;
+static GDBusMethodInvocation *g_context = NULL;
static void __bt_nap_connection_changed(bool connected, const char *remote_address,
const char *interface_name, void *user_data);
return;
}
-static mobile_ap_error_code_e __init_bt(TetheringObject *obj)
+static mobile_ap_error_code_e __init_bt(Tethering *obj)
{
int ret;
return FALSE;
}
-gboolean __bt_adapter_timeout_cb(gpointer data)
+gboolean __bt_adapter_timeout_cb(Tethering *obj)
{
DBG("+\n");
ERR("_enable_bt_tethering() is failed because of bt_adapter_eanbled() failed:n");
_mobileap_clear_state(MOBILE_AP_STATE_BT);
__deinit_bt();
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_BT_TETHERING_CFM, MOBILE_AP_ERROR_INTERNAL);
+ tethering_complete_enable_bt_tethering(obj, g_context, MOBILE_AP_ERROR_INTERNAL);
g_context = NULL;
_unblock_device_sleep();
DBG("-\n");
}
}
-static mobile_ap_error_code_e __turn_on_bt_adapter(TetheringObject *obj)
+static mobile_ap_error_code_e __turn_on_bt_adapter(gpointer data)
{
int ret;
+ Tethering *obj = (Tethering *)data;
+
ret = bt_adapter_enable();
if (ret == BT_ERROR_NOW_IN_PROGRESS) {
if (__recheck_bt_adapter_timer) {
g_source_remove(__recheck_bt_adapter_timer);
}
__recheck_bt_adapter_timer = g_timeout_add(PS_RECHECK_INTERVAL,
- __bt_adapter_timeout_cb, NULL);
+ __bt_adapter_timeout_cb, obj);
return MOBILE_AP_ERROR_NONE;
}
if (ret != BT_ERROR_NONE && ret != BT_ERROR_ALREADY_DONE) {
ERR("bt_adapter_enable is failed : %d\n", ret);
+#ifndef TIZEN_TV
if (ret == BT_ERROR_PERMISSION_DENIED)
return MOBILE_AP_ERROR_PERMISSION_DENIED;
else
+#endif
return MOBILE_AP_ERROR_RESOURCE;
}
return MOBILE_AP_ERROR_NONE;
}
-static mobile_ap_error_code_e __turn_on_bt_nap(TetheringObject *obj)
+static mobile_ap_error_code_e __turn_on_bt_nap(Tethering *obj)
{
int bt_ret = BT_ERROR_NONE;
if (bt_ret != BT_ERROR_NONE && bt_ret != BT_ERROR_ALREADY_DONE) {
bt_nap_unset_connection_state_changed_cb();
ERR("bt_nap_activate is failed : %d\n", bt_ret);
+#ifndef TIZEN_TV
if (bt_ret == BT_ERROR_PERMISSION_DENIED)
return MOBILE_AP_ERROR_PERMISSION_DENIED;
else
+#endif
return MOBILE_AP_ERROR_RESOURCE;
}
{
int bt_ret;
- bt_ret = bt_nap_disconnect_all();
+ bt_ret = bt_nap_deactivate();
if (bt_ret != BT_ERROR_NONE)
- ERR("bt_nap_disconnect_all is failed : %d\n", bt_ret);
+ ERR("bt_nap_deactivate is failed : %d\n", bt_ret);
else
- DBG("bt_nap_disconnect_all is called\n");
+ DBG("bt_nap_deactivate is called\n");
bt_ret = bt_nap_unset_connection_state_changed_cb();
if (bt_ret != BT_ERROR_NONE)
return;
}
-mobile_ap_error_code_e _enable_bt_tethering(TetheringObject *obj)
+mobile_ap_error_code_e _enable_bt_tethering(Tethering *obj)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
return MOBILE_AP_ERROR_RESOURCE;
}
- ret = _init_tethering(obj);
+ ret = _init_tethering();
if (ret != MOBILE_AP_ERROR_NONE) {
return ret;
}
ret = __turn_on_bt_nap(obj);
if (ret != MOBILE_AP_ERROR_NONE) {
- _deinit_tethering(obj);
+ _deinit_tethering();
return ret;
}
_delete_timeout_noti();
_init_timeout_cb(MOBILE_AP_TYPE_BT, (void *)obj);
_start_timeout_cb(MOBILE_AP_TYPE_BT, time(NULL) + TETHERING_CONN_TIMEOUT);
+ DBG("-\n");
return ret;
}
-mobile_ap_error_code_e _disable_bt_tethering(TetheringObject *obj)
+mobile_ap_error_code_e _disable_bt_tethering(Tethering *obj)
{
int ret = BT_ERROR_NONE;
if (!_mobileap_is_enabled(MOBILE_AP_STATE_BT)) {
__del_bt_remote_all();
_deinit_timeout_cb(MOBILE_AP_TYPE_BT);
- _deinit_tethering(obj);
+ _deinit_tethering();
_mobileap_clear_state(MOBILE_AP_STATE_BT);
_unblock_device_sleep();
return;
int ret = MOBILE_AP_ERROR_RESOURCE;
- TetheringObject *obj = (TetheringObject *)user_data;
+ Tethering *obj = (Tethering *)user_data;
if (result != BT_ERROR_NONE) {
ERR("BT Adapter operation is failed : %d\n", result);
"enabled" : "disabled");
if (adapter_state == BT_ADAPTER_DISABLED) {
_disable_bt_tethering(obj);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_BT_TETHER_OFF,
- SIGNAL_MSG_NOT_AVAIL_INTERFACE);
+ tethering_emit_bluetooth_off(obj, SIGNAL_MSG_NOT_AVAIL_INTERFACE);
return;
} else {
ret = _enable_bt_tethering(obj);
goto FAIL;
}
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_BT_TETHER_ON, NULL);
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_BT_TETHERING_CFM, ret);
+ tethering_emit_bluetooth_on(obj);
+ _create_tethering_active_noti();
+ tethering_complete_enable_bt_tethering(obj, g_context, ret);
__handle_bt_adapter_visibility();
g_context = NULL;
_unblock_device_sleep();
}
FAIL:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_BT_TETHERING_CFM, ret);
+ tethering_complete_enable_bt_tethering(obj, g_context, ret);
g_context = NULL;
_mobileap_clear_state(MOBILE_AP_STATE_BT);
_unblock_device_sleep();
return;
}
-void _bt_get_remote_device_name(TetheringObject *obj, const char *mac, char **name)
+void _bt_get_remote_device_name(const char *mac, char **name)
{
- if (obj == NULL || mac == NULL || name == NULL) {
+ if (mac == NULL || name == NULL) {
ERR("Invalid param\n");
return;
}
bt_adapter_set_visibility_mode_changed_cb(__bt_adapter_visibility_changed_cb, NULL);
DBG("-\n");
}
-gboolean tethering_enable_bt_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context)
+
+gboolean tethering_enable_bt_tethering(Tethering *obj,
+ GDBusMethodInvocation *context)
{
mobile_ap_error_code_e ret;
gboolean ret_val = FALSE;
if (g_context) {
DBG("It is turnning on\n");
- dbus_g_method_return(context,
- MOBILE_AP_ENABLE_BT_TETHERING_CFM,
+ tethering_complete_enable_bt_tethering(obj, context,
MOBILE_AP_ERROR_IN_PROGRESS);
return FALSE;
}
if (__is_bt_adapter_on() == FALSE) {
DBG("Bluetooth is deactivated\n");
- if (__turn_on_bt_adapter(obj) != MOBILE_AP_ERROR_NONE) {
+ if (__turn_on_bt_adapter((gpointer)obj) != MOBILE_AP_ERROR_NONE) {
ERR("__turn_on_bt_adapter is failed\n");
ret = MOBILE_AP_ERROR_INTERNAL;
_mobileap_clear_state(MOBILE_AP_STATE_BT);
_mobileap_clear_state(MOBILE_AP_STATE_BT);
__deinit_bt();
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_BT_TETHER_ON, NULL);
+ tethering_emit_bluetooth_on(obj);
+ _create_tethering_active_noti();
__handle_bt_adapter_visibility();
ret_val = TRUE;
}
DONE:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_BT_TETHERING_CFM, ret);
+ tethering_complete_enable_bt_tethering(obj, g_context, ret);
g_context = NULL;
_unblock_device_sleep();
-
+ DBG("-\n");
return ret_val;
}
-gboolean tethering_disable_bt_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_disable_bt_tethering(Tethering *obj,
+ GDBusMethodInvocation *context)
{
mobile_ap_error_code_e ret;
ret = _disable_bt_tethering(obj);
if (ret != MOBILE_AP_ERROR_NONE) {
- dbus_g_method_return(context, MOBILE_AP_DISABLE_BT_TETHERING_CFM, ret);
+ tethering_complete_disable_bt_tethering(obj, context,
+ MOBILE_AP_DISABLE_BT_TETHERING_CFM, ret);
return FALSE;
}
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_BT_TETHER_OFF, NULL);
- dbus_g_method_return(context, MOBILE_AP_DISABLE_BT_TETHERING_CFM, ret);
+ tethering_emit_bluetooth_off(obj, NULL);
+ tethering_complete_disable_bt_tethering(obj, context,
+ MOBILE_AP_DISABLE_BT_TETHERING_CFM, ret);
return TRUE;
}
#include <arpa/inet.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include "mobileap_notification.h"
#include "mobileap_common.h"
-#define TETHERING_OBJECT_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- TETHERING_TYPE_OBJECT , TetheringObjectClass))
-
-extern DBusConnection *tethering_conn;
-
static GSList *station_list = NULL;
gint _slist_find_station_by_interface(gconstpointer a, gconstpointer b)
return g_ascii_strcasecmp(si->ip, ip_addr);
}
-void _emit_mobileap_dbus_signal(TetheringObject *obj,
- mobile_ap_sig_e num, const gchar *message)
-{
- TetheringObjectClass *klass = TETHERING_OBJECT_GET_CLASS(obj);
-
- SDBG("Emitting signal id [%d], with message [%s]\n", num, message);
-
- if (num == E_SIGNAL_WIFI_TETHER_ON ||
- num == E_SIGNAL_USB_TETHER_ON || num == E_SIGNAL_BT_TETHER_ON) {
- _create_tethering_active_noti();
- }
-
- g_signal_emit(obj, klass->signals[num], 0, message);
-}
-
void _send_dbus_station_info(const char *member, mobile_ap_station_info_t *info)
{
- if (tethering_conn == NULL)
- return;
+ DBG("+\n");
if (member == NULL || info == NULL) {
ERR("Invalid param\n");
return;
}
-
- DBusMessage *msg = NULL;
- char *ip = info->ip;
- char *mac = info->mac;
- char *hostname = info->hostname;
-
- msg = dbus_message_new_signal(TETHERING_SERVICE_OBJECT_PATH,
- TETHERING_SERVICE_INTERFACE,
- SIGNAL_NAME_DHCP_STATUS);
- if (!msg) {
- ERR("Unable to allocate D-Bus signal\n");
- return;
- }
-
- if (!dbus_message_append_args(msg,
- DBUS_TYPE_STRING, &member,
- DBUS_TYPE_UINT32, &info->interface,
- DBUS_TYPE_STRING, &ip,
- DBUS_TYPE_STRING, &mac,
- DBUS_TYPE_STRING, &hostname,
- DBUS_TYPE_UINT32, &info->tm,
- DBUS_TYPE_INVALID)) {
- ERR("Event sending failed\n");
- dbus_message_unref(msg);
+ Tethering *obj = _get_tethering_obj();
+ if (obj == NULL) {
+ ERR("tethering object is null\n");
return;
}
-
- dbus_connection_send(tethering_conn, msg, NULL);
- dbus_message_unref(msg);
-
- return;
+ DBG("signal is %s", member);
+ tethering_emit_dhcp_status(obj, member, info->interface, info->ip, info->mac,
+ info->hostname, info->tm);
+ DBG("-\n");
}
void _update_station_count(int count)
return MOBILE_AP_ERROR_NONE;
}
-int _station_info_foreach(GFunc func, void *user_data)
+GVariant * _station_info_foreach()
{
- if (func == NULL) {
- ERR("Invalid param\n");
- return MOBILE_AP_ERROR_INVALID_PARAM;
- }
+ GSList *l = NULL;
+ GVariant *params = NULL;
+ GVariantBuilder *inner_builder;
+ GVariantBuilder *outer_builder;
+ mobile_ap_station_info_t *st = NULL;
- g_slist_foreach(station_list, func, user_data);
+ outer_builder = g_variant_builder_new(G_VARIANT_TYPE ("a(a{sv})"));
- return MOBILE_AP_ERROR_NONE;
+ for (l = station_list; l != NULL; l = g_slist_next(l)) {
+ st = (mobile_ap_station_info_t *)l->data;
+
+ inner_builder = g_variant_builder_new(G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_add(inner_builder, "{sv}", "Type",
+ g_variant_new_int32(st->interface));
+ g_variant_builder_add(inner_builder, "{sv}", "IP",
+ g_variant_new_string(st->ip));
+ g_variant_builder_add(inner_builder, "{sv}", "MAC",
+ g_variant_new_string(st->mac));
+ if (st->hostname) {
+ g_variant_builder_add(inner_builder, "{sv}", "Name",
+ g_variant_new_string(st->hostname));
+ }
+ g_variant_builder_add(inner_builder, "{sv}", "Time",
+ g_variant_new_int32(st->tm));
+
+ g_variant_builder_add(outer_builder, "(@a{sv})", g_variant_builder_end(inner_builder));
+
+ g_variant_builder_unref(inner_builder);
+ }
+
+ params = g_variant_new("(@a(a{sv}))", g_variant_builder_end(outer_builder));
+ if (params == NULL) {
+ ERR("params IS NULL\n");
+ } else {
+ SDBG("outer builder print %s", g_variant_print(params, TRUE));
+ }
+ g_variant_builder_unref(outer_builder);
+ return params;
}
int _add_interface_routing(const char *interface, const in_addr_t gateway)
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <stdlib.h>
#include "mobileap_softap.h"
return;
}
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
int vconf_key = 0;
if (!_mobileap_is_enabled(MOBILE_AP_STATE_WIFI | MOBILE_AP_STATE_WIFI_AP)) {
if (_mobileap_is_enabled(MOBILE_AP_STATE_USB))
_disable_usb_tethering(obj);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_FLIGHT_MODE, NULL);
+ tethering_emit_flight_mode(obj);
return;
}
return;
}
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
char *vconf_key = NULL;
- softap_settings_t new_settings;
+ softap_settings_t *new_settings = _get_softap_settings();
softap_security_type_e sec_type;
if (!_mobileap_is_enabled(MOBILE_AP_STATE_WIFI | MOBILE_AP_STATE_WIFI_AP)) {
}
vconf_key = vconf_keynode_get_str(key);
- if (g_strcmp0(vconf_key, obj->softap_settings.ssid) != 0) {
+ if (g_strcmp0(vconf_key, new_settings->ssid) != 0) {
DBG("Device name is changed\n");
- new_settings = obj->softap_settings;
- if (!g_strcmp0(new_settings.security_type, SOFTAP_SECURITY_TYPE_WPA2_PSK_STR)) {
+ if (!g_strcmp0(new_settings->security_type, SOFTAP_SECURITY_TYPE_WPA2_PSK_STR)) {
sec_type = SOFTAP_SECURITY_TYPE_WPA2_PSK;
} else {
sec_type = SOFTAP_SECURITY_TYPE_OPEN;
}
- g_strlcpy(new_settings.ssid, vconf_key, sizeof(new_settings.ssid));
if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI)) {
- _reload_softap_settings(obj, new_settings.ssid, new_settings.key,
- new_settings.hide_mode, sec_type);
+ _reload_softap_settings(obj, vconf_key, new_settings->key,
+ new_settings->hide_mode, sec_type);
} else if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI_AP)) {
- _reload_softap_settings_for_ap(obj, new_settings.ssid, new_settings.key,
- new_settings.hide_mode, sec_type);
+ _reload_softap_settings_for_ap(obj, vconf_key, new_settings->key,
+ new_settings->hide_mode, sec_type);
}
}
return;
return;
}
-void _unregister_vconf_cb(void *user_data)
+void _unregister_vconf_cb(void)
{
- if (user_data == NULL) {
- ERR("Invalid param\n");
- return;
- }
-
vconf_reg_t vconf_reg[] = {
{VCONFKEY_NETWORK_CELLULAR_STATE,
__handle_network_cellular_state_changed_cb, NULL},
return FALSE;
}
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI) == FALSE) {
ERR("There is no conn. via Wi-Fi tethernig. But nothing to do\n");
}
_disable_wifi_tethering(obj);
- _emit_mobileap_dbus_signal(obj,
- E_SIGNAL_WIFI_TETHER_OFF, SIGNAL_MSG_TIMEOUT);
-
+ tethering_emit_wifi_off(obj, SIGNAL_MSG_TIMEOUT);
+ //_launch_toast_popup(MOBILE_AP_TETHERING_TIMEOUT_TOAST_POPUP);
+ _create_timeout_noti(MH_NOTI_ICON_WIFI);
DBG("-\n");
return FALSE;
}
return FALSE;
}
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
if (_mobileap_is_enabled(MOBILE_AP_STATE_BT) == FALSE) {
ERR("There is no conn. via BT tethering. But nothing to do\n");
}
_disable_bt_tethering(obj);
- _emit_mobileap_dbus_signal(obj,
- E_SIGNAL_BT_TETHER_OFF, SIGNAL_MSG_TIMEOUT);
-
+ tethering_emit_bluetooth_off(obj, SIGNAL_MSG_TIMEOUT);
+ //_launch_toast_popup(MOBILE_AP_TETHERING_TIMEOUT_TOAST_POPUP);
+ _create_timeout_noti(MH_NOTI_ICON_BT);
DBG("-\n");
return FALSE;
}
#include <unistd.h>
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mobileap_notification.h"
#include "mobileap_iptables.h"
-GType tethering_object_get_type(void);
-#define TETHERING_TYPE_OBJECT (tethering_object_get_type())
-G_DEFINE_TYPE(TetheringObject, tethering_object, G_TYPE_OBJECT)
-
GMainLoop *mainloop = NULL;
int mobileap_state = MOBILE_AP_STATE_NONE;
-DBusConnection *tethering_conn = NULL;
-
-gboolean tethering_disable(TetheringObject *obj, DBusGMethodInvocation *context);
-gboolean tethering_get_station_info(TetheringObject *obj,
- DBusGMethodInvocation *context);
-gboolean tethering_get_data_packet_usage(TetheringObject *obj,
- DBusGMethodInvocation *context);
-
-#include "tethering-server-stub.h"
-
-static void tethering_object_init(TetheringObject *obj)
-{
- DBG("+\n");
- g_assert(obj != NULL);
-
- obj->init_count = 0;
- memset(&obj->softap_settings, 0x00, sizeof(obj->softap_settings));
-}
-
-static void tethering_object_finalize(GObject *obj)
-{
- DBG("+\n");
-
- G_OBJECT_CLASS(tethering_object_parent_class)->finalize(obj);
-}
-static void tethering_object_class_init(TetheringObjectClass *klass)
+GDBusObjectManagerServer *manager_server = NULL;
+guint owner_id = 0;
+GDBusConnection *teth_gdbus_conn = NULL;
+Tethering *tethering_obj = NULL;
+static int init_count = 0;
+guint conn_sig_id = 0;
+guint deleted_sig_id = 0;
+gboolean tethering_disable(Tethering *obj, GDBusMethodInvocation *context);
+gboolean tethering_get_station_info(Tethering *obj,
+ GDBusMethodInvocation *context);
+gboolean tethering_get_data_packet_usage(Tethering *obj,
+ GDBusMethodInvocation *context);
+
+Tethering *_get_tethering_obj(void)
{
- GObjectClass *object_class = (GObjectClass *)klass;
- const gchar *signalNames[E_SIGNAL_MAX] = {
- SIGNAL_NAME_NET_CLOSED,
- SIGNAL_NAME_STA_CONNECT,
- SIGNAL_NAME_STA_DISCONNECT,
- SIGNAL_NAME_WIFI_TETHER_ON,
- SIGNAL_NAME_WIFI_TETHER_OFF,
- SIGNAL_NAME_USB_TETHER_ON,
- SIGNAL_NAME_USB_TETHER_OFF,
- SIGNAL_NAME_BT_TETHER_ON,
- SIGNAL_NAME_BT_TETHER_OFF,
- SIGNAL_NAME_WIFI_AP_ON,
- SIGNAL_NAME_WIFI_AP_OFF,
- SIGNAL_NAME_NO_DATA_TIMEOUT,
- SIGNAL_NAME_LOW_BATTERY_MODE,
- SIGNAL_NAME_FLIGHT_MODE,
- SIGNAL_NAME_POWER_SAVE_MODE,
- SIGNAL_NAME_SECURITY_TYPE_CHANGED,
- SIGNAL_NAME_SSID_VISIBILITY_CHANGED,
- SIGNAL_NAME_PASSPHRASE_CHANGED
- };
-
- int i = 0;
-
- g_assert(klass != NULL);
-
- object_class->finalize = tethering_object_finalize;
-
- DBG("Creating signals\n");
-
- for (i = 0; i < E_SIGNAL_MAX; i++) {
- guint signalId;
-
- signalId = g_signal_new(signalNames[i],
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
- klass->signals[i] = signalId;
- }
-
- DBG("Binding to GLib/D-Bus\n");
-
- dbus_g_object_type_install_info(TETHERING_TYPE_OBJECT,
- &dbus_glib_tethering_object_info);
-}
-
-static void __add_station_info_to_array(gpointer data, gpointer user_data)
-{
- mobile_ap_station_info_t *si = (mobile_ap_station_info_t *)data;
- GPtrArray *array = (GPtrArray *)user_data;
- GValue value = {0, {{0}}};
-
- g_value_init(&value, DBUS_STRUCT_STATIONS);
- g_value_take_boxed(&value,
- dbus_g_type_specialized_construct(DBUS_STRUCT_STATIONS));
- dbus_g_type_struct_set(&value, 0, si->interface, 1, si->ip,
- 2, si->mac, 3, si->hostname, 4, (guint)(si->tm), G_MAXUINT);
- g_ptr_array_add(array, g_value_get_boxed(&value));
+ return tethering_obj;
}
gboolean _mobileap_set_state(int state)
DBG("PM control [SUCCESS]\n");
}
-int _init_tethering(TetheringObject *obj)
+int _init_tethering(void)
{
int ret = MOBILE_AP_ERROR_NONE;
- DBG("obj->init_count: %d\n", obj->init_count);
+ DBG("init_count: %d\n", init_count);
- if (obj->init_count > 0) {
- obj->init_count++;
+ if (init_count > 0) {
+ init_count++;
return MOBILE_AP_ERROR_NONE;
}
}
_mh_core_execute_dhcp_server();
- obj->init_count++;
+ init_count++;
return ret;
}
-gboolean _deinit_tethering(TetheringObject *obj)
+gboolean _deinit_tethering(void)
{
- DBG("obj->init_count: %d\n", obj->init_count);
+ DBG("obj->init_count: %d\n", init_count);
guint idle_id;
- if (obj->init_count > 1) {
- obj->init_count--;
+ if (init_count > 1) {
+ init_count--;
return TRUE;
- } else if (obj->init_count <= 0) {
+ } else if (init_count <= 0) {
ERR("Already deinitialized\n");
- obj->init_count = 0;
+ init_count = 0;
return TRUE;
}
- obj->init_count = 0;
+ init_count = 0;
_mh_core_terminate_dhcp_server();
return TRUE;
}
-gboolean tethering_disable(TetheringObject *obj, DBusGMethodInvocation *context)
+gboolean tethering_disable(Tethering *obj, GDBusMethodInvocation *context)
{
int ret = MOBILE_AP_ERROR_NONE;
if (_mobileap_is_disabled()) {
ERR("Mobile hotspot has not been enabled\n");
ret = MOBILE_AP_ERROR_NOT_ENABLED;
- dbus_g_method_return(context, MOBILE_AP_DISABLE_CFM, ret);
+ tethering_complete_disable(obj, context, MOBILE_AP_DISABLE_CFM, ret);
return FALSE;
}
_disable_bt_tethering(obj);
_disable_usb_tethering(obj);
- dbus_g_method_return(context, MOBILE_AP_DISABLE_CFM, ret);
+ tethering_complete_disable(obj, context, MOBILE_AP_DISABLE_CFM, ret);
return TRUE;
}
-gboolean tethering_get_station_info(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_get_station_info(Tethering *obj,
+ GDBusMethodInvocation *context)
{
DBG("+\n");
- GPtrArray *array = g_ptr_array_new();
+ GVariant *var = NULL;
g_assert(obj != NULL);
g_assert(context != NULL);
- _station_info_foreach(__add_station_info_to_array, array);
+ var = _station_info_foreach();
- dbus_g_method_return(context, MOBILE_AP_GET_STATION_INFO_CFM, array);
- g_ptr_array_free(array, TRUE);
+ g_dbus_method_invocation_return_value(context, var);
+ g_variant_unref(var);
DBG("-\n");
-
return TRUE;
}
-gboolean tethering_get_data_packet_usage(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_get_data_packet_usage(Tethering *obj,
+ GDBusMethodInvocation *context)
{
char *if_name = NULL;
unsigned long long wifi_tx_bytes = 0;
unsigned long long rx_bytes = 0;
if (_get_network_interface_name(&if_name) == FALSE) {
- dbus_g_method_return(context, MOBILE_AP_GET_DATA_PACKET_USAGE_CFM,
+ tethering_complete_get_data_packet_usage(obj, context,
+ MOBILE_AP_GET_DATA_PACKET_USAGE_CFM,
0ULL, 0ULL);
return FALSE;
}
tx_bytes = wifi_tx_bytes + bt_tx_bytes + usb_tx_bytes;
rx_bytes = wifi_rx_bytes + bt_rx_bytes + usb_rx_bytes;
- dbus_g_method_return(context, MOBILE_AP_GET_DATA_PACKET_USAGE_CFM,
+ tethering_complete_get_data_packet_usage(obj, context, MOBILE_AP_GET_DATA_PACKET_USAGE_CFM,
tx_bytes, rx_bytes);
return TRUE;
}
-static DBusHandlerResult __dnsmasq_signal_filter(DBusConnection *conn,
- DBusMessage *msg, void *user_data)
+void static __handle_dnsmasq_dhcp_status_changed_cb(GDBusConnection *connection,
+ const gchar *sender_name, const gchar *object_path,
+ const gchar *interface_name, const gchar *signal_name,
+ GVariant *parameters, gpointer user_data)
{
- if (!user_data) {
- ERR("Invalid param\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
+ DBG("+\n");
char *ip_addr = NULL;
char *mac = NULL;
char *name = NULL;
char *bt_remote_device_name = NULL;
- DBusError error;
mobile_ap_type_e type = MOBILE_AP_TYPE_MAX;
- TetheringObject *obj = (TetheringObject *)user_data;
mobile_ap_station_info_t *info = NULL;
int n_station = 0;
time_t tm;
- dbus_error_init(&error);
- if (dbus_message_is_signal(msg, DNSMASQ_DBUS_INTERFACE,
- "DhcpConnected")) {
- if (!dbus_message_get_args(msg, &error,
- DBUS_TYPE_STRING, &ip_addr,
- DBUS_TYPE_STRING, &mac,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID)) {
- ERR("Cannot read message, cause: %s\n", error.message);
- dbus_error_free(&error);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
+ if (signal_name == NULL) {
+ ERR("singal name is NULL\n");
+ return;
+ }
+ g_variant_get(parameters, "(sss)", &ip_addr, &mac, &name);
+ if (!g_strcmp0(signal_name, "DhcpConnected")) {
SDBG("DhcpConnected signal : %s %s %s\n", ip_addr, mac, name);
/*
* DHCP ACK received, destroy timeout if exists
*/
+ if (ip_addr == NULL || mac == NULL) {
+ goto EXIT;
+ }
_destroy_dhcp_ack_timer(mac);
if (_get_tethering_type_from_ip(ip_addr, &type) != MOBILE_AP_ERROR_NONE)
- return DBUS_HANDLER_RESULT_HANDLED;
+ goto EXIT;
if (_mobileap_is_enabled_by_type(type) == FALSE) {
- return DBUS_HANDLER_RESULT_HANDLED;
+ goto EXIT;
}
- info = (mobile_ap_station_info_t *)malloc(sizeof(mobile_ap_station_info_t));
+ info = (mobile_ap_station_info_t *)g_malloc(sizeof(mobile_ap_station_info_t));
if (info == NULL) {
ERR("malloc failed\n");
- return DBUS_HANDLER_RESULT_HANDLED;
+ goto EXIT;
}
info->interface = type;
else
info->hostname = g_strdup(name);
} else if (type == MOBILE_AP_TYPE_BT) {
- _bt_get_remote_device_name(obj, mac, &bt_remote_device_name);
+ _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
}
time(&tm);
info->tm = tm;
-
if (_add_station_info(info) != MOBILE_AP_ERROR_NONE) {
+ ERR("_add_station_info is failed\n");
g_free(info->hostname);
- free(info);
- return DBUS_HANDLER_RESULT_HANDLED;
+ g_free(info);
+ goto EXIT;
}
_get_station_count((gconstpointer)type,
_stop_timeout_cb(type);
_send_dbus_station_info("DhcpConnected", info);
-
- return DBUS_HANDLER_RESULT_HANDLED;
- } else if (dbus_message_is_signal(msg, DNSMASQ_DBUS_INTERFACE,
- "DhcpLeaseDeleted")) {
- if (!dbus_message_get_args(msg, &error,
- DBUS_TYPE_STRING, &ip_addr,
- DBUS_TYPE_STRING, &mac,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID)) {
- ERR("Cannot read message, cause: %s\n", error.message);
- dbus_error_free(&error);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
+ } else if (!g_strcmp0(signal_name, "DhcpLeaseDeleted")) {
SDBG("DhcpLeaseDeleted signal : %s %s %s\n", ip_addr, mac, name);
-
_remove_station_info(ip_addr, _slist_find_station_by_ip_addr);
+ } else {
+ SDBG("UNKNOWN member signal\n");
+ }
+EXIT :
+ g_free(ip_addr);
+ g_free(mac);
+ g_free(name);
+ DBG("-\n");
+}
+
+static void on_bus_acquired_cb (GDBusConnection *connection, const gchar *name,
+ gpointer user_data)
+{
+ DBG("+\n");
+ GDBusInterfaceSkeleton *intf = NULL;
+ teth_gdbus_conn = connection;
- return DBUS_HANDLER_RESULT_HANDLED;
+ manager_server = g_dbus_object_manager_server_new(TETHERING_SERVICE_OBJECT_PATH);
+ if(manager_server == NULL) {
+ DBG("Manager server not created.");
+ return;
}
+ tethering_obj = tethering_skeleton_new();
+ intf = G_DBUS_INTERFACE_SKELETON(tethering_obj);
+ if (!g_dbus_interface_skeleton_export(intf, connection,
+ TETHERING_SERVICE_OBJECT_PATH, NULL)) {
+ ERR("Export with path failed");
+ } else {
+ DBG("Export sucessss");
+ }
+
+ 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",
+ G_CALLBACK(tethering_enable_bt_tethering), NULL);
+ g_signal_connect(tethering_obj, "handle-enable-usb-tethering",
+ G_CALLBACK(tethering_enable_usb_tethering), NULL);
+ g_signal_connect(tethering_obj, "handle-disable-wifi-tethering",
+ G_CALLBACK(tethering_disable_wifi_tethering), NULL);
+ g_signal_connect(tethering_obj, "handle-disable-bt-tethering",
+ G_CALLBACK(tethering_disable_bt_tethering), NULL);
+ g_signal_connect(tethering_obj, "handle-disable-usb-tethering",
+ G_CALLBACK(tethering_disable_usb_tethering), NULL);
+ g_signal_connect(tethering_obj, "handle-enable-wifi-ap",
+ G_CALLBACK(tethering_enable_wifi_ap), NULL);
+
+ g_signal_connect(tethering_obj, "handle-disable-wifi-ap",
+ G_CALLBACK(tethering_disable_wifi_ap), NULL);
+ g_signal_connect(tethering_obj, "handle-reload-wifi-settings",
+ G_CALLBACK(tethering_reload_wifi_settings), NULL);
+ g_signal_connect(tethering_obj, "handle-reload-wifi-ap-settings",
+ G_CALLBACK(tethering_reload_wifi_ap_settings), NULL);
+ g_signal_connect(tethering_obj, "handle-get-station-info",
+ G_CALLBACK(tethering_get_station_info), NULL);
+ g_signal_connect(tethering_obj, "handle-get-data-packet-usage",
+ G_CALLBACK(tethering_get_data_packet_usage), NULL);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ _init_network((void *)tethering_obj);
+ _register_vconf_cb((void *)tethering_obj);
+
+ conn_sig_id = g_dbus_connection_signal_subscribe(connection, NULL, DNSMASQ_DBUS_INTERFACE,
+ "DhcpConnected", NULL, NULL, G_DBUS_SIGNAL_FLAGS_NONE,
+ __handle_dnsmasq_dhcp_status_changed_cb, NULL, NULL);
+ deleted_sig_id = g_dbus_connection_signal_subscribe(connection, NULL, DNSMASQ_DBUS_INTERFACE,
+ "DhcpLeaseDeleted", NULL, NULL, G_DBUS_SIGNAL_FLAGS_NONE,
+ __handle_dnsmasq_dhcp_status_changed_cb, NULL, NULL);
+
+ g_dbus_object_manager_server_set_connection(manager_server, connection);
+ DBG("-\n");
}
-int main(int argc, char **argv)
+static void on_name_acquired_cb(GDBusConnection *connection, const gchar *name,
+ gpointer user_data)
{
- const char *rule = "type='signal',interface='"DNSMASQ_DBUS_INTERFACE"'";
+ DBG("+\n");
+
+ DBG("-\n");
+}
+
+static void on_name_lost_db(GDBusConnection *conn, const gchar *name,
+ gpointer user_data)
+{
+ DBG("+\n");
+ /* May service name is already in use */
+ ERR("Service name is already in use");
- TetheringObject *tethering_obj = NULL;
- DBusGConnection *tethering_bus = NULL;
- DBusGProxy *tethering_bus_proxy = NULL;
- DBusError dbus_error;
- GError *error = NULL;
- guint result = 0;
- int ret;
+ /* The result of DBus name request is only permitted,
+ * such as DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER.
+ */
+ exit(2);
+
+ DBG("-\n");
+}
+
+static int __tethering_setup_gdbus(void)
+{
+ DBG("+\n");
+
+ owner_id = g_bus_own_name(DBUS_BUS_SYSTEM, TETHERING_SERVICE_NAME,
+ G_BUS_NAME_OWNER_FLAGS_NONE, on_bus_acquired_cb,
+ on_name_acquired_cb, on_name_lost_db, NULL, NULL);
+
+ if (!owner_id) {
+ ERR("g_bus_own_name is failed\n");
+ return -1;
+ }
+ return 0;
+}
+int main(int argc, char **argv)
+{
+ int ret = 0;
DBG("+\n");
return 0;
}
- /* D-Bus init */
- tethering_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
- if (error != NULL) {
- ERR("Couldn't connect to system bus[%s]\n", error->message);
- g_error_free(error);
- goto failure;
- }
-
- tethering_bus_proxy = dbus_g_proxy_new_for_name(tethering_bus,
- DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
- if (tethering_bus_proxy == NULL) {
- ERR("Failed to get a proxy for D-Bus\n");
- goto failure;
- }
- if (!dbus_g_proxy_call(tethering_bus_proxy, "RequestName", &error,
- G_TYPE_STRING, TETHERING_SERVICE_NAME,
- G_TYPE_UINT, 0, G_TYPE_INVALID,
- G_TYPE_UINT, &result, G_TYPE_INVALID)) {
- ERR("dbus_g_proxy_call is failed\n");
- if (error) {
- ERR("D-Bus.RequestName RPC failed[%s]\n",
- error->message);
- g_error_free(error);
- }
- goto failure;
- }
- if (result != 1) {
- ERR("Failed to get the primary well-known name.\n");
- goto failure;
- }
- g_object_unref(tethering_bus_proxy);
- tethering_bus_proxy = NULL;
-
- tethering_obj = g_object_new(TETHERING_TYPE_OBJECT, NULL);
- if (tethering_obj == NULL) {
- ERR("Failed to create one Tethering instance.\n");
- goto failure;
- }
- dbus_g_connection_register_g_object(tethering_bus,
- TETHERING_SERVICE_OBJECT_PATH, G_OBJECT(tethering_obj));
-
- tethering_conn = dbus_g_connection_get_connection(tethering_bus);
- dbus_error_init(&dbus_error);
- dbus_bus_add_match(tethering_conn, rule, &dbus_error);
- if (dbus_error_is_set(&dbus_error)) {
- ERR("Cannot add D-BUS match rule, cause: %s", dbus_error.message);
- dbus_error_free(&dbus_error);
- goto failure;
+ ret = __tethering_setup_gdbus();
+ if (ret < 0) {
+ ERR("tethering_setup_gdbus is failed\n");
+ return 0;
}
- dbus_connection_add_filter(tethering_conn, __dnsmasq_signal_filter, tethering_obj, NULL);
-
/* Platform modules */
if (appcore_set_i18n(MOBILEAP_LOCALE_COMMON_PKG, MOBILEAP_LOCALE_COMMON_RES) < 0) {
ERR("appcore_set_i18n is failed\n");
mobileap_state = MOBILE_AP_STATE_NONE;
}
- _init_network((void *)tethering_obj);
_register_wifi_station_handler();
- _register_vconf_cb((void *)tethering_obj);
ret = wifi_initialize();
if (ret != WIFI_ERROR_NONE) {
ERR("wifi_deinitialize() is failed : %d\n", ret);
}
- _unregister_vconf_cb((void *)tethering_obj);
+ _unregister_vconf_cb();
_unregister_wifi_station_handler();
_deinit_network();
- dbus_connection_remove_filter(tethering_conn, __dnsmasq_signal_filter, tethering_obj);
- dbus_bus_remove_match(tethering_conn, rule, NULL);
+ g_dbus_connection_signal_unsubscribe(teth_gdbus_conn, conn_sig_id);
+ g_dbus_connection_signal_unsubscribe(teth_gdbus_conn, deleted_sig_id);
g_object_unref(tethering_obj);
- dbus_g_connection_unref(tethering_bus);
-
- DBG("-\n");
- return 0;
-
- failure:
- if (tethering_obj)
- g_object_unref(tethering_obj);
- if (tethering_bus_proxy)
- g_object_unref(tethering_bus_proxy);
- if (tethering_bus)
- dbus_g_connection_unref(tethering_bus);
-
+ g_bus_unown_name(owner_id);
+ g_object_unref(manager_server);
DBG("-\n");
return 0;
}
unsigned short new_dest_port;
} port_forward_info_s;
-static TetheringObject *obj = NULL;
+static Tethering *obj = NULL;
static connection_h connection = NULL;
static tethering_cellular_profile_s c_prof = {NULL, __NO_SERVICE};
static guint net_timeout_id;
err = MOBILE_AP_ERROR_ALREADY_ENABLED;
break;
+#ifndef TIZEN_TV
case CONNECTION_ERROR_PERMISSION_DENIED:
err = MOBILE_AP_ERROR_PERMISSION_DENIED;
break;
+#endif
case CONNECTION_ERROR_DHCP_FAILED:
err = MOBILE_AP_ERROR_DHCP;
ret = _disable_usb_tethering(obj);
DBG("_disable_usb_tethering returns %d\n", ret);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_NET_CLOSED, NULL);
-
- return;
+ tethering_emit_net_closed(obj);
}
static gboolean __is_equal_profile(connection_profile_h a, connection_profile_h b)
int ret;
- obj = (TetheringObject *)user_data;
+ obj = (Tethering *)user_data;
ret = connection_create(&connection);
if (ret != CONNECTION_ERROR_NONE) {
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <stdio.h>
#include <string.h>
#include <notification.h>
+#include <notification_list.h>
+#include <notification_text_domain.h>
+#include <notification_internal.h>
#include <bluetooth.h>
+#include <bundle_internal.h>
#include "mobileap_softap.h"
#include "mobileap_notification.h"
-#define MH_NOTI_LAUNCH_PKGNAME "setting-mobileap-efl"
+#define MH_NOTI_LAUNCH_PKGNAME "ug-setting-mobileap-efl"
#define MH_NOTI_CALLER_PKGNAME "mobileap-agent"
#define MH_LOCALE_DOMAIN "ug-setting-mobileap-efl"
#define MH_LOCALE_DIR "/usr/ug/res/locale"
b = bundle_create();
bundle_add(b, "caller", "notification");
- appsvc_set_pkgname(b, "setting-mobileap-efl");
+#ifndef TIZEN_TV
+ appsvc_set_pkgname(b, "ug-setting-mobileap-efl");
+#endif
ret = notification_set_execute_option(noti,
NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, "Launch", NULL, b);
active_count++;
if (active_count == 1)
- __create_status_noti(_("IDS_COM_BODY_TETHERING_ENABLED"));
+ __create_status_noti(_("IDS_MOBILEAP_BODY_TETHERING_ACTIVE_ABB"));
return;
}
int ret;
bt_adapter_visibility_mode_e mode = BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
int duration;
- int str_len;
char *str1 = NULL;
char *str2 = NULL;
- char *str = NULL;
if (!_mobileap_is_enabled(MOBILE_AP_STATE_WIFI) &&
!_mobileap_is_enabled(MOBILE_AP_STATE_USB)) {
#include <sys/ioctl.h>
#include <glib.h>
#include <glib-object.h>
-#include <dbus/dbus-glib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
g_free(conf);
return MOBILE_AP_ERROR_RESOURCE;
}
- fputs(conf, fp);
- g_free(conf);
+
+ if (conf) {
+ fputs(conf, fp);
+ g_free(conf);
+ }
fclose(fp);
pid = fork();
return MOBILE_AP_ERROR_NONE;
}
-void _mh_core_add_data_to_array(GPtrArray *array, guint type, gchar *dev_name)
-{
- GValue value = {0, {{0}}};
-
- g_value_init(&value, DBUS_STRUCT_UINT_STRING);
- g_value_take_boxed(&value,
- dbus_g_type_specialized_construct(DBUS_STRUCT_UINT_STRING));
- dbus_g_type_struct_set(&value, 0, type, 1, dev_name, G_MAXUINT);
- g_ptr_array_add(array, g_value_get_boxed(&value));
-}
-
int _mh_core_set_ip_address(const char *if_name, const in_addr_t ip)
{
struct ifreq ifr;
static void __handle_station_signal(int sig)
{
- g_idle_add(__send_station_event_cb, GINT_TO_POINTER(sig));
- return;
+ int idle_id = 0;
+ idle_id = g_idle_add(__send_station_event_cb, GINT_TO_POINTER(sig));
+ if (idle_id == 0) {
+ ERR("g_idle_add is failed\n");
+ }
}
void _register_wifi_station_handler(void)
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include "mobileap_common.h"
#include "mobileap_usb.h"
-static DBusGMethodInvocation *g_context = NULL;
+static GDBusMethodInvocation *g_context = NULL;
static gboolean in_progress = FALSE;
static GDBusConnection *conn = NULL;
static guint subscription_id = 0;
GVariant *parameters, gpointer user_data)
{
unsigned int value = 0;
- TetheringObject *obj = (TetheringObject *)user_data;
+ Tethering *obj = (Tethering *)user_data;
if (NULL == parameters || NULL == obj) {
ERR("Paramters Invalid \n");
_disable_usb_tethering(obj);
if (g_context) {
- dbus_g_method_return(g_context, MOBILE_AP_ENABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_RESOURCE);
+ tethering_complete_enable_usb_tethering(obj, g_context, MOBILE_AP_ERROR_RESOURCE);
g_context = NULL;
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_OFF,
- SIGNAL_MSG_NOT_AVAIL_INTERFACE);
+ tethering_emit_usb_off(obj, SIGNAL_MSG_NOT_AVAIL_INTERFACE);
}
}
return;
}
- char *vconf_name;
+ char *vconf_name = NULL;
int vconf_key;
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
if (!_mobileap_is_enabled(MOBILE_AP_STATE_USB)) {
ERR("USB tethering is not enabled\n");
}
vconf_name = vconf_keynode_get_name(key);
+ if (vconf_name == NULL) {
+ ERR("vconf_keynode_get_name is failed\n");
+ return;
+ }
vconf_key = vconf_keynode_get_int(key);
+ if (vconf_key < 0) {
+ ERR("vconf_keynode_get_int is failed\n");
+ return;
+ }
SDBG("key = %s, value = %d(int)\n", vconf_name, vconf_key);
/*
_disable_usb_tethering(obj);
if (g_context) {
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_RESOURCE);
+ g_dbus_method_invocation_return_value(g_context,
+ g_variant_new("(uu)", MOBILE_AP_ENABLE_USB_TETHERING_CFM,
+ MOBILE_AP_ERROR_RESOURCE));
g_context = NULL;
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_OFF,
- SIGNAL_MSG_NOT_AVAIL_INTERFACE);
+ tethering_emit_usb_off(obj, SIGNAL_MSG_NOT_AVAIL_INTERFACE);
}
return;
return;
}
- TetheringObject *obj = (TetheringObject *)data;
+ Tethering *obj = (Tethering *)data;
int ret;
int vconf_key;
guint idle_id;
ERR("USB Mode is changed suddenly\n");
_disable_usb_tethering(obj);
if (g_context) {
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_RESOURCE);
+ tethering_complete_enable_usb_tethering(obj, g_context, MOBILE_AP_ERROR_RESOURCE);
g_context = NULL;
}
return;
}
_add_interface_routing(USB_IF, IP_ADDRESS_USB);
_add_routing_rule(USB_IF);
-
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_ON, NULL);
+ tethering_emit_usb_on(obj);
+ _create_tethering_active_noti();
if (g_context) {
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_NONE);
+ tethering_complete_enable_usb_tethering(obj, g_context, MOBILE_AP_ERROR_NONE);
g_context = NULL;
}
} else {
DBG("USB tethering is disabled\n");
vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT,
__handle_usb_mode_change);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_OFF, NULL);
+ tethering_emit_usb_off(obj, NULL);
if (g_context) {
- dbus_g_method_return(g_context,
- MOBILE_AP_DISABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_NONE);
+ tethering_complete_disable_usb_tethering(obj, g_context, MOBILE_AP_DISABLE_USB_TETHERING_CFM, NULL);
g_context = NULL;
}
}
}
-mobile_ap_error_code_e _enable_usb_tethering(TetheringObject *obj)
+mobile_ap_error_code_e _enable_usb_tethering(Tethering *obj)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
int vconf_ret;
goto FAIL;
}
- ret = _init_tethering(obj);
+ ret = _init_tethering();
if (ret != MOBILE_AP_ERROR_NONE) {
goto FAIL;
}
ERR("Error getting vconf\n");
vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT,
__handle_usb_mode_change);
- _deinit_tethering(obj);
+ _deinit_tethering();
ret = MOBILE_AP_ERROR_RESOURCE;
goto FAIL;
}
return ret;
}
-mobile_ap_error_code_e _disable_usb_tethering(TetheringObject *obj)
+mobile_ap_error_code_e _disable_usb_tethering(Tethering *obj)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
return ret;
}
- _deinit_tethering(obj);
+ _deinit_tethering();
if (_remove_station_info_all(MOBILE_AP_TYPE_USB) != MOBILE_AP_ERROR_NONE) {
ERR("_remove_station_info_all is failed. Ignore it\n");
return ret;
}
-gboolean tethering_enable_usb_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_enable_usb_tethering(Tethering *obj, GDBusMethodInvocation *context)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = FALSE;
if (g_context) {
DBG("It is turnning on\n");
- dbus_g_method_return(context,
- MOBILE_AP_ENABLE_USB_TETHERING_CFM,
- MOBILE_AP_ERROR_IN_PROGRESS);
+ tethering_complete_enable_usb_tethering(obj, g_context, MOBILE_AP_ERROR_IN_PROGRESS);
return FALSE;
}
goto DONE;
} else {
DBG("Don't need to wait for usb-setting\n");
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_ON, NULL);
+ tethering_emit_usb_on(obj);
+ _create_tethering_active_noti();
ret_val = TRUE;
}
DONE:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_USB_TETHERING_CFM, ret);
+ tethering_complete_enable_usb_tethering(obj, g_context, ret);
+
g_context = NULL;
return ret_val;
}
-gboolean tethering_disable_usb_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_disable_usb_tethering(Tethering *obj,
+ GDBusMethodInvocation *context)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
int usb_mode = SETTING_USB_NONE_MODE;
if (g_context) {
DBG("It is turnning on\n");
- dbus_g_method_return(context,
+ tethering_complete_disable_usb_tethering(obj, context,
MOBILE_AP_DISABLE_USB_TETHERING_CFM,
MOBILE_AP_ERROR_IN_PROGRESS);
return FALSE;
ret = _disable_usb_tethering(obj);
if (ret != MOBILE_AP_ERROR_NONE) {
- dbus_g_method_return(g_context,
+ tethering_complete_disable_usb_tethering(obj, g_context,
MOBILE_AP_DISABLE_USB_TETHERING_CFM, ret);
g_context = NULL;
return FALSE;
DONE:
vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT,
__handle_usb_mode_change);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_USB_TETHER_OFF, NULL);
- dbus_g_method_return(g_context,
+ tethering_emit_usb_off(obj, NULL);
+ tethering_complete_disable_usb_tethering(obj, g_context,
MOBILE_AP_DISABLE_USB_TETHERING_CFM, ret);
g_context = NULL;
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static mobile_ap_error_code_e __update_softap_settings(softap_settings_t *st,
gchar *ssid, gchar *passphrase, int hide_mode, softap_security_type_e security_type);
-static int __turn_off_wifi(TetheringObject *obj);
+static int __turn_off_wifi(Tethering *obj);
-static DBusGMethodInvocation *g_context = NULL;
+static GDBusMethodInvocation *g_context = NULL;
static guint wifi_recovery_timeout_id = 0;
static gboolean prev_wifi_on = FALSE;
static wifi_saved_settings wifi_settings = {0, NULL, NULL, 0};
+static softap_settings_t obj_softap_settings = {0, "", "", ""};
+softap_settings_t *_get_softap_settings()
+{
+ return &obj_softap_settings;
+}
static void _wifi_direct_state_cb(int error_code, wifi_direct_device_state_e state, void *user_data)
{
bool wifi_state = false;
return;
}
- TetheringObject *obj = (TetheringObject *)user_data;
+ Tethering *obj = (Tethering *)user_data;
int ret = 0;
if (state != WIFI_DIRECT_DEVICE_STATE_DEACTIVATED) {
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_TETHER_ON, NULL);
+ tethering_emit_wifi_on(obj);
+ _create_tethering_active_noti();
}
DONE:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_WIFI_TETHERING_CFM, ret);
+ tethering_complete_enable_wifi_tethering(obj, g_context, ret);
g_context = NULL;
g_free(wifi_settings.ssid);
return;
}
- TetheringObject *obj = (TetheringObject *)user_data;
+ Tethering *obj = (Tethering *)user_data;
int ret;
if (result != WIFI_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
prev_wifi_on = TRUE;
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_TETHER_ON, NULL);
+ tethering_emit_wifi_on(obj);
+ _create_tethering_active_noti();
}
DONE:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_WIFI_TETHERING_CFM, ret);
+ tethering_complete_enable_wifi_tethering(obj, g_context, ret);
+
g_context = NULL;
g_free(wifi_settings.ssid);
return;
}
-static int __turn_off_wifi(TetheringObject *obj)
+static int __turn_off_wifi(Tethering *obj)
{
int ret;
return wifi_direct_state != 0 ? TRUE : FALSE;
}
-static int __turn_off_wifi_direct(TetheringObject *obj)
+static int __turn_off_wifi_direct(Tethering *obj)
{
int ret;
return TRUE;
}
-mobile_ap_error_code_e _reload_softap_settings(TetheringObject *obj,
+mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
gchar *ssid, gchar *key, gint hide_mode, gint security_type)
{
gboolean backup_prev_wifi_on = prev_wifi_on;
mobile_ap_error_code_e ret;
- softap_settings_t *old_settings = &obj->softap_settings;
+ softap_settings_t *old_settings = _get_softap_settings();
softap_settings_t new_settings;
if (obj == NULL || ssid == NULL || !strlen(ssid)) {
ERR("_enable_wifi_tethering is failed : %d\n", ret);
return ret;
}
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_TETHER_ON, NULL);
+ tethering_emit_wifi_on(obj);
+ _create_tethering_active_noti();
return MOBILE_AP_ERROR_NONE;
}
-mobile_ap_error_code_e _reload_softap_settings_for_ap(TetheringObject *obj,
+mobile_ap_error_code_e _reload_softap_settings_for_ap(Tethering *obj,
gchar *ssid, gchar *key, gint hide_mode, gint security_type)
{
gboolean backup_prev_wifi_on = prev_wifi_on;
mobile_ap_error_code_e ret;
- softap_settings_t *old_settings = &obj->softap_settings;
+ softap_settings_t *old_settings = _get_softap_settings();
softap_settings_t new_settings;
if (obj == NULL || ssid == NULL || !strlen(ssid)) {
return MOBILE_AP_ERROR_NONE;
}
-void _add_wifi_device_to_array(softap_device_info_t *di, GPtrArray *array)
-{
- int i = 0;
- GIOChannel *io = NULL;
- gchar *line = NULL;
- gchar *device_name = NULL;
- gchar ip_addr[MOBILE_AP_STR_INFO_LEN] = {0, };
- gchar mac_addr[MOBILE_AP_STR_INFO_LEN] = {0, };
- gchar name[MOBILE_AP_STR_HOSTNAME_LEN] = {0, };
- gchar expire[MOBILE_AP_STR_INFO_LEN] = {0, };
- gchar extra[MOBILE_AP_STR_INFO_LEN] = {0, };
-
- int found = 0;
-
- for (i = 0; i < di->number; i++)
- SDBG("bssid[%d]:%s\n", i, di->bssid[i]);
-
- DBG("Number of connected device:%d\n", di->number);
-
- io = g_io_channel_new_file(DNSMASQ_LEASES_FILE, "r", NULL);
-
- while (g_io_channel_read_line(io, &line, NULL, NULL, NULL) ==
- G_IO_STATUS_NORMAL) {
- sscanf(line, "%19s %19s %19s %19s %19s", expire, mac_addr,
- ip_addr, name, extra);
- SDBG("mac_addr:%s ip_addr:%s name:%s expire:%s\n", mac_addr,
- ip_addr, name, expire);
-
- for (i = 0; i < di->number; i++) {
- if (g_ascii_strcasecmp(di->bssid[i], mac_addr) == 0) {
- if (!strcmp(name, "*"))
- device_name = MOBILE_AP_NAME_UNKNOWN;
- else
- device_name = name;
-
- _mh_core_add_data_to_array(array, MOBILE_AP_TYPE_WIFI,
- device_name);
-
- found++;
-
- break;
- }
- }
-
- g_free(line);
- }
- g_io_channel_unref(io);
-
- /* Set the name UNKNOWN unless we got the name. */
- for (i = found; i < di->number; i++) {
- _mh_core_add_data_to_array(array, MOBILE_AP_TYPE_WIFI,
- MOBILE_AP_NAME_UNKNOWN);
- }
-}
-
-mobile_ap_error_code_e _enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
+mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
gchar *passphrase, int hide_mode, softap_security_type_e security_type)
{
mobile_ap_error_code_e ret;
return ret;
}
- /* Update Wi-Fi hotspot data to common object */
- ret = __update_softap_settings(&obj->softap_settings, ssid, passphrase,
+ /* Update Wi-Fi hotspot data to global settings pointer */
+ ret = __update_softap_settings(&obj_softap_settings, ssid, passphrase,
hide_mode, security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI);
}
if (vconf_set_str(VCONFKEY_MOBILE_HOTSPOT_SSID,
- obj->softap_settings.ssid) < 0) {
+ obj_softap_settings.ssid) < 0) {
ERR("vconf_set_str is failed\n");
}
/* Initialize tethering */
_block_device_sleep();
- ret = _init_tethering(obj);
+ ret = _init_tethering();
if (ret != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI);
goto DONE;
/* Upload driver */
ret = _mh_core_enable_softap(MOBILE_AP_TYPE_WIFI,
- obj->softap_settings.ssid,
- obj->softap_settings.security_type,
- obj->softap_settings.key,
- obj->softap_settings.hide_mode);
+ obj_softap_settings.ssid,
+ obj_softap_settings.security_type,
+ obj_softap_settings.key,
+ obj_softap_settings.hide_mode);
if (ret != MOBILE_AP_ERROR_NONE) {
- _deinit_tethering(obj);
+ _deinit_tethering();
_mobileap_clear_state(MOBILE_AP_STATE_WIFI);
goto DONE;
}
return ret;
}
-mobile_ap_error_code_e _enable_wifi_ap(TetheringObject *obj,
- gchar *ssid, gchar *passphrase, int hide_mode,
- softap_security_type_e security_type)
+mobile_ap_error_code_e _enable_wifi_ap(Tethering *obj,
+ gchar *ssid, gchar *passphrase, int hide_mode,
+ softap_security_type_e security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
if (!_mobileap_set_state(MOBILE_AP_STATE_WIFI_AP)) {
return MOBILE_AP_ERROR_RESOURCE;
}
-
- ret = __update_softap_settings(&obj->softap_settings, ssid, passphrase,
+ ret = __update_softap_settings(&obj_softap_settings, ssid, passphrase,
hide_mode, security_type);
if (ret != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP);
_block_device_sleep();
- if (_init_tethering(obj) != MOBILE_AP_ERROR_NONE) {
+ if (_init_tethering() != MOBILE_AP_ERROR_NONE) {
_mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP);
ret = MOBILE_AP_ERROR_RESOURCE;
goto DONE;
/* Upload driver */
ret = _mh_core_enable_softap(MOBILE_AP_TYPE_WIFI_AP,
- obj->softap_settings.ssid,
- obj->softap_settings.security_type,
- obj->softap_settings.key,
- obj->softap_settings.hide_mode);
+ obj_softap_settings.ssid,
+ obj_softap_settings.security_type,
+ obj_softap_settings.key,
+ obj_softap_settings.hide_mode);
if (ret != MOBILE_AP_ERROR_NONE) {
- _deinit_tethering(obj);
+ _deinit_tethering();
_mobileap_clear_state(MOBILE_AP_STATE_WIFI_AP);
goto DONE;
}
return ret;
}
-mobile_ap_error_code_e _disable_wifi_tethering(TetheringObject *obj)
+mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj)
{
int ret;
int state;
goto DONE;
}
- _deinit_tethering(obj);
+ _deinit_tethering();
_mobileap_clear_state(state);
if (prev_wifi_on == TRUE) {
return ret;
}
-mobile_ap_error_code_e _disable_wifi_ap(TetheringObject *obj)
+mobile_ap_error_code_e _disable_wifi_ap(Tethering *obj)
{
int ret;
int state;
goto DONE;
}
- _deinit_tethering(obj);
+ _deinit_tethering();
_mobileap_clear_state(state);
DBG("_disable_wifi_ap is done\n");
return ret;
}
-gboolean tethering_enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
- gchar *key, gint visibility, gint security_type,
- DBusGMethodInvocation *context)
+gboolean tethering_enable_wifi_tethering(Tethering *obj,
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gint visibility, gint security_type)
{
+ DBG("+\n");
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = FALSE;
bool wifi_state = false;
-
- DBG("+\n");
g_assert(obj != NULL);
g_assert(context != NULL);
if (g_context) {
DBG("It is turnning on\n");
- dbus_g_method_return(context,
- MOBILE_AP_ENABLE_WIFI_TETHERING_CFM,
+ tethering_complete_enable_wifi_tethering(obj, g_context,
MOBILE_AP_ERROR_IN_PROGRESS);
return FALSE;
}
-
g_context = context;
wifi_settings.ssid = g_strdup(ssid);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_TETHER_ON, NULL);
+ tethering_emit_wifi_on(obj);
+ _create_tethering_active_noti();
ret_val = TRUE;
}
DONE:
- dbus_g_method_return(g_context,
- MOBILE_AP_ENABLE_WIFI_TETHERING_CFM, ret);
+ tethering_complete_enable_wifi_tethering(obj, g_context, ret);
g_context = NULL;
g_free(wifi_settings.ssid);
return ret_val;
}
-gboolean tethering_disable_wifi_tethering(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_disable_wifi_tethering(Tethering *obj,
+ GDBusMethodInvocation *context)
{
int ret = MOBILE_AP_ERROR_NONE;
ret = _disable_wifi_tethering(obj);
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_TETHER_OFF, NULL);
- dbus_g_method_return(context, MOBILE_AP_DISABLE_WIFI_TETHERING_CFM, ret);
+ tethering_emit_wifi_off(obj, NULL);
+ tethering_complete_disable_wifi_tethering(obj, context,
+ MOBILE_AP_DISABLE_WIFI_TETHERING_CFM, ret);
+
if (ret != MOBILE_AP_ERROR_NONE)
return FALSE;
return TRUE;
}
-gboolean tethering_enable_wifi_ap(TetheringObject *obj, gchar *ssid, gchar *key,
- gint visibility, gint security_type, DBusGMethodInvocation *context)
+gboolean tethering_enable_wifi_ap(Tethering *obj, GDBusMethodInvocation *context,
+ gchar *ssid, gchar *key, gint visibility, gint security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = FALSE;
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("_enable_wifi_tethering is failed\n");
} else {
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_AP_ON, NULL);
+ tethering_emit_wifi_ap_on(obj);
ret_val = TRUE;
}
-
- dbus_g_method_return(context, MOBILE_AP_ENABLE_WIFI_AP_CFM, ret);
-
+ tethering_complete_enable_wifi_ap(obj, context, ret);
return ret_val;
}
-gboolean tethering_disable_wifi_ap(TetheringObject *obj,
- DBusGMethodInvocation *context)
+gboolean tethering_disable_wifi_ap(Tethering *obj,
+ GDBusMethodInvocation *context)
{
int ret = MOBILE_AP_ERROR_NONE;
g_assert(context != NULL);
ret = _disable_wifi_ap(obj);
-
- _emit_mobileap_dbus_signal(obj, E_SIGNAL_WIFI_AP_OFF, NULL);
- dbus_g_method_return(context, MOBILE_AP_DISABLE_WIFI_AP_CFM, ret);
+ tethering_emit_wifi_ap_off(obj, NULL);
+ tethering_complete_disable_wifi_ap(obj, g_context,
+ MOBILE_AP_ENABLE_WIFI_AP_CFM, ret);
if (ret != MOBILE_AP_ERROR_NONE)
return FALSE;
return TRUE;
}
-gboolean tethering_reload_wifi_settings(TetheringObject *obj, gchar *ssid,
- gchar *key, gint visibility, gint security_type,
- DBusGMethodInvocation *context)
+gboolean tethering_reload_wifi_settings(Tethering *obj,
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gint visibility, gint security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = TRUE;
ret_val = FALSE;
}
- dbus_g_method_return(context, ret);
+ tethering_complete_reload_wifi_settings(obj, context, ret);
return ret_val;
}
-gboolean tethering_reload_wifi_ap_settings(TetheringObject *obj, gchar *ssid,
- gchar *key, gint visibility, gint security, DBusGMethodInvocation *context)
+gboolean tethering_reload_wifi_ap_settings(Tethering *obj,
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gint visibility, gint security)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
ret_val = FALSE;
}
- dbus_g_method_return(context, ret);
+ tethering_complete_reload_wifi_ap_settings(obj, context, ret);
return ret_val;
}