summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsamueltan <samueltan@chromium.org>2015-04-16 14:21:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-16 21:21:44 +0000
commitf8c7616547bed21a7296d8beb3962068aa301366 (patch)
treeaa3d2687042ebdda6175b85ee64420f9409327ca
parent274eb3202c59d4842c191e924577e81f14044af5 (diff)
downloadchromium_src-f8c7616547bed21a7296d8beb3962068aa301366.zip
chromium_src-f8c7616547bed21a7296d8beb3962068aa301366.tar.gz
chromium_src-f8c7616547bed21a7296d8beb3962068aa301366.tar.bz2
Add an ONC property for setting per-network roam threshold
This CL maps an ONC property for setting per-network roam threshold. BUG=chrome-os-partner:38681 TEST=Expanded test ONC and JSON test sets Review URL: https://codereview.chromium.org/1087353002 Cr-Commit-Position: refs/heads/master@{#325515}
-rw-r--r--chromeos/network/onc/onc_signature.cc1
-rw-r--r--chromeos/network/onc/onc_translation_tables.cc1
-rw-r--r--chromeos/test/data/network/shill_wifi_psk.json3
-rw-r--r--chromeos/test/data/network/shill_wifi_with_state.json3
-rw-r--r--chromeos/test/data/network/translation_of_shill_wifi_with_state.onc1
-rw-r--r--chromeos/test/data/network/valid_wifi_psk.onc1
-rw-r--r--components/onc/docs/onc_spec.html11
-rw-r--r--components/onc/onc_constants.cc1
-rw-r--r--components/onc/onc_constants.h1
9 files changed, 21 insertions, 2 deletions
diff --git a/chromeos/network/onc/onc_signature.cc b/chromeos/network/onc/onc_signature.cc
index 551fa34..b84421d 100644
--- a/chromeos/network/onc/onc_signature.cc
+++ b/chromeos/network/onc/onc_signature.cc
@@ -210,6 +210,7 @@ const OncFieldSignature wifi_fields[] = {
{::onc::wifi::kHexSSID, &kStringSignature},
{::onc::wifi::kHiddenSSID, &kBoolSignature},
{::onc::wifi::kPassphrase, &kStringSignature},
+ {::onc::wifi::kRoamThreshold, &kIntegerSignature},
{::onc::wifi::kSSID, &kStringSignature},
{::onc::wifi::kSecurity, &kStringSignature},
{NULL}};
diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc
index ad7eef8..575fdef 100644
--- a/chromeos/network/onc/onc_translation_tables.cc
+++ b/chromeos/network/onc/onc_translation_tables.cc
@@ -120,6 +120,7 @@ const FieldTranslationEntry wifi_fields[] = {
{::onc::wifi::kHexSSID, shill::kWifiHexSsid},
{::onc::wifi::kHiddenSSID, shill::kWifiHiddenSsid},
{::onc::wifi::kPassphrase, shill::kPassphraseProperty},
+ {::onc::wifi::kRoamThreshold, shill::kWifiRoamThresholdProperty},
// This field is converted during translation, see onc_translator_*.
// { ::onc::wifi::kSecurity, shill::kSecurityClassProperty },
{::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty},
diff --git a/chromeos/test/data/network/shill_wifi_psk.json b/chromeos/test/data/network/shill_wifi_psk.json
index 2e48e7d..ccbe176 100644
--- a/chromeos/test/data/network/shill_wifi_psk.json
+++ b/chromeos/test/data/network/shill_wifi_psk.json
@@ -8,5 +8,6 @@
"WiFi.HexSSID": "4F70656E577274", // "OpenWrt"
"WiFi.HiddenSSID": false,
"WiFi.Frequency": 2412,
- "WiFi.FrequencyList": [2412, 5180]
+ "WiFi.FrequencyList": [2412, 5180],
+ "WiFi.RoamThreshold": 20
}
diff --git a/chromeos/test/data/network/shill_wifi_with_state.json b/chromeos/test/data/network/shill_wifi_with_state.json
index a152675..a4dc646 100644
--- a/chromeos/test/data/network/shill_wifi_with_state.json
+++ b/chromeos/test/data/network/shill_wifi_with_state.json
@@ -13,5 +13,6 @@
"Type": "wifi",
"WiFi.BSSID": "00:12:34:ca:56:8b",
"WiFi.HexSSID": "4F70656E577274", // "OpenWrt"
- "WiFi.HiddenSSID": false
+ "WiFi.HiddenSSID": false,
+ "WiFi.RoamThreshold": 20
}
diff --git a/chromeos/test/data/network/translation_of_shill_wifi_with_state.onc b/chromeos/test/data/network/translation_of_shill_wifi_with_state.onc
index 43355c2..a165238 100644
--- a/chromeos/test/data/network/translation_of_shill_wifi_with_state.onc
+++ b/chromeos/test/data/network/translation_of_shill_wifi_with_state.onc
@@ -10,6 +10,7 @@
"HexSSID": "4F70656E577274", // "OpenWrt"
"HiddenSSID": false,
"Passphrase": "some passphrase",
+ "RoamThreshold": 20,
"SSID": "OpenWrt",
"Security": "WPA-PSK",
"SignalStrength": 10
diff --git a/chromeos/test/data/network/valid_wifi_psk.onc b/chromeos/test/data/network/valid_wifi_psk.onc
index 0de9781..d96ad3d 100644
--- a/chromeos/test/data/network/valid_wifi_psk.onc
+++ b/chromeos/test/data/network/valid_wifi_psk.onc
@@ -30,6 +30,7 @@
"HexSSID": "4F70656E577274", // "OpenWrt"
"HiddenSSID": false,
"Passphrase": "some passphrase",
+ "RoamThreshold": 20,
"Security": "WPA-PSK"
}
}
diff --git a/components/onc/docs/onc_spec.html b/components/onc/docs/onc_spec.html
index 0c2aa63..e791588 100644
--- a/components/onc/docs/onc_spec.html
+++ b/components/onc/docs/onc_spec.html
@@ -724,6 +724,17 @@
40, 104, 128, or 232 bits.
</dd>
+ <dt class="field">RoamThreshold</dt>
+ <dd>
+ <span class="field_meta">
+ (optional)
+ <span class="type">integer</span>
+ </span>
+ The roam threshold for this network, which is the signal-to-noise value
+ (in dB) below which we will attempt to roam to a new network. If this
+ value is not set, the default value will be used.
+ </dd>
+
<dt class="field">Security</dt>
<dd>
<span class="field_meta">
diff --git a/components/onc/onc_constants.cc b/components/onc/onc_constants.cc
index 38fe90c..3007ac5 100644
--- a/components/onc/onc_constants.cc
+++ b/components/onc/onc_constants.cc
@@ -208,6 +208,7 @@ const char kFrequencyList[] = "FrequencyList";
const char kHexSSID[] = "HexSSID";
const char kHiddenSSID[] = "HiddenSSID";
const char kPassphrase[] = "Passphrase";
+const char kRoamThreshold[] = "RoamThreshold";
const char kSSID[] = "SSID";
const char kSecurity[] = "Security";
const char kSecurityNone[] = "None";
diff --git a/components/onc/onc_constants.h b/components/onc/onc_constants.h
index 06c7ad0..2ed2434 100644
--- a/components/onc/onc_constants.h
+++ b/components/onc/onc_constants.h
@@ -226,6 +226,7 @@ ONC_EXPORT extern const char kFrequencyList[];
ONC_EXPORT extern const char kHexSSID[];
ONC_EXPORT extern const char kHiddenSSID[];
ONC_EXPORT extern const char kPassphrase[];
+ONC_EXPORT extern const char kRoamThreshold[];
ONC_EXPORT extern const char kSSID[];
ONC_EXPORT extern const char kSecurity[];
ONC_EXPORT extern const char kSecurityNone[];