[connection] Added Tizen Wi-Fi Mesh
[platform/core/api/connection.git] / test / connection_test.c
index 4a63bac..80d4c96 100755 (executable)
@@ -858,6 +858,50 @@ static void test_print_wifi_info(connection_profile_h profile)
                printf("Wi-Fi wps supported : %s\n", wps_supported ? "true" : "false");
 }
 
+static void test_print_mesh_info(connection_profile_h profile)
+{
+       char *essid = NULL;
+       char *bssid = NULL;
+       int rssi = 0;
+       int frequency = 0;
+       connection_wifi_security_type_e security_type;
+       bool pass_required = false;
+
+       if (connection_profile_get_wifi_essid(profile, &essid) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh essid!\n");
+       else {
+               printf("Mesh essid : %s\n", essid);
+               g_free(essid);
+       }
+
+       if (connection_profile_get_wifi_bssid(profile, &bssid) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh bssid!\n");
+       else {
+               printf("Mesh bssid : %s\n", bssid);
+               g_free(bssid);
+       }
+
+       if (connection_profile_get_wifi_rssi(profile, &rssi) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh rssi!\n");
+       else
+               printf("Mesh rssi : %d\n", rssi);
+
+       if (connection_profile_get_wifi_frequency(profile, &frequency) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh frequency!\n");
+       else
+               printf("Mesh frequency : %d\n", frequency);
+
+       if (connection_profile_get_wifi_security_type(profile, &security_type) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh security type!\n");
+       else
+               printf("Mesh security type : %d\n", security_type);
+
+       if (connection_profile_is_wifi_passphrase_required(profile, &pass_required) != CONNECTION_ERROR_NONE)
+               printf("Fail to get Mesh passphrase required!\n");
+       else
+               printf("Mesh passphrase required : %s\n", pass_required ? "true" : "false");
+}
+
 static void test_print_network_info(connection_profile_h profile, connection_address_family_e address_family)
 {
        char *interface_name = NULL;
@@ -1555,12 +1599,20 @@ int test_update_profile(void)
        case CONNECTION_PROFILE_TYPE_ETHERNET:
                if (test_update_network_info(profile) == -1)
                        return -1;
-               break;
 
+               break;
        case CONNECTION_PROFILE_TYPE_BT:
                printf("Not supported!\n");
                /* fall through */
        default:
+               {
+                       int profile_type = prof_type;
+                       if (profile_type == CONNECTION_PROFILE_TYPE_MESH) {
+                               if (test_update_wifi_info(profile) == -1)
+                                       return -1;
+                               break;
+                       }
+               }
                return -1;
        }
 
@@ -1626,6 +1678,14 @@ int test_get_profile_info(void)
                printf("Profile Type : Bluetooth\n");
                break;
        default:
+               {
+                       int profile_type = prof_type;
+                       if (profile_type == CONNECTION_PROFILE_TYPE_MESH) {
+                               printf("Profile Type : Mesh\n");
+                               test_print_mesh_info(profile);
+                               break;
+                       }
+               }
                return -1;
        }
 
@@ -1685,6 +1745,14 @@ int test_refresh_profile_info(void)
                printf("Profile Type : Bluetooth\n");
                break;
        default:
+               {
+                       int profile_type = prof_type;
+                       if (profile_type == CONNECTION_PROFILE_TYPE_MESH) {
+                               printf("Profile Type : Mesh\n");
+                               test_print_mesh_info(profile);
+                               break;
+                       }
+               }
                return -1;
        }