Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 1 | // 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 Stewart | 28fbfdf | 2011-05-31 09:37:38 -0700 | [diff] [blame] | 5 | #include "shill/device.h" |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 6 | #include "shill/device_dbus_adaptor.h" |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 11 | #include "shill/device.h" |
| 12 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 13 | using std::map; |
| 14 | using std::string; |
| 15 | |
| 16 | namespace shill { |
| 17 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 18 | // static |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 19 | const char DeviceDBusAdaptor::kInterfaceName[] = SHILL_INTERFACE; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 20 | // static |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 21 | const char DeviceDBusAdaptor::kPath[] = "/device/"; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 22 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame^] | 23 | DeviceDBusAdaptor::DeviceDBusAdaptor(DBus::Connection* conn, Device *device) |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 24 | : DBusAdaptor(conn, kPath + device->UniqueName()), |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 25 | device_(device) { |
| 26 | } |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame^] | 27 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 28 | DeviceDBusAdaptor::~DeviceDBusAdaptor() {} |
| 29 | |
| 30 | void DeviceDBusAdaptor::UpdateEnabled() {} |
| 31 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame^] | 32 | void DeviceDBusAdaptor::EmitBoolChanged(const std::string& name, bool value) { |
| 33 | PropertyChanged(name, DBusAdaptor::BoolToVariant(value)); |
| 34 | } |
| 35 | |
| 36 | void DeviceDBusAdaptor::EmitUintChanged(const std::string& name, uint32 value) { |
| 37 | PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value)); |
| 38 | } |
| 39 | |
| 40 | void DeviceDBusAdaptor::EmitIntChanged(const std::string& name, int value) { |
| 41 | PropertyChanged(name, DBusAdaptor::IntToVariant(value)); |
| 42 | } |
| 43 | |
| 44 | void DeviceDBusAdaptor::EmitStringChanged(const std::string& name, |
| 45 | const std::string& value) { |
| 46 | PropertyChanged(name, DBusAdaptor::StringToVariant(value)); |
| 47 | } |
| 48 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 49 | map<string, ::DBus::Variant> DeviceDBusAdaptor::GetProperties( |
| 50 | ::DBus::Error &error) { |
| 51 | return map<string, ::DBus::Variant>(); |
| 52 | } |
| 53 | |
| 54 | void DeviceDBusAdaptor::SetProperty(const string& , |
| 55 | const ::DBus::Variant& , |
| 56 | ::DBus::Error &error) { |
| 57 | } |
| 58 | |
| 59 | void DeviceDBusAdaptor::ProposeScan(::DBus::Error &error) { |
| 60 | } |
| 61 | |
| 62 | ::DBus::Path DeviceDBusAdaptor::AddIPConfig(const string& , |
| 63 | ::DBus::Error &error) { |
| 64 | return ::DBus::Path(); |
| 65 | } |
| 66 | |
| 67 | } // namespace shill |