OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // For OSX 10.5 we use the system API function WirelessScanSplit. This function | 5 // For OSX 10.5 we use the system API function WirelessScanSplit. This function |
6 // is not documented or included in the SDK, so we use a reverse-engineered | 6 // is not documented or included in the SDK, so we use a reverse-engineered |
7 // header, osx_wifi_.h. This file is taken from the iStumbler project | 7 // header, osx_wifi_.h. This file is taken from the iStumbler project |
8 // (http://www.istumbler.net). | 8 // (http://www.istumbler.net). |
9 | 9 |
10 #include "content/browser/geolocation/wifi_data_provider_mac.h" | 10 #include "content/browser/geolocation/wifi_data_provider_mac.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // signal-to-noise and SSID | 133 // signal-to-noise and SSID |
134 AccessPointData access_point_data; | 134 AccessPointData access_point_data; |
135 access_point_data.mac_address = | 135 access_point_data.mac_address = |
136 MacAddressAsString16(access_point_info->macAddress); | 136 MacAddressAsString16(access_point_info->macAddress); |
137 // WirelessNetworkInfo::signal appears to be signal strength in dBm. | 137 // WirelessNetworkInfo::signal appears to be signal strength in dBm. |
138 access_point_data.radio_signal_strength = access_point_info->signal; | 138 access_point_data.radio_signal_strength = access_point_info->signal; |
139 access_point_data.channel = access_point_info->channel; | 139 access_point_data.channel = access_point_info->channel; |
140 // WirelessNetworkInfo::noise appears to be noise floor in dBm. | 140 // WirelessNetworkInfo::noise appears to be noise floor in dBm. |
141 access_point_data.signal_to_noise = access_point_info->signal - | 141 access_point_data.signal_to_noise = access_point_info->signal - |
142 access_point_info->noise; | 142 access_point_info->noise; |
143 if (!UTF8ToUTF16(reinterpret_cast<const char*>(access_point_info->name), | 143 if (!base::UTF8ToUTF16(reinterpret_cast<const char*>( |
144 access_point_info->nameLen, | 144 access_point_info->name), |
145 &access_point_data.ssid)) { | 145 access_point_info->nameLen, |
| 146 &access_point_data.ssid)) { |
146 access_point_data.ssid.clear(); | 147 access_point_data.ssid.clear(); |
147 } | 148 } |
148 data->insert(access_point_data); | 149 data->insert(access_point_data); |
149 } | 150 } |
150 | 151 |
151 if (managed_access_points) | 152 if (managed_access_points) |
152 CFRelease(managed_access_points); | 153 CFRelease(managed_access_points); |
153 if (adhoc_access_points) | 154 if (adhoc_access_points) |
154 CFRelease(adhoc_access_points); | 155 CFRelease(adhoc_access_points); |
155 | 156 |
(...skipping 29 matching lines...) Expand all Loading... |
185 } | 186 } |
186 | 187 |
187 WifiPollingPolicy* MacWifiDataProvider::NewPollingPolicy() { | 188 WifiPollingPolicy* MacWifiDataProvider::NewPollingPolicy() { |
188 return new GenericWifiPollingPolicy<kDefaultPollingInterval, | 189 return new GenericWifiPollingPolicy<kDefaultPollingInterval, |
189 kNoChangePollingInterval, | 190 kNoChangePollingInterval, |
190 kTwoNoChangePollingInterval, | 191 kTwoNoChangePollingInterval, |
191 kNoWifiPollingIntervalMilliseconds>; | 192 kNoWifiPollingIntervalMilliseconds>; |
192 } | 193 } |
193 | 194 |
194 } // namespace content | 195 } // namespace content |
OLD | NEW |