Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: chromeos/network/network_util.h

Issue 2624843003: Add support for cellular geolocation (Closed)
Patch Set: Update device tests to use correct dict key Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/network/geolocation_handler_unittest.cc ('k') | chromeos/network/network_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROMEOS_NETWORK_NETWORK_UTIL_H_ 5 #ifndef CHROMEOS_NETWORK_NETWORK_UTIL_H_
6 #define CHROMEOS_NETWORK_NETWORK_UTIL_H_ 6 #define CHROMEOS_NETWORK_NETWORK_UTIL_H_
7 7
8 // This header is introduced to make it easy to switch from chromeos_network.cc 8 // This header is introduced to make it easy to switch from chromeos_network.cc
9 // to Chrome's own DBus code. crosbug.com/16557 9 // to Chrome's own DBus code. crosbug.com/16557
10 // All calls to functions in chromeos_network.h should be made through 10 // All calls to functions in chromeos_network.h should be made through
(...skipping 25 matching lines...) Expand all
36 WifiAccessPoint(const WifiAccessPoint& other); 36 WifiAccessPoint(const WifiAccessPoint& other);
37 ~WifiAccessPoint(); 37 ~WifiAccessPoint();
38 std::string ssid; // The ssid of the WiFi node if available. 38 std::string ssid; // The ssid of the WiFi node if available.
39 std::string mac_address; // The mac address of the WiFi node. 39 std::string mac_address; // The mac address of the WiFi node.
40 base::Time timestamp; // Timestamp when this AP was detected. 40 base::Time timestamp; // Timestamp when this AP was detected.
41 int signal_strength; // Radio signal strength measured in dBm. 41 int signal_strength; // Radio signal strength measured in dBm.
42 int signal_to_noise; // Current signal to noise ratio measured in dB. 42 int signal_to_noise; // Current signal to noise ratio measured in dB.
43 int channel; // Wifi channel number. 43 int channel; // Wifi channel number.
44 }; 44 };
45 45
46 // Struct for passing cellular location data
47 // The age, signalStrength, and timingAdvance fields are currently unused:
48 // https://developers.google.com/maps/documentation/geolocation/intro#cell_tower _object
49 struct CHROMEOS_EXPORT CellTower {
50 CellTower();
51 CellTower(const CellTower& other);
52 ~CellTower();
53 std::string mcc; // The mobile country code if available
54 std::string mnc; // The mobile network code if available
55 std::string lac; // The location area code if available
56 std::string ci; // The cell id if availabe
57 base::Time timestamp; // Timestamp when this location was detected.
58 };
59
46 // Struct for passing network scan result data. 60 // Struct for passing network scan result data.
47 struct CHROMEOS_EXPORT CellularScanResult { 61 struct CHROMEOS_EXPORT CellularScanResult {
48 CellularScanResult(); 62 CellularScanResult();
49 CellularScanResult(const CellularScanResult& other); 63 CellularScanResult(const CellularScanResult& other);
50 ~CellularScanResult(); 64 ~CellularScanResult();
51 std::string status; // The network's availability status. (One of "unknown", 65 std::string status; // The network's availability status. (One of "unknown",
52 // "available", "current", or "forbidden") 66 // "available", "current", or "forbidden")
53 std::string network_id; // 3GPP operator code ("MCCMNC"). 67 std::string network_id; // 3GPP operator code ("MCCMNC").
54 std::string short_name; // Short-format name of the operator. 68 std::string short_name; // Short-format name of the operator.
55 std::string long_name; // Long-format name of the operator. 69 std::string long_name; // Long-format name of the operator.
56 std::string technology; // Access technology. 70 std::string technology; // Access technology.
57 }; 71 };
58 72
59 typedef std::vector<WifiAccessPoint> WifiAccessPointVector; 73 typedef std::vector<WifiAccessPoint> WifiAccessPointVector;
74 typedef std::vector<CellTower> CellTowerVector;
60 75
61 // Describes whether there is an error and whether the error came from 76 // Describes whether there is an error and whether the error came from
62 // the local system or from the server implementing the connect 77 // the local system or from the server implementing the connect
63 // method. 78 // method.
64 enum NetworkMethodErrorType { 79 enum NetworkMethodErrorType {
65 NETWORK_METHOD_ERROR_NONE = 0, 80 NETWORK_METHOD_ERROR_NONE = 0,
66 NETWORK_METHOD_ERROR_LOCAL = 1, 81 NETWORK_METHOD_ERROR_LOCAL = 1,
67 NETWORK_METHOD_ERROR_REMOTE = 2, 82 NETWORK_METHOD_ERROR_REMOTE = 2,
68 }; 83 };
69 84
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // there is no match. Only valid for ethernet, wifi, wimax, cellular, and vpn. 130 // there is no match. Only valid for ethernet, wifi, wimax, cellular, and vpn.
116 CHROMEOS_EXPORT std::string TranslateONCTypeToShill(const std::string& type); 131 CHROMEOS_EXPORT std::string TranslateONCTypeToShill(const std::string& type);
117 132
118 // Inverse of TranslateONCTypeToShill. 133 // Inverse of TranslateONCTypeToShill.
119 CHROMEOS_EXPORT std::string TranslateShillTypeToONC(const std::string& type); 134 CHROMEOS_EXPORT std::string TranslateShillTypeToONC(const std::string& type);
120 135
121 } // namespace network_util 136 } // namespace network_util
122 } // namespace chromeos 137 } // namespace chromeos
123 138
124 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ 139 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_
OLDNEW
« no previous file with comments | « chromeos/network/geolocation_handler_unittest.cc ('k') | chromeos/network/network_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698