Added getters for primary and secondary device type.
[platform/core/connectivity/wifi-direct-manager.git] / src / wifi-direct-iface.c
index c776824..ed90835 100644 (file)
@@ -310,6 +310,14 @@ const gchar wfd_manager_introspection_xml[] = {
                                "<arg type='b' name='enable' direction='in'/>"
                                "<arg type='i' name='error_code' direction='out'/>"
                        "</method>"
+                       "<method name='GetPrimaryDevType'>"
+                               "<arg type='i' name='pri_dev_type' direction='out'/>"
+                               "<arg type='i' name='error_code' direction='out'/>"
+                       "</method>"
+                       "<method name='GetSecondaryDevType'>"
+                               "<arg type='i' name='sec_dev_type' direction='out'/>"
+                               "<arg type='i' name='error_code' direction='out'/>"
+                       "</method>"
                "</interface>"
 #ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
                "<interface name='net.wifidirect.service'>"
@@ -1604,7 +1612,6 @@ static void __wfd_manager_config_iface_handler(const gchar *method_name,
        } else if (!g_strcmp0(method_name, "SetAutoGroupRemoval")) {
                gboolean enable;
 
-
                g_variant_get(parameters, "(b)", &enable);
                WDS_LOGE("Activate Auto Group Removal Mode : [%s]",
                                enable ? "True" : "False");
@@ -1641,6 +1648,24 @@ static void __wfd_manager_config_iface_handler(const gchar *method_name,
                return_parameters = g_variant_new("(i)", ret);
                goto done;
 
+       } else if (!g_strcmp0(method_name, "GetPrimaryDevType")) {
+
+               int pri_dev_type = 0;
+               ret = WIFI_DIRECT_ERROR_NONE;
+               pri_dev_type = DEFAULT_PRIMARY_DEVICE_TYPE;
+               WDS_LOGD("Get primary dev type value is %d", pri_dev_type);
+               return_parameters = g_variant_new("(ii)", ret, pri_dev_type);
+               goto done;
+
+       } else if (!g_strcmp0(method_name, "GetSecondaryDevType")) {
+
+               int sec_dev_type = 0;
+               ret = WIFI_DIRECT_ERROR_NONE;
+               sec_dev_type = DEFAULT_SECONDARY_DEVICE_TYPE;
+               WDS_LOGD("Get secondary dev type value is %d", sec_dev_type);
+               return_parameters = g_variant_new("(ii)", ret, sec_dev_type);
+               goto done;
+
        }  else {
                WDS_LOGE("method not handled");
                ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;