blob: 07bfe1dc1f6a4e7aca3c34b52208c7912bfc8d74 [file] [log] [blame]
[email protected]ca11059e2014-06-04 08:41:221// 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.
4
5#ifndef COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
6#define COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
7
avi5dd91f82015-12-25 22:30:468#include <stdint.h>
9
[email protected]ca11059e2014-06-04 08:41:2210#include <list>
dcheng3f767dc32016-04-25 22:54:2211#include <memory>
[email protected]ca11059e2014-06-04 08:41:2212#include <set>
pneubeck63f02baf2015-01-13 17:14:2713#include <string>
[email protected]ca11059e2014-06-04 08:41:2214
15#include "base/values.h"
16#include "components/wifi/wifi_export.h"
17
18namespace wifi {
19
avi5dd91f82015-12-25 22:30:4620typedef int32_t Frequency;
[email protected]ca11059e2014-06-04 08:41:2221
22enum FrequencyEnum {
23 kFrequencyAny = 0,
24 kFrequencyUnknown = 0,
25 kFrequency2400 = 2400,
26 kFrequency5000 = 5000
27};
28
29typedef std::set<Frequency> FrequencySet;
30
31// Network Properties, can be used to parse the result of |GetProperties| and
32// |GetVisibleNetworks|.
33struct WIFI_EXPORT NetworkProperties {
34 NetworkProperties();
vmpstr64511012016-04-08 19:59:3435 NetworkProperties(const NetworkProperties& other);
[email protected]ca11059e2014-06-04 08:41:2236 ~NetworkProperties();
37
38 std::string connection_state;
39 std::string guid;
40 std::string name;
41 std::string ssid;
42 std::string bssid;
43 std::string type;
44 std::string security;
45 // |password| field is used to pass wifi password for network creation via
46 // |CreateNetwork| or connection via |StartConnect|. It does not persist
47 // once operation is completed.
48 std::string password;
49 // WiFi Signal Strength. 0..100
avi5dd91f82015-12-25 22:30:4650 uint32_t signal_strength;
[email protected]ca11059e2014-06-04 08:41:2251 bool auto_connect;
52 Frequency frequency;
53 FrequencySet frequency_set;
54
dcheng3f767dc32016-04-25 22:54:2255 std::unique_ptr<base::DictionaryValue> ToValue(bool network_list) const;
[email protected]ca11059e2014-06-04 08:41:2256 // Updates only properties set in |value|.
57 bool UpdateFromValue(const base::DictionaryValue& value);
avi5dd91f82015-12-25 22:30:4658 static std::string MacAddressAsString(const uint8_t mac_as_int[6]);
[email protected]ca11059e2014-06-04 08:41:2259 static bool OrderByType(const NetworkProperties& l,
60 const NetworkProperties& r);
61};
62
63typedef std::list<NetworkProperties> NetworkList;
64
65} // namespace wifi
66
67#endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_