blob: 8ed8b8685bcf9f2c26b34e29208b02c24b74ed64 [file] [log] [blame]
Chris Masoned7732e42011-05-20 11:08:56 -07001// Copyright (c) 2011 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
Paul Stewart28fbfdf2011-05-31 09:37:38 -07005#include "shill/device.h"
Chris Masoned7732e42011-05-20 11:08:56 -07006#include "shill/device_dbus_adaptor.h"
7
8#include <map>
9#include <string>
10
Chris Masonea82b7112011-05-25 15:16:29 -070011#include "shill/device.h"
Chris Masone8fe2c7e2011-06-09 15:51:19 -070012#include "shill/error.h"
Chris Masonea82b7112011-05-25 15:16:29 -070013
Chris Masoned7732e42011-05-20 11:08:56 -070014using std::map;
15using std::string;
16
17namespace shill {
18
Chris Masoned7732e42011-05-20 11:08:56 -070019// static
Chris Masonea82b7112011-05-25 15:16:29 -070020const char DeviceDBusAdaptor::kInterfaceName[] = SHILL_INTERFACE;
Chris Masoned7732e42011-05-20 11:08:56 -070021// static
Chris Masonea82b7112011-05-25 15:16:29 -070022const char DeviceDBusAdaptor::kPath[] = "/device/";
Chris Masoned7732e42011-05-20 11:08:56 -070023
Chris Masoneec6b18b2011-06-08 14:09:10 -070024DeviceDBusAdaptor::DeviceDBusAdaptor(DBus::Connection* conn, Device *device)
Chris Masonea82b7112011-05-25 15:16:29 -070025 : DBusAdaptor(conn, kPath + device->UniqueName()),
Chris Masoned7732e42011-05-20 11:08:56 -070026 device_(device) {
27}
Chris Masoned0ceb8c2011-06-02 10:05:39 -070028
Chris Masoneec6b18b2011-06-08 14:09:10 -070029DeviceDBusAdaptor::~DeviceDBusAdaptor() {
30 device_ = NULL;
31}
Chris Masoned7732e42011-05-20 11:08:56 -070032
33void DeviceDBusAdaptor::UpdateEnabled() {}
34
Chris Masoned0ceb8c2011-06-02 10:05:39 -070035void DeviceDBusAdaptor::EmitBoolChanged(const std::string& name, bool value) {
36 PropertyChanged(name, DBusAdaptor::BoolToVariant(value));
37}
38
39void DeviceDBusAdaptor::EmitUintChanged(const std::string& name, uint32 value) {
Chris Masone8fe2c7e2011-06-09 15:51:19 -070040 PropertyChanged(name, DBusAdaptor::Uint32ToVariant(value));
Chris Masoned0ceb8c2011-06-02 10:05:39 -070041}
42
43void DeviceDBusAdaptor::EmitIntChanged(const std::string& name, int value) {
Chris Masone8fe2c7e2011-06-09 15:51:19 -070044 PropertyChanged(name, DBusAdaptor::Int32ToVariant(value));
Chris Masoned0ceb8c2011-06-02 10:05:39 -070045}
46
47void DeviceDBusAdaptor::EmitStringChanged(const std::string& name,
48 const std::string& value) {
49 PropertyChanged(name, DBusAdaptor::StringToVariant(value));
50}
51
Chris Masoned7732e42011-05-20 11:08:56 -070052map<string, ::DBus::Variant> DeviceDBusAdaptor::GetProperties(
53 ::DBus::Error &error) {
Chris Masonea8a2c252011-06-27 22:16:30 -070054 map<string, ::DBus::Variant> properties;
55 DBusAdaptor::GetProperties(device_, &properties, &error);
56 return properties;
Chris Masoned7732e42011-05-20 11:08:56 -070057}
58
Chris Masone8fe2c7e2011-06-09 15:51:19 -070059void DeviceDBusAdaptor::SetProperty(const string& name,
60 const ::DBus::Variant& value,
Chris Masoned7732e42011-05-20 11:08:56 -070061 ::DBus::Error &error) {
Chris Masonea8a2c252011-06-27 22:16:30 -070062 DBusAdaptor::DispatchOnType(device_, name, value, &error);
Chris Masoned7732e42011-05-20 11:08:56 -070063}
64
Chris Masoneccc88812011-06-08 18:00:10 -070065void DeviceDBusAdaptor::ClearProperty(const std::string& ,
66 ::DBus::Error &error) {
67}
68
Chris Masoned7732e42011-05-20 11:08:56 -070069void DeviceDBusAdaptor::ProposeScan(::DBus::Error &error) {
70}
71
72::DBus::Path DeviceDBusAdaptor::AddIPConfig(const string& ,
73 ::DBus::Error &error) {
74 return ::DBus::Path();
75}
76
Chris Masoneccc88812011-06-08 18:00:10 -070077void DeviceDBusAdaptor::Register(const std::string& , ::DBus::Error &error) {
78}
79
80void DeviceDBusAdaptor::RequirePin(const std::string& ,
81 const bool& ,
82 ::DBus::Error &error) {
83}
84
85void DeviceDBusAdaptor::EnterPin(const std::string& , ::DBus::Error &error) {
86}
87
88void DeviceDBusAdaptor::UnblockPin(const std::string& ,
89 const std::string& ,
90 ::DBus::Error &error) {
91}
92
93void DeviceDBusAdaptor::ChangePin(const std::string& ,
94 const std::string& ,
95 ::DBus::Error &error) {
96}
97
Chris Masoned7732e42011-05-20 11:08:56 -070098} // namespace shill