blob: 9beec492d4ebef9da78db8dd625826702e609290 [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) {
54 return map<string, ::DBus::Variant>();
55}
56
Chris Masone8fe2c7e2011-06-09 15:51:19 -070057void DeviceDBusAdaptor::SetProperty(const string& name,
58 const ::DBus::Variant& value,
Chris Masoned7732e42011-05-20 11:08:56 -070059 ::DBus::Error &error) {
Chris Masone8fe2c7e2011-06-09 15:51:19 -070060 DBusAdaptor::DispatchOnType(device_, name, value, error);
Chris Masoned7732e42011-05-20 11:08:56 -070061}
62
Chris Masoneccc88812011-06-08 18:00:10 -070063void DeviceDBusAdaptor::ClearProperty(const std::string& ,
64 ::DBus::Error &error) {
65}
66
Chris Masoned7732e42011-05-20 11:08:56 -070067void DeviceDBusAdaptor::ProposeScan(::DBus::Error &error) {
68}
69
70::DBus::Path DeviceDBusAdaptor::AddIPConfig(const string& ,
71 ::DBus::Error &error) {
72 return ::DBus::Path();
73}
74
Chris Masoneccc88812011-06-08 18:00:10 -070075void DeviceDBusAdaptor::Register(const std::string& , ::DBus::Error &error) {
76}
77
78void DeviceDBusAdaptor::RequirePin(const std::string& ,
79 const bool& ,
80 ::DBus::Error &error) {
81}
82
83void DeviceDBusAdaptor::EnterPin(const std::string& , ::DBus::Error &error) {
84}
85
86void DeviceDBusAdaptor::UnblockPin(const std::string& ,
87 const std::string& ,
88 ::DBus::Error &error) {
89}
90
91void DeviceDBusAdaptor::ChangePin(const std::string& ,
92 const std::string& ,
93 ::DBus::Error &error) {
94}
95
Chris Masoned7732e42011-05-20 11:08:56 -070096} // namespace shill