Index: components/wifi/wifi_test.cc |
diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc |
index 2fa07c3a38eb983e00ec33c426cc7832d9bb4c36..47d1940e890a2f575f2256a11d37145e066d5c2f 100644 |
--- a/components/wifi/wifi_test.cc |
+++ b/components/wifi/wifi_test.cc |
@@ -82,19 +82,20 @@ class WiFiTest { |
WiFiTest::Result WiFiTest::Main(int argc, const char* argv[]) { |
if (!ParseCommandLine(argc, argv)) { |
- VLOG(0) << "Usage: " << argv[0] << |
- " [--list]" |
- " [--get_key]" |
- " [--get_properties]" |
- " [--create]" |
- " [--connect]" |
- " [--disconnect]" |
- " [--scan]" |
- " [--network_guid=<network_guid>]" |
- " [--frequency=0|2400|5000]" |
- " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]" |
- " [--password=<wifi_password>]" |
- " [<network_guid>]\n"; |
+ VLOG(0) << "Usage: " << argv[0] |
+ << " [--list]" |
+ " [--get_connected_ssid]" |
+ " [--get_key]" |
+ " [--get_properties]" |
+ " [--create]" |
+ " [--connect]" |
+ " [--disconnect]" |
+ " [--scan]" |
+ " [--network_guid=<network_guid>]" |
+ " [--frequency=0|2400|5000]" |
+ " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]" |
+ " [--password=<wifi_password>]" |
+ " [<network_guid>]\n"; |
return RESULT_WRONG_USAGE; |
} |
@@ -232,6 +233,17 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { |
return true; |
} |
+ if (parsed_command_line.HasSwitch("get_connected_ssid")) { |
+ std::string ssid; |
+ std::string error; |
+ wifi_service_->GetConnectedNetworkSSID(&ssid, &error); |
+ if (error.length() > 0) |
+ VLOG(0) << error; |
+ else |
+ VLOG(0) << "Network SSID: " << ssid; |
+ return true; |
+ } |
+ |
return false; |
} |