blob: 681df413448dcf4cdfc7a68033718f94d2afd5c8 [file] [log] [blame]
Darin Petkov41c0e0a2012-01-09 16:38:53 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkov887f2982011-07-14 16:10:17 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chan62028b22012-11-05 11:20:02 -08005#ifndef SHILL_MODEM_INFO_H_
6#define SHILL_MODEM_INFO_H_
Darin Petkov887f2982011-07-14 16:10:17 -07007
8#include <string>
9
Ben Chan62028b22012-11-05 11:20:02 -080010#include <base/memory/scoped_ptr.h>
Darin Petkov887f2982011-07-14 16:10:17 -070011#include <base/memory/scoped_vector.h>
12#include <gtest/gtest_prod.h> // for FRIEND_TEST
13
Darin Petkov137884a2011-10-26 18:52:47 +020014struct mobile_provider_db;
15
Darin Petkov887f2982011-07-14 16:10:17 -070016namespace shill {
17
Prathmesh Prabhu97f317c2013-03-15 16:20:34 -070018class ActivatingIccidStore;
Ben Chan62028b22012-11-05 11:20:02 -080019class CellularOperatorInfo;
Darin Petkov887f2982011-07-14 16:10:17 -070020class ControlInterface;
21class EventDispatcher;
22class GLib;
23class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080024class Metrics;
Darin Petkov887f2982011-07-14 16:10:17 -070025class ModemManager;
26
27// Manages modem managers.
28class ModemInfo {
29 public:
30 ModemInfo(ControlInterface *control_interface,
31 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080032 Metrics *metrics,
Darin Petkov887f2982011-07-14 16:10:17 -070033 Manager *manager,
34 GLib *glib);
Paul Stewart8c116a92012-05-02 18:30:03 -070035 virtual ~ModemInfo();
Darin Petkov887f2982011-07-14 16:10:17 -070036
Paul Stewart8c116a92012-05-02 18:30:03 -070037 virtual void Start();
38 virtual void Stop();
Darin Petkov887f2982011-07-14 16:10:17 -070039
Paul Stewart8c116a92012-05-02 18:30:03 -070040 virtual void OnDeviceInfoAvailable(const std::string &link_name);
Darin Petkov41c0e0a2012-01-09 16:38:53 +010041
Darin Petkov887f2982011-07-14 16:10:17 -070042 private:
43 friend class ModemInfoTest;
44 FRIEND_TEST(ModemInfoTest, RegisterModemManager);
45 FRIEND_TEST(ModemInfoTest, StartStop);
46
Darin Petkov41c0e0a2012-01-09 16:38:53 +010047 typedef ScopedVector<ModemManager> ModemManagers;
48
David Rochberg7cb06f62012-03-05 11:23:44 -050049 // Register and start new ModemManagers
50 template <class mm> void RegisterModemManager(const std::string &service,
51 const std::string &path);
Darin Petkov41c0e0a2012-01-09 16:38:53 +010052 ModemManagers modem_managers_;
Darin Petkov887f2982011-07-14 16:10:17 -070053
54 ControlInterface *control_interface_;
55 EventDispatcher *dispatcher_;
Thieu Le3426c8f2012-01-11 17:35:11 -080056 Metrics *metrics_;
Darin Petkov887f2982011-07-14 16:10:17 -070057 Manager *manager_;
58 GLib *glib_;
59
Prathmesh Prabhu97f317c2013-03-15 16:20:34 -070060 // Post-payment activation state of the modem.
61 scoped_ptr<ActivatingIccidStore> activating_iccid_store_;
Ben Chan62028b22012-11-05 11:20:02 -080062 scoped_ptr<CellularOperatorInfo> cellular_operator_info_;
Darin Petkov137884a2011-10-26 18:52:47 +020063 std::string provider_db_path_; // For testing.
64 mobile_provider_db *provider_db_; // Database instance owned by |this|.
65
Darin Petkov887f2982011-07-14 16:10:17 -070066 DISALLOW_COPY_AND_ASSIGN(ModemInfo);
67};
68
69} // namespace shill
70
Ben Chan62028b22012-11-05 11:20:02 -080071#endif // SHILL_MODEM_INFO_H_