blob: 5f354e85e7dc6a558a111f28b0df772fc48795ec [file] [log] [blame]
Jason Glasgowee1081c2012-03-06 15:14:53 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chan74924d82013-06-15 17:52:55 -07005#ifndef SHILL_MM1_MODEM_PROXY_INTERFACE_H_
6#define SHILL_MM1_MODEM_PROXY_INTERFACE_H_
Jason Glasgowee1081c2012-03-06 15:14:53 -05007
8#include <string>
9
10#include <base/basictypes.h>
11
Eric Shienbrood9a245532012-03-07 14:20:39 -050012#include "shill/callbacks.h"
Jason Glasgowee1081c2012-03-06 15:14:53 -050013
14namespace shill {
Jason Glasgowee1081c2012-03-06 15:14:53 -050015class Error;
16
17namespace mm1 {
18
Nathan Williamsa31e79c2012-03-30 15:07:00 -040019typedef base::Callback<void(int32,
20 int32, uint32)> ModemStateChangedSignalCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050021
Jason Glasgowee1081c2012-03-06 15:14:53 -050022// These are the methods that a org.freedesktop.ModemManager1.Modem
Eric Shienbrood9a245532012-03-07 14:20:39 -050023// proxy must support. The interface is provided so that it can be
24// mocked in tests. All calls are made asynchronously. Call completion
25// is signalled via the callbacks passed to the methods.
Jason Glasgowee1081c2012-03-06 15:14:53 -050026class ModemProxyInterface {
27 public:
28 virtual ~ModemProxyInterface() {}
29
Eric Shienbrood9a245532012-03-07 14:20:39 -050030 virtual void Enable(bool enable,
31 Error *error,
32 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050033 int timeout) = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 virtual void CreateBearer(const DBusPropertiesMap &properties,
35 Error *error,
36 const DBusPathCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050037 int timeout) = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 virtual void DeleteBearer(const ::DBus::Path &bearer,
39 Error *error,
40 const ResultCallback &callback,
41 int timeout) = 0;
42 virtual void Reset(Error *error,
43 const ResultCallback &callback,
44 int timeout) = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050045 virtual void FactoryReset(const std::string &code,
Eric Shienbrood9a245532012-03-07 14:20:39 -050046 Error *error,
47 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050048 int timeout) = 0;
Ben Chan74924d82013-06-15 17:52:55 -070049 virtual void SetCurrentCapabilities(const uint32_t &capabilities,
50 Error *error,
51 const ResultCallback &callback,
52 int timeout) = 0;
53 virtual void SetCurrentModes(const ::DBus::Struct<uint32_t, uint32_t> &modes,
54 Error *error,
55 const ResultCallback &callback,
56 int timeout) = 0;
57 virtual void SetCurrentBands(const std::vector<uint32_t> &bands,
58 Error *error,
59 const ResultCallback &callback,
60 int timeout) = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050061 virtual void Command(const std::string &cmd,
62 const uint32_t &user_timeout,
Eric Shienbrood9a245532012-03-07 14:20:39 -050063 Error *error,
64 const StringCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050065 int timeout) = 0;
Arman Ugurayee464d32013-02-13 17:14:36 -080066 virtual void SetPowerState(const uint32_t &power_state,
67 Error *error,
68 const ResultCallback &callback,
69 int timeout) = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050070
Eric Shienbrood9a245532012-03-07 14:20:39 -050071
72 virtual void set_state_changed_callback(
73 const ModemStateChangedSignalCallback &callback) = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050074};
75
Jason Glasgowee1081c2012-03-06 15:14:53 -050076} // namespace mm1
77} // namespace shill
78
Ben Chan74924d82013-06-15 17:52:55 -070079#endif // SHILL_MM1_MODEM_PROXY_INTERFACE_H_