Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 5 | #ifndef SHILL_MODEM_INFO_H_ |
| 6 | #define SHILL_MODEM_INFO_H_ |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 10 | #include <base/memory/scoped_ptr.h> |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 11 | #include <base/memory/scoped_vector.h> |
| 12 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
| 13 | |
Darin Petkov | 137884a | 2011-10-26 18:52:47 +0200 | [diff] [blame] | 14 | struct mobile_provider_db; |
| 15 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 16 | namespace shill { |
| 17 | |
Prathmesh Prabhu | 97f317c | 2013-03-15 16:20:34 -0700 | [diff] [blame^] | 18 | class ActivatingIccidStore; |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 19 | class CellularOperatorInfo; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 20 | class ControlInterface; |
| 21 | class EventDispatcher; |
| 22 | class GLib; |
| 23 | class Manager; |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 24 | class Metrics; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 25 | class ModemManager; |
| 26 | |
| 27 | // Manages modem managers. |
| 28 | class ModemInfo { |
| 29 | public: |
| 30 | ModemInfo(ControlInterface *control_interface, |
| 31 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 32 | Metrics *metrics, |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 33 | Manager *manager, |
| 34 | GLib *glib); |
Paul Stewart | 8c116a9 | 2012-05-02 18:30:03 -0700 | [diff] [blame] | 35 | virtual ~ModemInfo(); |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 36 | |
Paul Stewart | 8c116a9 | 2012-05-02 18:30:03 -0700 | [diff] [blame] | 37 | virtual void Start(); |
| 38 | virtual void Stop(); |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 39 | |
Paul Stewart | 8c116a9 | 2012-05-02 18:30:03 -0700 | [diff] [blame] | 40 | virtual void OnDeviceInfoAvailable(const std::string &link_name); |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 41 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 42 | private: |
| 43 | friend class ModemInfoTest; |
| 44 | FRIEND_TEST(ModemInfoTest, RegisterModemManager); |
| 45 | FRIEND_TEST(ModemInfoTest, StartStop); |
| 46 | |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 47 | typedef ScopedVector<ModemManager> ModemManagers; |
| 48 | |
David Rochberg | 7cb06f6 | 2012-03-05 11:23:44 -0500 | [diff] [blame] | 49 | // Register and start new ModemManagers |
| 50 | template <class mm> void RegisterModemManager(const std::string &service, |
| 51 | const std::string &path); |
Darin Petkov | 41c0e0a | 2012-01-09 16:38:53 +0100 | [diff] [blame] | 52 | ModemManagers modem_managers_; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 53 | |
| 54 | ControlInterface *control_interface_; |
| 55 | EventDispatcher *dispatcher_; |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 56 | Metrics *metrics_; |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 57 | Manager *manager_; |
| 58 | GLib *glib_; |
| 59 | |
Prathmesh Prabhu | 97f317c | 2013-03-15 16:20:34 -0700 | [diff] [blame^] | 60 | // Post-payment activation state of the modem. |
| 61 | scoped_ptr<ActivatingIccidStore> activating_iccid_store_; |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 62 | scoped_ptr<CellularOperatorInfo> cellular_operator_info_; |
Darin Petkov | 137884a | 2011-10-26 18:52:47 +0200 | [diff] [blame] | 63 | std::string provider_db_path_; // For testing. |
| 64 | mobile_provider_db *provider_db_; // Database instance owned by |this|. |
| 65 | |
Darin Petkov | 887f298 | 2011-07-14 16:10:17 -0700 | [diff] [blame] | 66 | DISALLOW_COPY_AND_ASSIGN(ModemInfo); |
| 67 | }; |
| 68 | |
| 69 | } // namespace shill |
| 70 | |
Ben Chan | 62028b2 | 2012-11-05 11:20:02 -0800 | [diff] [blame] | 71 | #endif // SHILL_MODEM_INFO_H_ |