| OLD | NEW |
| 1 // Copyright 2008, Google Inc. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // found in the LICENSE file. |
| 4 // modification, are permitted provided that the following conditions are met: | 4 |
| 5 // | |
| 6 // 1. Redistributions of source code must retain the above copyright notice, | |
| 7 // this list of conditions and the following disclaimer. | |
| 8 // 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 9 // this list of conditions and the following disclaimer in the documentation | |
| 10 // and/or other materials provided with the distribution. | |
| 11 // 3. Neither the name of Google Inc. nor the names of its contributors may be | |
| 12 // used to endorse or promote products derived from this software without | |
| 13 // specific prior written permission. | |
| 14 // | |
| 15 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
| 16 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
| 17 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
| 18 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 19 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
| 21 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
| 22 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
| 23 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
| 24 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 25 // | |
| 26 // WiFi card drivers for Linux implement the Wireless Extensions interface. | 5 // WiFi card drivers for Linux implement the Wireless Extensions interface. |
| 27 // This interface is part of the Linux kernel. | 6 // This interface is part of the Linux kernel. |
| 28 // | 7 // |
| 29 // Various sets of tools are available to manipulate the Wireless Extensions, | 8 // Various sets of tools are available to manipulate the Wireless Extensions, |
| 30 // of which Wireless Tools is the default implementation. Wireless Tools | 9 // of which Wireless Tools is the default implementation. Wireless Tools |
| 31 // provides a C++ library (libiw) as well as a set of command line tools | 10 // provides a C++ library (libiw) as well as a set of command line tools |
| 32 // (iwconfig, iwlist etc). See | 11 // (iwconfig, iwlist etc). See |
| 33 // http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html for details. | 12 // http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html for details. |
| 34 // | 13 // |
| 35 // Ideally, we would use libiw to obtain WiFi data. However, Wireless Tools is | 14 // Ideally, we would use libiw to obtain WiFi data. However, Wireless Tools is |
| (...skipping 22 matching lines...) Expand all Loading... |
| 58 // Frequency:2.447 GHz (Channel 8) | 37 // Frequency:2.447 GHz (Channel 8) |
| 59 // Quality=4/94 Signal level=-91 dBm Noise level=-95 dBm | 38 // Quality=4/94 Signal level=-91 dBm Noise level=-95 dBm |
| 60 // Encryption key:off | 39 // Encryption key:off |
| 61 // Bit Rates:1 Mb/s; 2 Mb/s; 5 Mb/s; 6 Mb/s; 9 Mb/s | 40 // Bit Rates:1 Mb/s; 2 Mb/s; 5 Mb/s; 6 Mb/s; 9 Mb/s |
| 62 // 11 Mb/s; 12 Mb/s; 18 Mb/s | 41 // 11 Mb/s; 12 Mb/s; 18 Mb/s |
| 63 // Extra:bcn_int=100 | 42 // Extra:bcn_int=100 |
| 64 // | 43 // |
| 65 // TODO(steveblock): Investigate the possibility of the author of Wireless Tools | 44 // TODO(steveblock): Investigate the possibility of the author of Wireless Tools |
| 66 // releasing libiw under a Gears-compatible license. | 45 // releasing libiw under a Gears-compatible license. |
| 67 | 46 |
| 68 // TODO(cprince): remove platform-specific #ifdef guards when OS-specific | 47 // TODO(joth): port to chromium |
| 69 // sources (e.g. WIN32_CPPSRCS) are implemented | 48 #if 0 |
| 70 #if defined(LINUX) && !defined(OS_MACOSX) | |
| 71 | 49 |
| 72 #include "gears/geolocation/wifi_data_provider_linux.h" | 50 #include "gears/geolocation/wifi_data_provider_linux.h" |
| 73 | 51 |
| 74 #include <ctype.h> // For isxdigit() | 52 #include <ctype.h> // For isxdigit() |
| 75 #include <stdio.h> | 53 #include <stdio.h> |
| 76 #include "gears/base/common/string_utils.h" | 54 #include "gears/base/common/string_utils.h" |
| 77 #include "gears/geolocation/wifi_data_provider_common.h" | 55 #include "gears/geolocation/wifi_data_provider_common.h" |
| 78 | 56 |
| 79 // The time periods, in milliseconds, between successive polls of the wifi data. | 57 // The time periods, in milliseconds, between successive polls of the wifi data. |
| 80 extern const int kDefaultPollingInterval = 10000; // 10s | 58 extern const int kDefaultPollingInterval = 10000; // 10s |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 "Signal level=", | 247 "Signal level=", |
| 270 access_points) || | 248 access_points) || |
| 271 IssueCommandAndParseResult("iwconfig 2> /dev/null", | 249 IssueCommandAndParseResult("iwconfig 2> /dev/null", |
| 272 "ESSID:\"", | 250 "ESSID:\"", |
| 273 "Access Point: ", | 251 "Access Point: ", |
| 274 "ESSID:", | 252 "ESSID:", |
| 275 "Signal level=", | 253 "Signal level=", |
| 276 access_points); | 254 access_points); |
| 277 } | 255 } |
| 278 | 256 |
| 279 #endif // LINUX && !OS_MACOSX | 257 #endif // 0 |
| OLD | NEW |