blob: 8f90768e76900f26b27389cf9a63f7dc06a83ed5 [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>
11#include <set>
pneubeck63f02baf2015-01-13 17:14:2712#include <string>
[email protected]ca11059e2014-06-04 08:41:2213
14#include "base/values.h"
15#include "components/wifi/wifi_export.h"
16
17namespace wifi {
18
avi5dd91f82015-12-25 22:30:4619typedef int32_t Frequency;
[email protected]ca11059e2014-06-04 08:41:2220
21enum FrequencyEnum {
22 kFrequencyAny = 0,
23 kFrequencyUnknown = 0,
24 kFrequency2400 = 2400,
25 kFrequency5000 = 5000
26};
27
28typedef std::set<Frequency> FrequencySet;
29
30// Network Properties, can be used to parse the result of |GetProperties| and
31// |GetVisibleNetworks|.
32struct WIFI_EXPORT NetworkProperties {
33 NetworkProperties();
34 ~NetworkProperties();
35
36 std::string connection_state;
37 std::string guid;
38 std::string name;
39 std::string ssid;
40 std::string bssid;
41 std::string type;
42 std::string security;
43 // |password| field is used to pass wifi password for network creation via
44 // |CreateNetwork| or connection via |StartConnect|. It does not persist
45 // once operation is completed.
46 std::string password;
47 // WiFi Signal Strength. 0..100
avi5dd91f82015-12-25 22:30:4648 uint32_t signal_strength;
[email protected]ca11059e2014-06-04 08:41:2249 bool auto_connect;
50 Frequency frequency;
51 FrequencySet frequency_set;
52
[email protected]ca11059e2014-06-04 08:41:2253 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const;
54 // Updates only properties set in |value|.
55 bool UpdateFromValue(const base::DictionaryValue& value);
avi5dd91f82015-12-25 22:30:4656 static std::string MacAddressAsString(const uint8_t mac_as_int[6]);
[email protected]ca11059e2014-06-04 08:41:2257 static bool OrderByType(const NetworkProperties& l,
58 const NetworkProperties& r);
59};
60
61typedef std::list<NetworkProperties> NetworkList;
62
63} // namespace wifi
64
65#endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_