shill: WiFi: Track manufacturer information
Some information elements provided by APs give information
about the manufacturer and model name of the AP. Report
this so it can be found by RPC callers.
BUG=chromium-os:31472
TEST=Unit tests, manual (list-services)
Change-Id: I9a1867d27095adb6b7fbb3d3a693ee9d9d6b558c
Reviewed-on: https://gerrit.chromium.org/gerrit/26681
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index 68f528a..a602563 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -80,6 +80,8 @@
store->RegisterConstUint16(flimflam::kWifiFrequency, &frequency_);
store->RegisterConstUint16(flimflam::kWifiPhyMode, &physical_mode_);
store->RegisterConstString(flimflam::kWifiBSsid, &bssid_);
+ store->RegisterConstStringmap(kWifiVendorInformationProperty,
+ &vendor_information_);
hex_ssid_ = base::HexEncode(ssid_.data(), ssid_.size());
string ssid_string(
@@ -477,16 +479,15 @@
}
}
- uint16 frequency;
- int16 signal;
+ uint16 frequency = 0;
+ int16 signal = std::numeric_limits<int16>::min();
string bssid;
- if (!representative_endpoint) {
- frequency = 0;
- signal = std::numeric_limits<int16>::min();
- } else {
+ Stringmap vendor_information;
+ if (representative_endpoint) {
frequency = representative_endpoint->frequency();
signal = representative_endpoint->signal_strength();
bssid = representative_endpoint->bssid_string();
+ vendor_information = representative_endpoint->GetVendorInformation();
}
if (frequency_ != frequency) {
@@ -497,6 +498,11 @@
bssid_ = bssid;
adaptor()->EmitStringChanged(flimflam::kWifiBSsid, bssid_);
}
+ if (vendor_information_ != vendor_information) {
+ vendor_information_ = vendor_information;
+ adaptor()->EmitStringmapChanged(kWifiVendorInformationProperty,
+ vendor_information_);
+ }
SetStrength(SignalToStrength(signal));
}