Darin Petkov | daf4386 | 2011-10-27 11:37:28 +0200 | [diff] [blame] | 1 | // 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_CELLULAR_CAPABILITY_ |
| 6 | #define SHILL_CELLULAR_CAPABILITY_ |
| 7 | |
Darin Petkov | b05315f | 2011-11-07 10:14:25 +0100 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | daf4386 | 2011-10-27 11:37:28 +0200 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | namespace shill { |
| 13 | |
| 14 | class Cellular; |
Darin Petkov | b05315f | 2011-11-07 10:14:25 +0100 | [diff] [blame] | 15 | class Error; |
| 16 | class EventDispatcher; |
Darin Petkov | daf4386 | 2011-10-27 11:37:28 +0200 | [diff] [blame] | 17 | class ProxyFactory; |
| 18 | |
| 19 | // Cellular devices instantiate subclasses of CellularCapability that handle the |
| 20 | // specific modem technologies and capabilities. |
| 21 | class CellularCapability { |
| 22 | public: |
| 23 | // |cellular| is the parent Cellular device. |
| 24 | CellularCapability(Cellular *cellular); |
| 25 | virtual ~CellularCapability(); |
| 26 | |
| 27 | Cellular *cellular() const { return cellular_; } |
| 28 | ProxyFactory *proxy_factory() const { return proxy_factory_; } |
Darin Petkov | b05315f | 2011-11-07 10:14:25 +0100 | [diff] [blame] | 29 | EventDispatcher *dispatcher() const; |
Darin Petkov | daf4386 | 2011-10-27 11:37:28 +0200 | [diff] [blame] | 30 | |
| 31 | // Initialize RPC proxies. |
| 32 | virtual void InitProxies() = 0; |
| 33 | |
Darin Petkov | cb54773 | 2011-11-09 13:55:26 +0100 | [diff] [blame] | 34 | // Retrieves identifiers associated with the modem and the capability. |
| 35 | virtual void GetIdentifiers() = 0; |
| 36 | |
Darin Petkov | b05315f | 2011-11-07 10:14:25 +0100 | [diff] [blame] | 37 | // PIN management. The default implementation fails by populating |error|. |
| 38 | virtual void RequirePIN(const std::string &pin, bool require, Error *error); |
| 39 | virtual void EnterPIN(const std::string &pin, Error *error); |
| 40 | virtual void UnblockPIN(const std::string &unblock_code, |
| 41 | const std::string &pin, |
| 42 | Error *error); |
| 43 | virtual void ChangePIN(const std::string &old_pin, |
| 44 | const std::string &new_pin, |
| 45 | Error *error); |
| 46 | |
Darin Petkov | 20c13ec | 2011-11-09 15:07:15 +0100 | [diff] [blame^] | 47 | // Returns an empty string if the network technology is unknown. |
| 48 | virtual std::string GetNetworkTechnologyString() const = 0; |
| 49 | |
| 50 | virtual std::string GetRoamingStateString() const = 0; |
| 51 | |
Darin Petkov | daf4386 | 2011-10-27 11:37:28 +0200 | [diff] [blame] | 52 | private: |
| 53 | Cellular *cellular_; |
| 54 | ProxyFactory *proxy_factory_; |
| 55 | |
| 56 | DISALLOW_COPY_AND_ASSIGN(CellularCapability); |
| 57 | }; |
| 58 | |
| 59 | } // namespace shill |
| 60 | |
| 61 | #endif // SHILL_CELLULAR_CAPABILITY_ |