blob: 4ecc9f49fc57f972d7d7e00deb9a6f20fcdb97d6 [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
5#ifndef SHILL_MODEM_INFO_
6#define SHILL_MODEM_INFO_
7
8#include <string>
9
10#include <base/memory/scoped_vector.h>
11#include <gtest/gtest_prod.h> // for FRIEND_TEST
12
Darin Petkov137884a2011-10-26 18:52:47 +020013struct mobile_provider_db;
14
Darin Petkov887f2982011-07-14 16:10:17 -070015namespace shill {
16
17class ControlInterface;
18class EventDispatcher;
19class GLib;
20class Manager;
21class ModemManager;
22
23// Manages modem managers.
24class ModemInfo {
25 public:
26 ModemInfo(ControlInterface *control_interface,
27 EventDispatcher *dispatcher,
28 Manager *manager,
29 GLib *glib);
30 ~ModemInfo();
31
32 void Start();
33 void Stop();
34
Darin Petkov41c0e0a2012-01-09 16:38:53 +010035 void OnDeviceInfoAvailable(const std::string &link_name);
36
Darin Petkov887f2982011-07-14 16:10:17 -070037 private:
38 friend class ModemInfoTest;
39 FRIEND_TEST(ModemInfoTest, RegisterModemManager);
40 FRIEND_TEST(ModemInfoTest, StartStop);
41
Darin Petkov41c0e0a2012-01-09 16:38:53 +010042 typedef ScopedVector<ModemManager> ModemManagers;
43
Darin Petkov887f2982011-07-14 16:10:17 -070044 static const char kCromoService[];
45 static const char kCromoPath[];
Darin Petkov137884a2011-10-26 18:52:47 +020046 static const char kMobileProviderDBPath[];
Darin Petkov887f2982011-07-14 16:10:17 -070047
48 // Registers a new ModemManager service handler and starts it.
49 void RegisterModemManager(const std::string &service,
50 const std::string &path);
51
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_;
56 Manager *manager_;
57 GLib *glib_;
58
Darin Petkov137884a2011-10-26 18:52:47 +020059 std::string provider_db_path_; // For testing.
60 mobile_provider_db *provider_db_; // Database instance owned by |this|.
61
Darin Petkov887f2982011-07-14 16:10:17 -070062 DISALLOW_COPY_AND_ASSIGN(ModemInfo);
63};
64
65} // namespace shill
66
67#endif // SHILL_MODEM_INFO_