blob: a5a5c58ac2ae415816b8f57f7a9aa9992a60435f [file] [log] [blame]
mukesh agrawalb54601c2011-06-07 17:39:22 -07001// Copyright (c) 2011 The Chromium OS 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 SHILL_WIFI_SERVICE_
6#define SHILL_WIFI_SERVICE_
7
8#include <string>
9#include <vector>
10
Chris Masone2b105542011-06-22 10:58:09 -070011#include "shill/refptr_types.h"
mukesh agrawalb54601c2011-06-07 17:39:22 -070012#include "shill/service.h"
Chris Masone2b105542011-06-22 10:58:09 -070013#include "shill/shill_event.h"
mukesh agrawalb54601c2011-06-07 17:39:22 -070014#include "shill/supplicant-interface.h"
15
16namespace shill {
17
18class WiFiService : public Service {
19 public:
20 WiFiService(ControlInterface *control_interface,
21 EventDispatcher *dispatcher,
Chris Masone2b105542011-06-22 10:58:09 -070022 const WiFiRefPtr &device,
mukesh agrawalb54601c2011-06-07 17:39:22 -070023 const std::vector<uint8_t> ssid,
24 uint32_t mode,
25 const std::string &key_management,
26 const std::string &name);
27 ~WiFiService();
28 void Connect();
29 void Disconnect();
mukesh agrawal445e72c2011-06-22 11:13:50 -070030 uint32_t mode() const;
31 const std::string &key_management() const;
32 const std::vector<uint8_t> &ssid() const;
mukesh agrawalb54601c2011-06-07 17:39:22 -070033
Chris Masone3bd3c8c2011-06-13 08:20:26 -070034 protected:
35 virtual std::string CalculateState() { return "idle"; }
36
mukesh agrawalb54601c2011-06-07 17:39:22 -070037 private:
mukesh agrawalb54601c2011-06-07 17:39:22 -070038 void RealConnect();
39
Chris Masone3bd3c8c2011-06-13 08:20:26 -070040 // Properties
41 std::string passphrase_;
42 bool need_passphrase_;
43 std::string security_;
44 uint8 strength_;
45 const std::string type_;
46 // TODO(cmasone): see if the below can be pulled from the endpoint associated
47 // with this service instead.
48 std::string auth_mode_;
49 bool hidden_ssid_;
50 uint16 frequency_;
51 uint16 physical_mode_;
52 uint16 hex_ssid_;
53
mukesh agrawalb54601c2011-06-07 17:39:22 -070054 ScopedRunnableMethodFactory<WiFiService> task_factory_;
Chris Masone2b105542011-06-22 10:58:09 -070055 WiFiRefPtr wifi_;
mukesh agrawalb54601c2011-06-07 17:39:22 -070056 const std::vector<uint8_t> ssid_;
mukesh agrawal445e72c2011-06-22 11:13:50 -070057 const uint32_t mode_;
mukesh agrawalb54601c2011-06-07 17:39:22 -070058 DISALLOW_COPY_AND_ASSIGN(WiFiService);
59};
60
61} // namespace shill
62
63#endif // SHILL_WIFI_SERVICE_