blob: f12a4cf742f4b806a9c9fdede4d7341ff95dc88b [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 Petkovb05315f2011-11-07 10:14:25 +010034 // PIN management. The default implementation fails by populating |error|.
35 virtual void RequirePIN(const std::string &pin, bool require, Error *error);
36 virtual void EnterPIN(const std::string &pin, Error *error);
37 virtual void UnblockPIN(const std::string &unblock_code,
38 const std::string &pin,
39 Error *error);
40 virtual void ChangePIN(const std::string &old_pin,
41 const std::string &new_pin,
42 Error *error);
43
Darin Petkovdaf43862011-10-27 11:37:28 +020044 private:
45 Cellular *cellular_;
46 ProxyFactory *proxy_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(CellularCapability);
49};
50
51} // namespace shill
52
53#endif // SHILL_CELLULAR_CAPABILITY_