blob: a4e77accf51f37d122cbfb9ce834c4448ed38ca5 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkova1e0a1c2011-08-25 15:08:33 -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_GSM_NETWORK_PROXY_INTERFACE_
6#define SHILL_MODEM_GSM_NETWORK_PROXY_INTERFACE_
7
Darin Petkovc0865312011-09-16 15:31:20 -07008#include <map>
Darin Petkova1e0a1c2011-08-25 15:08:33 -07009#include <string>
Darin Petkovc0865312011-09-16 15:31:20 -070010#include <vector>
Darin Petkova1e0a1c2011-08-25 15:08:33 -070011
12#include <base/basictypes.h>
Darin Petkov9bac6fe2011-08-26 12:49:05 -070013#include <dbus-c++/types.h>
Darin Petkova1e0a1c2011-08-25 15:08:33 -070014
Eric Shienbrood9a245532012-03-07 14:20:39 -050015#include "shill/callbacks.h"
16
Darin Petkova1e0a1c2011-08-25 15:08:33 -070017namespace shill {
18
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050019class Error;
20
21typedef DBus::Struct<unsigned int, std::string, std::string>
22 GSMRegistrationInfo;
23typedef std::map<std::string, std::string> GSMScanResult;
24typedef std::vector<GSMScanResult> GSMScanResults;
25
Eric Shienbrood9a245532012-03-07 14:20:39 -050026typedef base::Callback<void(uint32)> SignalQualitySignalCallback;
27typedef base::Callback<void(
28 uint32_t,
29 const std::string &,
30 const std::string &)> RegistrationInfoSignalCallback;
31typedef base::Callback<void(uint32_t)> NetworkModeSignalCallback;
32
33typedef base::Callback<void(uint32, const Error &)> SignalQualityCallback;
34typedef base::Callback<void(uint32_t,
35 const std::string &,
36 const std::string &,
37 const Error &)> RegistrationInfoCallback;
38typedef base::Callback<void(const GSMScanResults &,
39 const Error &)> ScanResultsCallback;
40
Darin Petkova1e0a1c2011-08-25 15:08:33 -070041// These are the methods that a ModemManager.Modem.Gsm.Network proxy must
42// support. The interface is provided so that it can be mocked in tests.
Eric Shienbrood9a245532012-03-07 14:20:39 -050043// All calls are made asynchronously.
44// XXX fixup comment to reflect new reality
Darin Petkova1e0a1c2011-08-25 15:08:33 -070045class ModemGSMNetworkProxyInterface {
46 public:
47 virtual ~ModemGSMNetworkProxyInterface() {}
48
Eric Shienbrood9a245532012-03-07 14:20:39 -050049 virtual void GetRegistrationInfo(Error *error,
50 const RegistrationInfoCallback &callback,
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050051 int timeout) = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050052 virtual void GetSignalQuality(Error *error,
53 const SignalQualityCallback &callback,
54 int timeout) = 0;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050055 virtual void Register(const std::string &network_id,
Eric Shienbrood9a245532012-03-07 14:20:39 -050056 Error *error, const ResultCallback &callback,
57 int timeout) = 0;
58 virtual void Scan(Error *error, const ScanResultsCallback &callback,
59 int timeout) = 0;
Darin Petkov9bac6fe2011-08-26 12:49:05 -070060
61 // Properties.
62 virtual uint32 AccessTechnology() = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050063 // Signal callbacks
64 virtual void set_signal_quality_callback(
65 const SignalQualitySignalCallback &callback) = 0;
66 virtual void set_network_mode_callback(
67 const NetworkModeSignalCallback &callback) = 0;
68 virtual void set_registration_info_callback(
69 const RegistrationInfoSignalCallback &callback) = 0;
Darin Petkova1e0a1c2011-08-25 15:08:33 -070070};
71
72} // namespace shill
73
74#endif // SHILL_MODEM_GSM_NETWORK_PROXY_INTERFACE_