blob: 5d4b71c36aa59a8544470e963cbdd6759290fc29 [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
5#ifndef SHILL_MM1_MODEM_PROXY_INTERFACE_
6#define SHILL_MM1_MODEM_PROXY_INTERFACE_
7
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 ListBearers(Error *error,
35 const DBusPathsCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050036 int timeout) = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050037 virtual void CreateBearer(const DBusPropertiesMap &properties,
38 Error *error,
39 const DBusPathCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050040 int timeout) = 0;
Eric Shienbrood9a245532012-03-07 14:20:39 -050041 virtual void DeleteBearer(const ::DBus::Path &bearer,
42 Error *error,
43 const ResultCallback &callback,
44 int timeout) = 0;
45 virtual void Reset(Error *error,
46 const ResultCallback &callback,
47 int timeout) = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050048 virtual void FactoryReset(const std::string &code,
Eric Shienbrood9a245532012-03-07 14:20:39 -050049 Error *error,
50 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050051 int timeout) = 0;
52 virtual void SetAllowedModes(const uint32_t &modes,
53 const uint32_t &preferred,
Eric Shienbrood9a245532012-03-07 14:20:39 -050054 Error *error,
55 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050056 int timeout) = 0;
57 virtual void SetBands(const std::vector< uint32_t > &bands,
Eric Shienbrood9a245532012-03-07 14:20:39 -050058 Error *error,
59 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050060 int timeout) = 0;
61 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;
66
Eric Shienbrood9a245532012-03-07 14:20:39 -050067
68 virtual void set_state_changed_callback(
69 const ModemStateChangedSignalCallback &callback) = 0;
70
Jason Glasgowee1081c2012-03-06 15:14:53 -050071 // Properties.
72 virtual const ::DBus::Path Sim() = 0;
73 virtual uint32_t ModemCapabilities() = 0;
74 virtual uint32_t CurrentCapabilities() = 0;
75 virtual uint32_t MaxBearers() = 0;
76 virtual uint32_t MaxActiveBearers() = 0;
77 virtual const std::string Manufacturer() = 0;
78 virtual const std::string Model() = 0;
79 virtual const std::string Revision() = 0;
80 virtual const std::string DeviceIdentifier() = 0;
81 virtual const std::string Device() = 0;
Ben Chan34e5d682012-08-24 19:10:49 -070082 virtual const std::vector<std::string> Drivers() = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050083 virtual const std::string Plugin() = 0;
84 virtual const std::string EquipmentIdentifier() = 0;
85 virtual uint32_t UnlockRequired() = 0;
86 virtual const std::map< uint32_t, uint32_t > UnlockRetries() = 0;
87 virtual uint32_t State() = 0;
88 virtual uint32_t AccessTechnologies() = 0;
89 virtual const ::DBus::Struct< uint32_t, bool > SignalQuality() = 0;
Jason Glasgow90d216d2012-04-04 15:57:14 -040090 virtual const std::vector< std::string > OwnNumbers() = 0;
Jason Glasgowee1081c2012-03-06 15:14:53 -050091 virtual uint32_t SupportedModes() = 0;
92 virtual uint32_t AllowedModes() = 0;
93 virtual uint32_t PreferredMode() = 0;
94 virtual const std::vector< uint32_t > SupportedBands() = 0;
95 virtual const std::vector< uint32_t > Bands() = 0;
96};
97
Jason Glasgowee1081c2012-03-06 15:14:53 -050098} // namespace mm1
99} // namespace shill
100
101#endif // SHILL_MM1_MODEM_PROXY_INTERFACE_