blob: dec93f13d8e8e79cb7f0b17ce7511670ea887f71 [file] [log] [blame]
Darin Petkov096b3472012-05-15 10:26:22 +02001// 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_WIMAX_DEVICE_PROXY_INTERFACE_
6#define SHILL_WIMAX_DEVICE_PROXY_INTERFACE_
7
8#include <string>
9
10#include <base/basictypes.h>
Darin Petkov8ea0eaf2012-05-29 11:21:33 +020011#include <chromeos/dbus/service_constants.h>
Darin Petkov096b3472012-05-15 10:26:22 +020012
13#include "shill/callbacks.h"
14
15namespace shill {
16
17class Error;
Darin Petkov25665aa2012-05-21 14:08:12 +020018class KeyValueStore;
Darin Petkov096b3472012-05-15 10:26:22 +020019
20// These are the methods that a WiMaxManager.Device proxy must support. The
21// interface is provided so that it can be mocked in tests.
22class WiMaxDeviceProxyInterface {
23 public:
Darin Petkov9893d9c2012-05-17 15:27:31 -070024 typedef base::Callback<void(const RpcIdentifiers &)> NetworksChangedCallback;
Darin Petkov8ea0eaf2012-05-29 11:21:33 +020025 typedef base::Callback<void(
26 wimax_manager::DeviceStatus)> StatusChangedCallback;
Darin Petkov9893d9c2012-05-17 15:27:31 -070027
Darin Petkov096b3472012-05-15 10:26:22 +020028 virtual ~WiMaxDeviceProxyInterface() {}
29
30 virtual void Enable(Error *error,
31 const ResultCallback &callback,
32 int timeout) = 0;
33 virtual void Disable(Error *error,
34 const ResultCallback &callback,
35 int timeout) = 0;
Darin Petkov9893d9c2012-05-17 15:27:31 -070036 virtual void ScanNetworks(Error *error,
37 const ResultCallback &callback,
38 int timeout) = 0;
Darin Petkov25665aa2012-05-21 14:08:12 +020039 virtual void Connect(const RpcIdentifier &network,
40 const KeyValueStore &parameters,
Ben Chan4e5c1312012-05-18 18:45:38 -070041 Error *error,
Darin Petkov096b3472012-05-15 10:26:22 +020042 const ResultCallback &callback,
43 int timeout) = 0;
44 virtual void Disconnect(Error *error,
45 const ResultCallback &callback,
46 int timeout) = 0;
47
Darin Petkov9893d9c2012-05-17 15:27:31 -070048 virtual void set_networks_changed_callback(
49 const NetworksChangedCallback &callback) = 0;
Darin Petkov8ea0eaf2012-05-29 11:21:33 +020050 virtual void set_status_changed_callback(
51 const StatusChangedCallback &callback) = 0;
Darin Petkov9893d9c2012-05-17 15:27:31 -070052
Darin Petkov096b3472012-05-15 10:26:22 +020053 // Properties.
54 virtual uint8 Index(Error *error) = 0;
55 virtual std::string Name(Error *error) = 0;
Darin Petkov59f2d692012-06-07 15:57:46 +020056 virtual RpcIdentifiers Networks(Error *error) = 0;
Darin Petkov096b3472012-05-15 10:26:22 +020057};
58
59} // namespace shill
60
61#endif // SHILL_WIMAX_DEVICE_PROXY_INTERFACE_H_