Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 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_WIMAX_SERVICE_H_ |
| 6 | #define SHILL_WIMAX_SERVICE_H_ |
| 7 | |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame] | 8 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
| 9 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 10 | #include "shill/refptr_types.h" |
| 11 | #include "shill/service.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 15 | class WiMaxNetworkProxyInterface; |
| 16 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 17 | class WiMaxService : public Service { |
| 18 | public: |
| 19 | WiMaxService(ControlInterface *control, |
| 20 | EventDispatcher *dispatcher, |
| 21 | Metrics *metrics, |
| 22 | Manager *manager, |
| 23 | const WiMaxRefPtr &wimax); |
| 24 | virtual ~WiMaxService(); |
| 25 | |
Ben Chan | 4e5c131 | 2012-05-18 18:45:38 -0700 | [diff] [blame] | 26 | // Returns the parameters to be passed to WiMaxManager.Device.Connect() when |
| 27 | // connecting to the network associated with this service. |
| 28 | void GetConnectParameters(DBusPropertiesMap *parameters) const; |
| 29 | |
| 30 | // Returns the DBus object path for the WiMaxManager.Network object |
| 31 | // associated with this service. Must only be called after |proxy_| is set |
| 32 | // by Start(). |
| 33 | DBus::Path GetNetworkObjectPath() const; |
| 34 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 35 | // Returns true on success, false otherwise. Takes ownership of proxy, |
| 36 | // regardless of the result of the operation. |
| 37 | bool Start(WiMaxNetworkProxyInterface *proxy); |
| 38 | |
| 39 | const std::string &network_name() const { return network_name_; } |
| 40 | uint32 network_identifier() const { return network_identifier_; } |
| 41 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 42 | // Inherited from Service. |
| 43 | virtual bool TechnologyIs(const Technology::Identifier type) const; |
| 44 | virtual void Connect(Error *error); |
| 45 | virtual void Disconnect(Error *error); |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 46 | virtual std::string GetStorageIdentifier() const; |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 47 | |
| 48 | private: |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame] | 49 | FRIEND_TEST(WiMaxServiceTest, GetDeviceRpcId); |
| 50 | |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 51 | virtual std::string GetDeviceRpcId(Error *error); |
| 52 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 53 | WiMaxRefPtr wimax_; |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 54 | scoped_ptr<WiMaxNetworkProxyInterface> proxy_; |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame] | 55 | std::string storage_id_; |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 56 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 57 | uint32 network_identifier_; |
| 58 | std::string network_name_; |
Ben Chan | 4e5c131 | 2012-05-18 18:45:38 -0700 | [diff] [blame] | 59 | bool need_passphrase_; |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 60 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 61 | DISALLOW_COPY_AND_ASSIGN(WiMaxService); |
| 62 | }; |
| 63 | |
| 64 | } // namespace shill |
| 65 | |
| 66 | #endif // SHILL_WIMAX_SERVICE_H_ |