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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
6 #define COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
11 #include "base/values.h"
12 #include "components/wifi/wifi_export.h"
16 typedef int32 Frequency
;
20 kFrequencyUnknown
= 0,
21 kFrequency2400
= 2400,
25 typedef std::set
<Frequency
> FrequencySet
;
27 // Network Properties, can be used to parse the result of |GetProperties| and
28 // |GetVisibleNetworks|.
29 struct WIFI_EXPORT NetworkProperties
{
33 std::string connection_state
;
40 // |password| field is used to pass wifi password for network creation via
41 // |CreateNetwork| or connection via |StartConnect|. It does not persist
42 // once operation is completed.
44 // WiFi Signal Strength. 0..100
45 uint32 signal_strength
;
48 FrequencySet frequency_set
;
50 std::string json_extra
; // Extra JSON properties for unit tests
52 scoped_ptr
<base::DictionaryValue
> ToValue(bool network_list
) const;
53 // Updates only properties set in |value|.
54 bool UpdateFromValue(const base::DictionaryValue
& value
);
55 static std::string
MacAddressAsString(const uint8 mac_as_int
[6]);
56 static bool OrderByType(const NetworkProperties
& l
,
57 const NetworkProperties
& r
);
60 typedef std::list
<NetworkProperties
> NetworkList
;
64 #endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_