[Tizen 3.0 Product] Enable debug logs 63/112563/2 accepted/tizen/common/20170210.170525 accepted/tizen/ivi/20170214.011038 accepted/tizen/mobile/20170214.010829 accepted/tizen/tv/20170214.010921 accepted/tizen/unified/20170309.032018 accepted/tizen/wearable/20170214.011006 submit/tizen/20170210.072732 submit/tizen/20170210.083740 submit/tizen_unified/20170308.100405
authorMilind Ramesh Murhekar <m.murhekar@samsung.com>
Wed, 1 Feb 2017 11:40:38 +0000 (17:10 +0530)
committerMilind Ramesh Murhekar <m.murhekar@samsung.com>
Tue, 7 Feb 2017 11:12:13 +0000 (16:42 +0530)
Description:
This Patch enables the debugging logs for Hotel TV support
for SoftAP feature, Currently there is no logs shown
on Hotel TV for M/W.

Change-Id: I653eca855231b292567f593f371182d549409410
Signed-off-by: Milind Ramesh Murhekar <m.murhekar@samsung.com>
include/tethering_private.h
packaging/capi-network-tethering.spec
src/tethering.c

index 9613f8d..3999a72 100644 (file)
@@ -36,6 +36,7 @@ extern "C" {
 #define DEPRECATED_API __attribute__ ((deprecated))
 #endif
 
+#define INFO(fmt, args...)     LOGI(fmt, ##args)
 #define DBG(fmt, args...)      LOGD(fmt, ##args)
 #define WARN(fmt, args...)     LOGW(fmt, ##args)
 #define ERR(fmt, args...)      LOGE(fmt, ##args)
index 657184a..35c22db 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.0.44
+Version:       1.0.45
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 428807e..9d55e54 100755 (executable)
@@ -755,7 +755,7 @@ static void __handle_passphrase_changed(GDBusConnection *connection, const gchar
 static void __wifi_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                gpointer user_data)
 {
-       DBG("+\n");
+       INFO("+\n");
 
        _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
        GError *g_error = NULL;
@@ -787,18 +787,20 @@ static void __wifi_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
        }
        retry = 0;
 
+       INFO("cfm event : wifi tethering enable info : %d\n", error);
+
        sigs[E_SIGNAL_WIFI_TETHER_ON].sig_id = g_dbus_connection_signal_subscribe(th->client_bus,
                        NULL, TETHERING_SERVICE_INTERFACE, sigs[E_SIGNAL_WIFI_TETHER_ON].name,
                        TETHERING_SERVICE_OBJECT_PATH, NULL, G_DBUS_SIGNAL_FLAGS_NONE,
                        sigs[E_SIGNAL_WIFI_TETHER_ON].cb, (gpointer)th, NULL);
 
        if (!ecb) {
-               DBG("-\n");
+               INFO("-\n");
                return;
        }
        ecb(error, TETHERING_TYPE_WIFI, true, data);
        g_variant_unref(g_var);
-       DBG("-\n");
+       INFO("-\n");
 }
 
 static void __bt_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
@@ -908,7 +910,7 @@ static void __usb_enabled_cfm_cb(GObject *source_object, GAsyncResult *res,
 static void __disabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                gpointer user_data)
 {
-       DBG("+\n");
+       INFO("+\n");
 
        _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
        GError *g_error = NULL;
@@ -931,10 +933,10 @@ static void __disabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                //LCOV_EXCL_STOP
        }
        g_variant_get(g_var, "(uu)", &event_type, &info);
-       DBG("cfm event : %d info : %d\n", event_type, info);
+       INFO("cfm event : %d info : %d\n", event_type, info);
        g_variant_unref(g_var);
        error = __get_error(info);
-       DBG("cfm event : %d info : %d\n", event_type, error);
+       INFO("cfm event : %d info : %d\n", event_type, error);
        switch (event_type) {
        case MOBILE_AP_DISABLE_WIFI_TETHERING_CFM:
                sigs[E_SIGNAL_WIFI_TETHER_OFF].sig_id = g_dbus_connection_signal_subscribe(th->client_bus,
@@ -1006,7 +1008,7 @@ static void __disabled_cfm_cb(GObject *source_object, GAsyncResult *res,
                ERR("Invalid event\n");
                break;
        }
-       DBG("-\n");
+       INFO("-\n");
 }
 
 static void __get_data_usage_cb(GObject *source_object, GAsyncResult *res,
@@ -1227,7 +1229,7 @@ static bool __get_wifi_mode_type(tethering_wifi_mode_type_e type, char **buf)
 
 static int __prepare_wifi_settings(tethering_h tethering, _softap_settings_t *set)
 {
-       DBG("+\n");
+       INFO("+\n");
 
        __tethering_h *th = (__tethering_h *)tethering;
        tethering_error_e ret = TETHERING_ERROR_NONE;
@@ -1296,7 +1298,11 @@ static int __prepare_wifi_settings(tethering_h tethering, _softap_settings_t *se
 
                g_strlcpy(set->key, passphrase, sizeof(set->key));
        }
-       DBG("-\n");
+
+       INFO("ssid: %s security: %d mode: %s channel: %d visibility: %s\n",
+                set->ssid, set->sec_type, set->mode, set->channel,
+                (set->visibility)?"true":"false");
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -1309,7 +1315,7 @@ static bool __check_precondition(tethering_type_e type)
        /* data network through cellular */
        vconf_get_int(VCONFKEY_NETWORK_CELLULAR_STATE, &cellular_state);
        if (cellular_state == VCONFKEY_NETWORK_CELLULAR_ON) {
-               ERR("Data Network can be connected later");
+               INFO("Data Network can be connected later");
                return TRUE;
        }
 
@@ -1317,13 +1323,13 @@ static bool __check_precondition(tethering_type_e type)
        /* data network through ethernet */
        vconf_get_int(VCONFKEY_NETWORK_STATUS, &dnet_state);
        if (dnet_state == VCONFKEY_NETWORK_ETHERNET) {
-               ERR("Data Network is connected");
+               INFO("Data Network is connected");
                return TRUE;
        }
 #else
        vconf_get_int(VCONFKEY_DNET_STATE, &dnet_state);
        if (dnet_state > VCONFKEY_DNET_OFF) {
-               ERR("Data Network is connected");
+               INFO("Data Network is connected");
                return TRUE;
        }
 #endif/*TIZEN_TV_EXT*/
@@ -1332,7 +1338,7 @@ static bool __check_precondition(tethering_type_e type)
        if (type != TETHERING_TYPE_WIFI) {
                vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
                if (wifi_state > VCONFKEY_WIFI_UNCONNECTED) {
-                       ERR("Wi-Fi is connected!");
+                       INFO("Wi-Fi is connected!");
                        return TRUE;
                }
        }
@@ -1361,7 +1367,7 @@ API int tethering_create(tethering_h *tethering)
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "parameter(tethering) is NULL\n");
-       DBG("+\n");
+       INFO("+\n");
 
        __tethering_h *th = NULL;
        GError *error = NULL;
@@ -1428,8 +1434,8 @@ API int tethering_create(tethering_h *tethering)
        __connect_signals((tethering_h)th);
 
        *tethering = (tethering_h)th;
-       DBG("Tethering Handle : 0x%X\n", th);
-       DBG("-\n");
+       INFO("Tethering Handle : 0x%X\n", th);
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -1447,7 +1453,7 @@ API int tethering_create(tethering_h *tethering)
  */
 API int tethering_destroy(tethering_h tethering)
 {
-       DBG("+\n");
+       INFO("+\n");
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "parameter(tethering) is NULL\n");
@@ -1455,7 +1461,7 @@ API int tethering_destroy(tethering_h tethering)
        GVariant *result = NULL;
        __tethering_h *th = (__tethering_h *)tethering;
 
-       DBG("Tethering Handle : 0x%X\n", th);
+       INFO("Tethering Handle : 0x%X\n", th);
 
        if (th->change_mac) {
                result = g_dbus_proxy_call_sync(th->client_bus_proxy, "reset_mac", NULL,
@@ -1474,7 +1480,7 @@ API int tethering_destroy(tethering_h tethering)
        memset(th, 0x00, sizeof(__tethering_h));
        free(th);
 
-       DBG("-\n");
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -1495,7 +1501,7 @@ API int tethering_destroy(tethering_h tethering)
  */
 API int tethering_enable(tethering_h tethering, tethering_type_e type)
 {
-       DBG("+ type :  %d\n", type);
+       INFO("+ type :  %d\n", type);
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        if (type == TETHERING_TYPE_USB) CHECK_FEATURE_SUPPORTED(TETHERING_USB_FEATURE);
        else if (type == TETHERING_TYPE_WIFI) CHECK_FEATURE_SUPPORTED(TETHERING_WIFI_FEATURE);
@@ -1513,7 +1519,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
 
        if (__check_precondition(type) == FALSE) {
                //LCOV_EXCL_START
-               DBG("-\n");
+               INFO("-\n");
                return TETHERING_ERROR_OPERATION_FAILED;
                //LCOV_EXCL_STOP
        }
@@ -1606,7 +1612,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
        }
 
        g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
-       DBG("-\n");
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -1627,7 +1633,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
  */
 API int tethering_disable(tethering_h tethering, tethering_type_e type)
 {
-       DBG("+ type :  %d\n", type);
+       INFO("+ type :  %d\n", type);
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        if (type == TETHERING_TYPE_USB) CHECK_FEATURE_SUPPORTED(TETHERING_USB_FEATURE);
        else if (type == TETHERING_TYPE_WIFI) CHECK_FEATURE_SUPPORTED(TETHERING_WIFI_FEATURE);
@@ -1699,7 +1705,7 @@ API int tethering_disable(tethering_h tethering, tethering_type_e type)
                DBG("-\n");
                return TETHERING_ERROR_INVALID_PARAMETER;
        }
-       DBG("-\n");
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -1715,6 +1721,7 @@ API int tethering_disable(tethering_h tethering, tethering_type_e type)
  */
 API bool tethering_is_enabled(tethering_h tethering, tethering_type_e type)
 {
+       INFO("+ type :  %d\n", type);
        int is_on = 0;
        int vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
 
@@ -1740,6 +1747,7 @@ API bool tethering_is_enabled(tethering_h tethering, tethering_type_e type)
                ERR("Not supported type : %d\n", type);
                break;
        }
+       INFO("- enabled:  %s\n",(is_on & vconf_type)? "true" : "false");
        return is_on & vconf_type ? true : false;
 }
 
@@ -2189,6 +2197,7 @@ API int tethering_foreach_connected_clients(tethering_h tethering, tethering_typ
  */
 API int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data)
 {
+       INFO("+ type: %d\n", type);
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        if (type == TETHERING_TYPE_USB) CHECK_FEATURE_SUPPORTED(TETHERING_USB_FEATURE);
        else if (type == TETHERING_TYPE_WIFI) CHECK_FEATURE_SUPPORTED(TETHERING_WIFI_FEATURE);
@@ -2215,6 +2224,7 @@ API int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, t
                th->enabled_user_data[ti] = user_data;
        }
 
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -2275,6 +2285,7 @@ API int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type)
  */
 API int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data)
 {
+       INFO("+ type: %d\n", type);
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        if (type == TETHERING_TYPE_USB) CHECK_FEATURE_SUPPORTED(TETHERING_USB_FEATURE);
        else if (type == TETHERING_TYPE_WIFI) CHECK_FEATURE_SUPPORTED(TETHERING_WIFI_FEATURE);
@@ -2300,7 +2311,7 @@ API int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type,
                th->disabled_cb[ti] = callback;
                th->disabled_user_data[ti] = user_data;
        }
-
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }
 
@@ -2361,6 +2372,7 @@ API int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type
  */
 API int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data)
 {
+       INFO("+ type: %d\n", type);
        CHECK_FEATURE_SUPPORTED(TETHERING_FEATURE);
        if (type == TETHERING_TYPE_USB) CHECK_FEATURE_SUPPORTED(TETHERING_USB_FEATURE);
        else if (type == TETHERING_TYPE_WIFI) CHECK_FEATURE_SUPPORTED(TETHERING_WIFI_FEATURE);
@@ -2386,7 +2398,7 @@ API int tethering_set_connection_state_changed_cb(tethering_h tethering, tetheri
                th->changed_cb[ti] = callback;
                th->changed_user_data[ti] = user_data;
        }
-
+       INFO("-\n");
        return TETHERING_ERROR_NONE;
 }