blob: 5e39860e58f490bb1e118e82ea8019e2933cb767 [file] [log] [blame]
Darin Petkovdaf43862011-10-27 11:37:28 +02001// 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 Petkovb05315f2011-11-07 10:14:25 +01008#include <string>
9
Darin Petkovdaf43862011-10-27 11:37:28 +020010#include <base/basictypes.h>
11
12namespace shill {
13
14class Cellular;
Darin Petkovb05315f2011-11-07 10:14:25 +010015class Error;
16class EventDispatcher;
Darin Petkovdaf43862011-10-27 11:37:28 +020017class ProxyFactory;
18
19// Cellular devices instantiate subclasses of CellularCapability that handle the
20// specific modem technologies and capabilities.
21class 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 Petkovb05315f2011-11-07 10:14:25 +010029 EventDispatcher *dispatcher() const;
Darin Petkovdaf43862011-10-27 11:37:28 +020030
31 // Initialize RPC proxies.
32 virtual void InitProxies() = 0;
33
Darin Petkovcb547732011-11-09 13:55:26 +010034 // Retrieves identifiers associated with the modem and the capability.
35 virtual void GetIdentifiers() = 0;
36
Darin Petkovb05315f2011-11-07 10:14:25 +010037 // 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 Petkov20c13ec2011-11-09 15:07:15 +010047 // 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 Petkovdaf43862011-10-27 11:37:28 +020052 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_