OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ | 5 #ifndef COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ |
6 #define COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ | 6 #define COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <list> | 10 #include <list> |
9 #include <set> | 11 #include <set> |
10 #include <string> | 12 #include <string> |
11 | 13 |
12 #include "base/values.h" | 14 #include "base/values.h" |
13 #include "components/wifi/wifi_export.h" | 15 #include "components/wifi/wifi_export.h" |
14 | 16 |
15 namespace wifi { | 17 namespace wifi { |
16 | 18 |
17 typedef int32 Frequency; | 19 typedef int32_t Frequency; |
18 | 20 |
19 enum FrequencyEnum { | 21 enum FrequencyEnum { |
20 kFrequencyAny = 0, | 22 kFrequencyAny = 0, |
21 kFrequencyUnknown = 0, | 23 kFrequencyUnknown = 0, |
22 kFrequency2400 = 2400, | 24 kFrequency2400 = 2400, |
23 kFrequency5000 = 5000 | 25 kFrequency5000 = 5000 |
24 }; | 26 }; |
25 | 27 |
26 typedef std::set<Frequency> FrequencySet; | 28 typedef std::set<Frequency> FrequencySet; |
27 | 29 |
28 // Network Properties, can be used to parse the result of |GetProperties| and | 30 // Network Properties, can be used to parse the result of |GetProperties| and |
29 // |GetVisibleNetworks|. | 31 // |GetVisibleNetworks|. |
30 struct WIFI_EXPORT NetworkProperties { | 32 struct WIFI_EXPORT NetworkProperties { |
31 NetworkProperties(); | 33 NetworkProperties(); |
32 ~NetworkProperties(); | 34 ~NetworkProperties(); |
33 | 35 |
34 std::string connection_state; | 36 std::string connection_state; |
35 std::string guid; | 37 std::string guid; |
36 std::string name; | 38 std::string name; |
37 std::string ssid; | 39 std::string ssid; |
38 std::string bssid; | 40 std::string bssid; |
39 std::string type; | 41 std::string type; |
40 std::string security; | 42 std::string security; |
41 // |password| field is used to pass wifi password for network creation via | 43 // |password| field is used to pass wifi password for network creation via |
42 // |CreateNetwork| or connection via |StartConnect|. It does not persist | 44 // |CreateNetwork| or connection via |StartConnect|. It does not persist |
43 // once operation is completed. | 45 // once operation is completed. |
44 std::string password; | 46 std::string password; |
45 // WiFi Signal Strength. 0..100 | 47 // WiFi Signal Strength. 0..100 |
46 uint32 signal_strength; | 48 uint32_t signal_strength; |
47 bool auto_connect; | 49 bool auto_connect; |
48 Frequency frequency; | 50 Frequency frequency; |
49 FrequencySet frequency_set; | 51 FrequencySet frequency_set; |
50 | 52 |
51 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const; | 53 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const; |
52 // Updates only properties set in |value|. | 54 // Updates only properties set in |value|. |
53 bool UpdateFromValue(const base::DictionaryValue& value); | 55 bool UpdateFromValue(const base::DictionaryValue& value); |
54 static std::string MacAddressAsString(const uint8 mac_as_int[6]); | 56 static std::string MacAddressAsString(const uint8_t mac_as_int[6]); |
55 static bool OrderByType(const NetworkProperties& l, | 57 static bool OrderByType(const NetworkProperties& l, |
56 const NetworkProperties& r); | 58 const NetworkProperties& r); |
57 }; | 59 }; |
58 | 60 |
59 typedef std::list<NetworkProperties> NetworkList; | 61 typedef std::list<NetworkProperties> NetworkList; |
60 | 62 |
61 } // namespace wifi | 63 } // namespace wifi |
62 | 64 |
63 #endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ | 65 #endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_ |
OLD | NEW |