blob: 1d89c0fff3ae6a5c6112ac99d6b35a7797888321 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkove9d12e02011-07-27 15:09:37 -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_PROXY_INTERFACE_
6#define SHILL_MODEM_PROXY_INTERFACE_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkovceb68172011-07-29 14:47:48 -070010#include <dbus-c++/types.h>
11
Eric Shienbrood9a245532012-03-07 14:20:39 -050012#include "shill/callbacks.h"
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050013#include "shill/dbus_properties.h"
14
Darin Petkove9d12e02011-07-27 15:09:37 -070015namespace shill {
16
Eric Shienbrood9a245532012-03-07 14:20:39 -050017class CallContext;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050018class Error;
19
20typedef DBus::Struct<std::string, std::string, std::string> ModemHardwareInfo;
21
Eric Shienbrood9a245532012-03-07 14:20:39 -050022typedef base::Callback<void(uint32,
23 uint32, uint32)> ModemStateChangedSignalCallback;
24typedef base::Callback<void(const ModemHardwareInfo &,
25 const Error &)> ModemInfoCallback;
26
Darin Petkove9d12e02011-07-27 15:09:37 -070027// These are the methods that a ModemManager.Modem proxy must support. The
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050028// interface is provided so that it can be mocked in tests. All calls are
Eric Shienbrood9a245532012-03-07 14:20:39 -050029// made asynchronously.
Darin Petkove9d12e02011-07-27 15:09:37 -070030class ModemProxyInterface {
31 public:
32 virtual ~ModemProxyInterface() {}
33
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 virtual void Enable(bool enable, Error *error,
35 const ResultCallback &callback, int timeout) = 0;
36 virtual void Disconnect(Error *error, const ResultCallback &callback,
37 int timeout) = 0;
38 virtual void GetModemInfo(Error *error, const ModemInfoCallback &callback,
39 int timeout) = 0;
Darin Petkove9d12e02011-07-27 15:09:37 -070040
Eric Shienbrood9a245532012-03-07 14:20:39 -050041 virtual void set_state_changed_callback(
42 const ModemStateChangedSignalCallback &callback) = 0;
Darin Petkovc5f56562011-08-06 16:40:05 -070043};
44
Darin Petkove9d12e02011-07-27 15:09:37 -070045} // namespace shill
46
47#endif // SHILL_MODEM_PROXY_INTERFACE_