Allow notification for connected client devices for P2P Tethering. 14/136914/1 accepted/tizen/4.0/unified/20170816.012724 accepted/tizen/4.0/unified/20170816.015854 accepted/tizen/unified/20170707.154546 submit/tizen/20170706.230808 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorMilind Ramesh Murhekar <m.murhekar@samsung.com>
Mon, 3 Jul 2017 11:59:00 +0000 (17:29 +0530)
committerMilind Ramesh Murhekar <m.murhekar@samsung.com>
Mon, 3 Jul 2017 11:59:00 +0000 (17:29 +0530)
Description: This patch allows the existing API's to notify
the connected client info to the Application.

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

index bfa824b..e20b6b3 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.0.53
+Version:       1.0.54
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index a78d27d..a991af3 100755 (executable)
@@ -153,7 +153,8 @@ static bool __any_tethering_is_enabled(tethering_h tethering)
 {
        if (tethering_is_enabled(tethering, TETHERING_TYPE_USB) ||
                        tethering_is_enabled(tethering, TETHERING_TYPE_WIFI) ||
-                       tethering_is_enabled(tethering, TETHERING_TYPE_BT))
+                       tethering_is_enabled(tethering, TETHERING_TYPE_BT) ||
+                       tethering_is_enabled(tethering, TETHERING_TYPE_P2P))
                return true;
 
        return false;
@@ -367,6 +368,8 @@ static void __handle_dhcp(GDBusConnection *connection, const gchar *sender_name,
                type = TETHERING_TYPE_WIFI;
        else if (ap_type == MOBILE_AP_TYPE_BT)
                type = TETHERING_TYPE_BT;
+       else if (ap_type == MOBILE_AP_TYPE_P2P)
+               type = TETHERING_TYPE_P2P;
        else {
                ERR("Not supported tethering type [%d]\n", ap_type);
                goto DONE;
@@ -2333,6 +2336,8 @@ API int tethering_foreach_connected_clients(tethering_h tethering, tethering_typ
                                        client.interface = TETHERING_TYPE_WIFI;
                                else if (interface == MOBILE_AP_TYPE_BT)
                                        client.interface = TETHERING_TYPE_BT;
+                               else if (interface == MOBILE_AP_TYPE_P2P)
+                                       client.interface = TETHERING_TYPE_P2P;
                                else {
                                        ERR("Invalid interface\n");
                                        g_free(key);
@@ -2602,7 +2607,7 @@ API int tethering_set_connection_state_changed_cb(tethering_h tethering, tetheri
        }
 
        /* TETHERING_TYPE_ALL */
-       for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
+       for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_P2P; ti++) {
                th->changed_cb[ti] = callback;
                th->changed_user_data[ti] = user_data;
        }
@@ -2643,7 +2648,7 @@ API int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethe
        }
 
        /* TETHERING_TYPE_ALL */
-       for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
+       for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_P2P; ti++) {
                th->changed_cb[ti] = NULL;
                th->changed_user_data[ti] = NULL;
        }