Dbus service / interface / object names are changed
authorSeungyoun Ju <sy39.ju@samsung.com>
Thu, 24 Jan 2013 07:33:08 +0000 (16:33 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Thu, 24 Jan 2013 07:33:08 +0000 (16:33 +0900)
- Issues
  There is violation of RSA naming convention.

- Fix description
  com.samsung.mobileap is changed to org.tizen.tethering.
  /MobileAP is changed to /Tethering.

Change-Id: Icdddd95ab6cfed1eafabf47fdf05d41a21e1b85a

17 files changed:
CMakeLists.txt
include/mobileap.h
include/mobileap_agent.h
include/mobileap_bluetooth.h
include/mobileap_common.h
include/mobileap_usb.h
include/mobileap_wifi.h
include/tethering-dbus-interface.xml [moved from include/mobileap-dbus-interface.xml with 99% similarity]
packaging/mobileap-agent.spec
packaging/org.tizen.tethering.service [moved from packaging/com.samsung.mobileap.service with 63% similarity]
src/mobileap_bluetooth.c
src/mobileap_common.c
src/mobileap_handler.c
src/mobileap_main.c
src/mobileap_notification.c
src/mobileap_usb.c
src/mobileap_wifi.c

index 00783a1..306d414 100644 (file)
@@ -48,7 +48,7 @@ IF("${ARCH}" STREQUAL "arm")
 ENDIF("${ARCH}" STREQUAL "arm")
 
 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=mobileap ${INCLUDE_DIR}/mobileap-dbus-interface.xml --mode=glib-server --output=${INCLUDE_DIR}/mobileap-server-stub.h")
+EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=tethering ${INCLUDE_DIR}/tethering-dbus-interface.xml --mode=glib-server --output=${INCLUDE_DIR}/tethering-server-stub.h")
 
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
@@ -61,5 +61,5 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/com.samsung.mobileap.service DESTINATION share/dbus-1/services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/org.tizen.tethering.service DESTINATION share/dbus-1/services)
 
index c24d82b..5d144a8 100644 (file)
@@ -39,9 +39,9 @@ extern "C" {
                        G_TYPE_STRING, G_TYPE_INVALID))
 
 
-#define SOFTAP_SERVICE_OBJECT_PATH     "/MobileAP"
-#define SOFTAP_SERVICE_NAME            "com.samsung.mobileap"
-#define SOFTAP_SERVICE_INTERFACE       "com.samsung.mobileap"
+#define TETHERING_SERVICE_OBJECT_PATH  "/Tethering"
+#define TETHERING_SERVICE_NAME         "org.tizen.tethering"
+#define TETHERING_SERVICE_INTERFACE    "org.tizen.tethering"
 
 #define SIGNAL_NAME_NET_CLOSED         "net_closed"
 #define SIGNAL_NAME_STA_CONNECT                "sta_connected"
index bf9dc9b..2344166 100644 (file)
@@ -152,7 +152,7 @@ typedef struct {
        char ssid[MOBILE_AP_WIFI_SSID_MAX_LEN + 1];
        char key[MOBILE_AP_WIFI_KEY_MAX_LEN + 1];
        char security_type[SECURITY_TYPE_LEN];
-} MobileAPObject;
+} TetheringObject;
 
 typedef struct {
        /* The parent class state. */
@@ -160,7 +160,7 @@ typedef struct {
 
        /* class member */
        guint signals[E_SIGNAL_MAX];
-} MobileAPObjectClass;
+} TetheringObjectClass;
 
 typedef struct {
        unsigned int number;    /* Number of connected device */
@@ -194,8 +194,8 @@ void _mh_core_add_data_to_array(GPtrArray *array, guint type, gchar *dev_name);
 int _mh_core_set_ip_address(const char *if_name, const in_addr_t ip);
 
 
-gboolean _init_tethering(MobileAPObject *obj);
-gboolean _deinit_tethering(MobileAPObject *obj);
+gboolean _init_tethering(TetheringObject *obj);
+gboolean _deinit_tethering(TetheringObject *obj);
 gboolean _mobileap_clear_state(int state);
 
 
index 1b4708e..f890d8c 100644 (file)
 
 #include "mobileap_agent.h"
 
-void _bt_get_remote_device_name(MobileAPObject *obj, const char *mac, char **name);
-mobile_ap_error_code_e _disable_bt_tethering(MobileAPObject *obj);
+void _bt_get_remote_device_name(TetheringObject *obj, const char *mac, char **name);
+mobile_ap_error_code_e _disable_bt_tethering(TetheringObject *obj);
 
-gboolean mobileap_enable_bt_tethering(MobileAPObject *obj,
+gboolean tethering_enable_bt_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context);
-gboolean mobileap_disable_bt_tethering(MobileAPObject *obj,
+gboolean tethering_disable_bt_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
 #endif
index 137b79c..be0cbaf 100644 (file)
@@ -30,7 +30,7 @@ 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(MobileAPObject *obj,
+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);
index 69da83f..9acc5e6 100644 (file)
 #include "mobileap_agent.h"
 
 
-mobile_ap_error_code_e _disable_usb_tethering(MobileAPObject *obj);
+mobile_ap_error_code_e _disable_usb_tethering(TetheringObject *obj);
 
-gboolean mobileap_enable_usb_tethering(MobileAPObject *obj,
+gboolean tethering_enable_usb_tethering(TetheringObject *obj,
                                                DBusGMethodInvocation *context);
-gboolean mobileap_disable_usb_tethering(MobileAPObject *obj,
+gboolean tethering_disable_usb_tethering(TetheringObject *obj,
                                                DBusGMethodInvocation *context);
-gboolean mobileap_get_usb_station_info(MobileAPObject *obj,
+gboolean tethering_get_usb_station_info(TetheringObject *obj,
                                                DBusGMethodInvocation *context);
-gboolean mobileap_get_usb_interface_info(MobileAPObject *obj,
+gboolean tethering_get_usb_interface_info(TetheringObject *obj,
                                                DBusGMethodInvocation *context);
 
 #endif
index 23d0ed5..d64a595 100644 (file)
@@ -31,34 +31,34 @@ typedef enum {
 
 void _register_wifi_station_handler(void);
 void _add_wifi_device_to_array(softap_device_info_t *di, GPtrArray *array);
-mobile_ap_error_code_e _disable_wifi_tethering(MobileAPObject *obj);
+mobile_ap_error_code_e _disable_wifi_tethering(TetheringObject *obj);
 
 /* Dbus method */
-gboolean mobileap_enable_wifi_tethering(MobileAPObject *obj, gchar *ssid,
+gboolean tethering_enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
                gchar *key, gint hide_mode,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_disable_wifi_tethering(MobileAPObject *obj,
+gboolean tethering_disable_wifi_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_get_wifi_tethering_hide_mode(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_hide_mode(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_set_wifi_tethering_hide_mode(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_hide_mode(TetheringObject *obj,
                gint hide_mode, DBusGMethodInvocation *context);
 
-gboolean mobileap_get_wifi_tethering_ssid(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_ssid(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_get_wifi_tethering_security_type(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_security_type(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_set_wifi_tethering_security_type(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_security_type(TetheringObject *obj,
                gchar *security_type, DBusGMethodInvocation *context);
 
-gboolean mobileap_get_wifi_tethering_passphrase(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_passphrase(TetheringObject *obj,
                DBusGMethodInvocation *context);
 
-gboolean mobileap_set_wifi_tethering_passphrase(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_passphrase(TetheringObject *obj,
                gchar *passphrase, guint len, DBusGMethodInvocation *context);
 #endif /* __MOBILEAP_WIFI_H__ */
similarity index 99%
rename from include/mobileap-dbus-interface.xml
rename to include/tethering-dbus-interface.xml
index 654b854..0d5231e 100644 (file)
@@ -5,7 +5,7 @@
        "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
 <node>
-       <interface name="com.samsung.mobileap">
+       <interface name="org.tizen.tethering">
 
                <!-- Method definitions -->
 
index 356d8a4..0ef1fe0 100644 (file)
@@ -44,7 +44,7 @@ rm -rf %{buildroot}
 %files
 %manifest mobileap-agent.manifest
 %defattr(-,root,root,-)
-/usr/share/dbus-1/services/com.samsung.mobileap.service
+/usr/share/dbus-1/services/org.tizen.tethering.service
 %{_bindir}/mobileap-agent
 
 %changelog
similarity index 63%
rename from packaging/com.samsung.mobileap.service
rename to packaging/org.tizen.tethering.service
index dcdbc42..8cd9d6f 100644 (file)
@@ -1,3 +1,3 @@
 [D-BUS Service]
-Name=com.samsung.mobileap
+Name=org.tizen.tethering
 Exec=/usr/bin/mobileap-agent
index 1d4dcda..5fac0be 100644 (file)
@@ -182,7 +182,7 @@ static void __bt_nap_connection_changed(bool connected, const char *remote_addre
        return;
 }
 
-static mobile_ap_error_code_e __activate_bt_nap(MobileAPObject *obj)
+static mobile_ap_error_code_e __activate_bt_nap(TetheringObject *obj)
 {
        int bt_ret = BT_ERROR_NONE;
 
@@ -228,7 +228,7 @@ static void __bt_adapter_state_changed(int result, bt_adapter_state_e adapter_st
                return;
 
        int ret;
-       MobileAPObject *obj = (MobileAPObject *)user_data;
+       TetheringObject *obj = (TetheringObject *)user_data;
        DBusGMethodInvocation *context = obj->bt_context;
 
        obj->bt_context = NULL;
@@ -270,7 +270,7 @@ static void __bt_adapter_state_changed(int result, bt_adapter_state_e adapter_st
        return;
 }
 
-void _bt_get_remote_device_name(MobileAPObject *obj, const char *mac, char **name)
+void _bt_get_remote_device_name(TetheringObject *obj, const char *mac, char **name)
 {
        if (obj == NULL || mac == NULL || name == NULL) {
                ERR("Invalid param\n");
@@ -292,7 +292,7 @@ void _bt_get_remote_device_name(MobileAPObject *obj, const char *mac, char **nam
        return;
 }
 
-mobile_ap_error_code_e _disable_bt_tethering(MobileAPObject *obj)
+mobile_ap_error_code_e _disable_bt_tethering(TetheringObject *obj)
 {
        int bt_ret;
 
@@ -321,7 +321,7 @@ mobile_ap_error_code_e _disable_bt_tethering(MobileAPObject *obj)
        return MOBILE_AP_ERROR_NONE;
 }
 
-gboolean mobileap_enable_bt_tethering(MobileAPObject *obj,
+gboolean tethering_enable_bt_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        int ret;
@@ -424,7 +424,7 @@ FAIL:
 }
 
 
-gboolean mobileap_disable_bt_tethering(MobileAPObject *obj,
+gboolean tethering_disable_bt_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret;
index ef54323..41b9f7d 100644 (file)
 #include "mobileap_notification.h"
 #include "mobileap_common.h"
 
-#define MOBILEAP_OBJECT_GET_CLASS(obj) \
+#define TETHERING_OBJECT_GET_CLASS(obj) \
        (G_TYPE_INSTANCE_GET_CLASS ((obj), \
-       MOBILEAP_TYPE_OBJECT , MobileAPObjectClass))
+       TETHERING_TYPE_OBJECT , TetheringObjectClass))
 
-extern DBusConnection *mobileap_conn;
+extern DBusConnection *tethering_conn;
 
 static GSList *station_list = NULL;
 
@@ -65,10 +65,10 @@ gint _slist_find_station_by_ip_addr(gconstpointer a, gconstpointer b)
        return g_ascii_strcasecmp(si->ip, ip_addr);
 }
 
-void _emit_mobileap_dbus_signal(MobileAPObject *obj,
+void _emit_mobileap_dbus_signal(TetheringObject *obj,
                                mobile_ap_sig_e num, const gchar *message)
 {
-       MobileAPObjectClass *klass = MOBILEAP_OBJECT_GET_CLASS(obj);
+       TetheringObjectClass *klass = TETHERING_OBJECT_GET_CLASS(obj);
 
        DBG("Emitting signal id [%d], with message [%s]\n", num, message);
        g_signal_emit(obj, klass->signals[num], 0, message);
@@ -76,7 +76,7 @@ void _emit_mobileap_dbus_signal(MobileAPObject *obj,
 
 void _send_dbus_station_info(const char *member, mobile_ap_station_info_t *info)
 {
-       if (mobileap_conn == NULL)
+       if (tethering_conn == NULL)
                return;
 
        if (member == NULL || info == NULL) {
@@ -89,8 +89,8 @@ void _send_dbus_station_info(const char *member, mobile_ap_station_info_t *info)
        char *mac = info->mac;
        char *hostname = info->hostname;
 
-       msg = dbus_message_new_signal("/MobileAP",
-                       "com.samsung.mobileap",
+       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");
@@ -109,7 +109,7 @@ void _send_dbus_station_info(const char *member, mobile_ap_station_info_t *info)
                return;
        }
 
-       dbus_connection_send(mobileap_conn, msg, NULL);
+       dbus_connection_send(tethering_conn, msg, NULL);
        dbus_message_unref(msg);
 
        return;
index 425b12c..0799cd5 100644 (file)
@@ -54,7 +54,7 @@ static void __handle_flight_mode_changed_cb(keynode_t *key, void *data)
                return;
        }
 
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
        int vconf_key = 0;
 
        if (!_mobileap_is_enabled(MOBILE_AP_STATE_WIFI)) {
@@ -88,7 +88,7 @@ static void __handle_device_name_changed_cb(keynode_t *key, void *data)
                return;
        }
 
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
        char *vconf_key = NULL;
 
        if (!_mobileap_is_enabled(MOBILE_AP_STATE_WIFI)) {
@@ -195,7 +195,7 @@ static gboolean __wifi_timeout_cb(gpointer data)
                return FALSE;
        }
 
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
 
        if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI) == FALSE) {
                ERR("There is no conn. via Wi-Fi tethernig. But nothing to do\n");
@@ -221,7 +221,7 @@ static gboolean __bt_timeout_cb(gpointer data)
                return FALSE;
        }
 
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
 
        if (_mobileap_is_enabled(MOBILE_AP_STATE_BT) == FALSE) {
                ERR("There is no conn. via BT tethering. But nothing to do\n");
index 7219e20..bfb1f8e 100644 (file)
 #include "mobileap_usb.h"
 #include "mobileap_network.h"
 
-GType mobileap_object_get_type(void);
-#define MOBILEAP_TYPE_OBJECT (mobileap_object_get_type())
-G_DEFINE_TYPE(MobileAPObject, mobileap_object, G_TYPE_OBJECT)
+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 *mobileap_conn = NULL;
+DBusConnection *tethering_conn = NULL;
 
-gboolean mobileap_deinit(MobileAPObject *obj, GError **error);
-gboolean mobileap_disable(MobileAPObject *obj, DBusGMethodInvocation *context);
-gboolean mobileap_get_station_info(MobileAPObject *obj,
-                                               DBusGMethodInvocation *context);
-gboolean mobileap_get_data_packet_usage(MobileAPObject *obj,
-                                               DBusGMethodInvocation *context);
-#include "mobileap-server-stub.h"
+gboolean tethering_deinit(TetheringObject *obj, GError **error);
+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 mobileap_object_init(MobileAPObject *obj)
+static void tethering_object_init(TetheringObject *obj)
 {
        DBG("+\n");
        g_assert(obj != NULL);
@@ -63,14 +63,14 @@ static void mobileap_object_init(MobileAPObject *obj)
        obj->transfer_check_count = 0;
 }
 
-static void mobileap_object_finalize(GObject *obj)
+static void tethering_object_finalize(GObject *obj)
 {
        DBG("+\n");
 
-       G_OBJECT_CLASS(mobileap_object_parent_class)->finalize(obj);
+       G_OBJECT_CLASS(tethering_object_parent_class)->finalize(obj);
 }
 
-static void mobileap_object_class_init(MobileAPObjectClass *klass)
+static void tethering_object_class_init(TetheringObjectClass *klass)
 {
        GObjectClass *object_class = (GObjectClass *)klass;
        const gchar *signalNames[E_SIGNAL_MAX] = {
@@ -95,7 +95,7 @@ static void mobileap_object_class_init(MobileAPObjectClass *klass)
 
        g_assert(klass != NULL);
 
-       object_class->finalize = mobileap_object_finalize;
+       object_class->finalize = tethering_object_finalize;
 
        DBG("Creating signals\n");
 
@@ -113,8 +113,8 @@ static void mobileap_object_class_init(MobileAPObjectClass *klass)
 
        DBG("Binding to GLib/D-Bus\n");
 
-       dbus_g_object_type_install_info(MOBILEAP_TYPE_OBJECT,
-                                       &dbus_glib_mobileap_object_info);
+       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)
@@ -223,7 +223,7 @@ static void __unblock_device_sleep(void)
                DBG("PM control [SUCCESS]\n");
 }
 
-gboolean _init_tethering(MobileAPObject *obj)
+gboolean _init_tethering(TetheringObject *obj)
 {
        DBG("obj->init_count: %d\n", obj->init_count);
 
@@ -247,7 +247,7 @@ gboolean _init_tethering(MobileAPObject *obj)
        return TRUE;
 }
 
-gboolean _deinit_tethering(MobileAPObject *obj)
+gboolean _deinit_tethering(TetheringObject *obj)
 {
        DBG("obj->init_count: %d\n", obj->init_count);
 
@@ -272,7 +272,7 @@ gboolean _deinit_tethering(MobileAPObject *obj)
 }
 
 
-gboolean mobileap_deinit(MobileAPObject *obj, GError **error)
+gboolean tethering_deinit(TetheringObject *obj, GError **error)
 {
        DBG("+\n");
        g_assert(obj != NULL);
@@ -285,7 +285,7 @@ gboolean mobileap_deinit(MobileAPObject *obj, GError **error)
        return TRUE;
 }
 
-gboolean mobileap_disable(MobileAPObject *obj, DBusGMethodInvocation *context)
+gboolean tethering_disable(TetheringObject *obj, DBusGMethodInvocation *context)
 {
        int ret = MOBILE_AP_ERROR_NONE;
 
@@ -309,7 +309,7 @@ gboolean mobileap_disable(MobileAPObject *obj, DBusGMethodInvocation *context)
        return TRUE;
 }
 
-gboolean mobileap_get_station_info(MobileAPObject *obj,
+gboolean tethering_get_station_info(TetheringObject *obj,
                                                DBusGMethodInvocation *context)
 {
        DBG("+\n");
@@ -329,7 +329,7 @@ gboolean mobileap_get_station_info(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_get_data_packet_usage(MobileAPObject *obj,
+gboolean tethering_get_data_packet_usage(TetheringObject *obj,
                                                DBusGMethodInvocation *context)
 {
        char *if_name = NULL;
@@ -386,7 +386,7 @@ static DBusHandlerResult __dnsmasq_signal_filter(DBusConnection *conn,
        char *bt_remote_device_name = NULL;
        DBusError error;
        mobile_ap_type_e type = MOBILE_AP_TYPE_MAX;
-       MobileAPObject *obj = (MobileAPObject *)user_data;
+       TetheringObject *obj = (TetheringObject *)user_data;
        mobile_ap_station_info_t *info = NULL;
        int n_station = 0;
 
@@ -479,11 +479,11 @@ static DBusHandlerResult __dnsmasq_signal_filter(DBusConnection *conn,
 
 int main(int argc, char **argv)
 {
-       MobileAPObject *mobileap_obj = NULL;
+       TetheringObject *tethering_obj = NULL;
        DBusError dbus_error;
        char *rule = "type='signal',interface='"DNSMASQ_DBUS_INTERFACE"'";
-       DBusGConnection *mobileap_bus = NULL;
-       DBusGProxy *mobileap_bus_proxy = NULL;
+       DBusGConnection *tethering_bus = NULL;
+       DBusGProxy *tethering_bus_proxy = NULL;
        guint result = 0;
        GError *error = NULL;
        int mobileap_vconf_key = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
@@ -505,28 +505,28 @@ int main(int argc, char **argv)
                goto failure;
        }
 
-       mobileap_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
+       tethering_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
        if (error != NULL) {
                ERR("Couldn't connect to system bus[%s]\n", error->message);
                goto failure;
        }
 
-       mobileap_conn = dbus_g_connection_get_connection(mobileap_bus);
+       tethering_conn = dbus_g_connection_get_connection(tethering_bus);
 
-       DBG("Registering the well-known name (%s)\n", SOFTAP_SERVICE_NAME);
+       DBG("Registering the well-known name (%s)\n", TETHERING_SERVICE_NAME);
 
-       mobileap_bus_proxy = dbus_g_proxy_new_for_name(mobileap_bus,
+       tethering_bus_proxy = dbus_g_proxy_new_for_name(tethering_bus,
                                                       DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
-       if (mobileap_bus_proxy == NULL) {
+       if (tethering_bus_proxy == NULL) {
                ERR("Failed to get a proxy for D-Bus\n");
                goto failure;
        }
 
-       if (!dbus_g_proxy_call(mobileap_bus_proxy,
+       if (!dbus_g_proxy_call(tethering_bus_proxy,
                               "RequestName",
                               &error,
                               G_TYPE_STRING,
-                              SOFTAP_SERVICE_NAME,
+                              TETHERING_SERVICE_NAME,
                               G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) {
                ERR("D-Bus.RequestName RPC failed[%s]\n", error->message);
                goto failure;
@@ -537,27 +537,27 @@ int main(int argc, char **argv)
                goto failure;
        }
 
-       g_object_unref(mobileap_bus_proxy);
-       mobileap_bus_proxy = NULL;
+       g_object_unref(tethering_bus_proxy);
+       tethering_bus_proxy = NULL;
 
-       mobileap_obj = g_object_new(MOBILEAP_TYPE_OBJECT, NULL);
-       if (mobileap_obj == NULL) {
+       tethering_obj = g_object_new(TETHERING_TYPE_OBJECT, NULL);
+       if (tethering_obj == NULL) {
                ERR("Failed to create one MobileAP instance.\n");
                goto failure;
        }
 
        /* Registering it on the D-Bus */
-       dbus_g_connection_register_g_object(mobileap_bus,
-                       SOFTAP_SERVICE_OBJECT_PATH, G_OBJECT(mobileap_obj));
+       dbus_g_connection_register_g_object(tethering_bus,
+                       TETHERING_SERVICE_OBJECT_PATH, G_OBJECT(tethering_obj));
 
        DBG("Ready to serve requests.\n");
 
        _init_network(NULL);
        _register_wifi_station_handler();
-       _register_vconf_cb((void *)mobileap_obj);
+       _register_vconf_cb((void *)tethering_obj);
 
        dbus_error_init(&dbus_error);
-       dbus_bus_add_match(mobileap_conn, rule, &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);
@@ -565,22 +565,22 @@ int main(int argc, char **argv)
        }
 
        DBG("Listening to D-BUS signals from dnsmasq");
-       dbus_connection_add_filter(mobileap_conn, __dnsmasq_signal_filter, mobileap_obj, NULL);
+       dbus_connection_add_filter(tethering_conn, __dnsmasq_signal_filter, tethering_obj, NULL);
 
        g_main_loop_run(mainloop);
 
-       _unregister_vconf_cb((void *)mobileap_obj);
+       _unregister_vconf_cb((void *)tethering_obj);
        _deinit_network();
 
  failure:
        ERR("Terminate the mobileap-agent\n");
 
-       if (mobileap_bus)
-               dbus_g_connection_unref(mobileap_bus);
-       if (mobileap_bus_proxy)
-               g_object_unref(mobileap_bus_proxy);
-       if (mobileap_obj)
-               g_object_unref(mobileap_obj);
+       if (tethering_bus)
+               dbus_g_connection_unref(tethering_bus);
+       if (tethering_bus_proxy)
+               g_object_unref(tethering_bus_proxy);
+       if (tethering_obj)
+               g_object_unref(tethering_obj);
 
        return 0;
 }
index ec53043..4004cee 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "mobileap_agent.h"
 
+#define MH_NOTI_APP_NAME       "org.tizen.tethering"
+
 static int connected_noti_id = 0;
 static int timeout_noti_id = 0;
 
@@ -110,7 +112,7 @@ int _create_timeout_noti(const char *content, const char *title,
                goto FAIL;
        }
 
-       ret = notification_set_application(noti, "org.tizen.tethering");
+       ret = notification_set_application(noti, MH_NOTI_APP_NAME);
        if (ret != NOTIFICATION_ERROR_NONE) {
                ERR("Fail to notification_set_application [%d]\n", ret);
                goto FAIL;
@@ -197,7 +199,7 @@ int _create_connected_noti(const char *content, const char *title,
                goto FAIL;
        }
 
-       ret = notification_set_application(noti, "org.tizen.tethering");
+       ret = notification_set_application(noti, MH_NOTI_APP_NAME);
        if (ret != NOTIFICATION_ERROR_NONE) {
                ERR("Fail to notification_set_application [%d]\n", ret);
                goto FAIL;
index b257077..8de107f 100644 (file)
@@ -39,7 +39,7 @@ static void __handle_usb_disconnect_cb(keynode_t *key, void *data)
 
        char *vconf_name;
        int vconf_key;
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
 
        if (!_mobileap_is_enabled(MOBILE_AP_STATE_USB)) {
                ERR("USB tethering is not enabled\n");
@@ -76,7 +76,7 @@ static void __handle_usb_mode_change(keynode_t *key, void *data)
                return;
        }
 
-       MobileAPObject *obj = (MobileAPObject *)data;
+       TetheringObject *obj = (TetheringObject *)data;
        int ret;
        int vconf_key;
 
@@ -135,7 +135,7 @@ static void __handle_usb_mode_change(keynode_t *key, void *data)
        }
 }
 
-mobile_ap_error_code_e _disable_usb_tethering(MobileAPObject *obj)
+mobile_ap_error_code_e _disable_usb_tethering(TetheringObject *obj)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
 
@@ -163,7 +163,7 @@ mobile_ap_error_code_e _disable_usb_tethering(MobileAPObject *obj)
        return ret;
 }
 
-gboolean mobileap_enable_usb_tethering(MobileAPObject *obj,
+gboolean tethering_enable_usb_tethering(TetheringObject *obj,
                                                DBusGMethodInvocation *context)
 {
        int vconf_ret;
@@ -249,7 +249,7 @@ FAIL:
        return FALSE;
 }
 
-gboolean mobileap_disable_usb_tethering(MobileAPObject *obj,
+gboolean tethering_disable_usb_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -313,7 +313,7 @@ static void __add_usb_station_info_to_array(GPtrArray *array, mobile_ap_station_
        g_ptr_array_add(array, g_value_get_boxed(&value));
 }
 
-gboolean mobileap_get_usb_station_info(MobileAPObject *obj,
+gboolean tethering_get_usb_station_info(TetheringObject *obj,
                                                DBusGMethodInvocation *context)
 {
        g_assert(obj != NULL);
@@ -338,7 +338,7 @@ gboolean mobileap_get_usb_station_info(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_get_usb_interface_info(MobileAPObject *obj,
+gboolean tethering_get_usb_interface_info(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        g_assert(obj != NULL);
index 9749dfb..10069b4 100644 (file)
@@ -39,7 +39,7 @@ static mobile_ap_error_code_e __get_passphrase(char *passphrase, unsigned int si
 static mobile_ap_error_code_e __set_passphrase(const char *passphrase, const unsigned int size);
 static gboolean __send_station_event_cb(gpointer data);
 static void __handle_station_signal(int sig);
-static mobile_ap_error_code_e __update_wifi_data(MobileAPObject *obj);
+static mobile_ap_error_code_e __update_wifi_data(TetheringObject *obj);
 
 static int __generate_initial_passphrase(char *passphrase_buf)
 {
@@ -333,7 +333,7 @@ void _add_wifi_device_to_array(softap_device_info_t *di, GPtrArray *array)
        }
 }
 
-mobile_ap_error_code_e _disable_wifi_tethering(MobileAPObject *obj)
+mobile_ap_error_code_e _disable_wifi_tethering(TetheringObject *obj)
 {
        int ret = MOBILE_AP_ERROR_NONE;
 
@@ -364,7 +364,7 @@ mobile_ap_error_code_e _disable_wifi_tethering(MobileAPObject *obj)
        return ret;
 }
 
-static mobile_ap_error_code_e __update_wifi_data(MobileAPObject *obj)
+static mobile_ap_error_code_e __update_wifi_data(TetheringObject *obj)
 {
        if (obj == NULL) {
                ERR("Invalid param\n");
@@ -403,7 +403,7 @@ static mobile_ap_error_code_e __update_wifi_data(MobileAPObject *obj)
        return MOBILE_AP_ERROR_NONE;
 }
 
-gboolean mobileap_enable_wifi_tethering(MobileAPObject *obj, gchar *ssid,
+gboolean tethering_enable_wifi_tethering(TetheringObject *obj, gchar *ssid,
                gchar *key, gint hide_mode, DBusGMethodInvocation *context)
 {
        int ret = MOBILE_AP_ERROR_NONE;
@@ -461,7 +461,7 @@ FAIL:
        return FALSE;
 }
 
-gboolean mobileap_disable_wifi_tethering(MobileAPObject *obj,
+gboolean tethering_disable_wifi_tethering(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        int ret = MOBILE_AP_ERROR_NONE;
@@ -481,7 +481,7 @@ gboolean mobileap_disable_wifi_tethering(MobileAPObject *obj,
                return TRUE;
 }
 
-gboolean mobileap_get_wifi_tethering_hide_mode(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_hide_mode(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -501,7 +501,7 @@ gboolean mobileap_get_wifi_tethering_hide_mode(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_set_wifi_tethering_hide_mode(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_hide_mode(TetheringObject *obj,
                gint hide_mode, DBusGMethodInvocation *context)
 {
        int ret = 0;
@@ -535,7 +535,7 @@ gboolean mobileap_set_wifi_tethering_hide_mode(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_get_wifi_tethering_ssid(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_ssid(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -556,7 +556,7 @@ gboolean mobileap_get_wifi_tethering_ssid(MobileAPObject *obj,
 
 }
 
-gboolean mobileap_get_wifi_tethering_security_type(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_security_type(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -576,7 +576,7 @@ gboolean mobileap_get_wifi_tethering_security_type(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_set_wifi_tethering_security_type(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_security_type(TetheringObject *obj,
                gchar *security_type, DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -607,7 +607,7 @@ gboolean mobileap_set_wifi_tethering_security_type(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_get_wifi_tethering_passphrase(MobileAPObject *obj,
+gboolean tethering_get_wifi_tethering_passphrase(TetheringObject *obj,
                DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
@@ -629,7 +629,7 @@ gboolean mobileap_get_wifi_tethering_passphrase(MobileAPObject *obj,
        return TRUE;
 }
 
-gboolean mobileap_set_wifi_tethering_passphrase(MobileAPObject *obj,
+gboolean tethering_set_wifi_tethering_passphrase(TetheringObject *obj,
                gchar *passphrase, guint len, DBusGMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;