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 | |
| 5 | #include "shill/manager_dbus_adaptor.h" |
| 6 | |
| 7 | #include <map> |
| 8 | #include <string> |
| 9 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame] | 10 | #include <base/logging.h> |
| 11 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 12 | using std::map; |
| 13 | using std::string; |
| 14 | |
| 15 | namespace shill { |
| 16 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 17 | // static |
| 18 | const char ManagerDBusAdaptor::kInterfaceName[] = SHILL_INTERFACE; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 19 | // static |
| 20 | const char ManagerDBusAdaptor::kPath[] = SHILL_PATH "/Manager"; |
| 21 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 22 | ManagerDBusAdaptor::ManagerDBusAdaptor(DBus::Connection* conn, Manager *manager) |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 23 | : DBusAdaptor(conn, kPath), |
| 24 | manager_(manager) { |
| 25 | } |
Chris Masone | ec6b18b | 2011-06-08 14:09:10 -0700 | [diff] [blame] | 26 | |
| 27 | ManagerDBusAdaptor::~ManagerDBusAdaptor() { |
| 28 | manager_ = NULL; |
| 29 | } |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 30 | |
| 31 | void ManagerDBusAdaptor::UpdateRunning() {} |
| 32 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 33 | void ManagerDBusAdaptor::EmitBoolChanged(const std::string& name, bool value) { |
| 34 | PropertyChanged(name, DBusAdaptor::BoolToVariant(value)); |
| 35 | } |
| 36 | |
| 37 | void ManagerDBusAdaptor::EmitUintChanged(const std::string& name, |
| 38 | uint32 value) { |
| 39 | PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value)); |
| 40 | } |
| 41 | |
| 42 | void ManagerDBusAdaptor::EmitIntChanged(const std::string& name, int value) { |
| 43 | PropertyChanged(name, DBusAdaptor::IntToVariant(value)); |
| 44 | } |
| 45 | |
| 46 | void ManagerDBusAdaptor::EmitStringChanged(const std::string& name, |
| 47 | const std::string& value) { |
| 48 | PropertyChanged(name, DBusAdaptor::StringToVariant(value)); |
| 49 | } |
| 50 | |
| 51 | void ManagerDBusAdaptor::EmitStateChanged(const std::string& new_state) { |
| 52 | StateChanged(new_state); |
| 53 | } |
| 54 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 55 | map<string, ::DBus::Variant> ManagerDBusAdaptor::GetProperties( |
| 56 | ::DBus::Error &error) { |
| 57 | return map<string, ::DBus::Variant>(); |
| 58 | } |
| 59 | |
| 60 | void ManagerDBusAdaptor::SetProperty(const string& name, |
| 61 | const ::DBus::Variant& value, |
| 62 | ::DBus::Error &error) { |
| 63 | } |
| 64 | |
| 65 | string ManagerDBusAdaptor::GetState(::DBus::Error &error) { |
| 66 | return string(); |
| 67 | } |
| 68 | |
| 69 | ::DBus::Path ManagerDBusAdaptor::CreateProfile(const string& name, |
| 70 | ::DBus::Error &error) { |
| 71 | return ::DBus::Path(); |
| 72 | } |
| 73 | |
Chris Masone | ccc8881 | 2011-06-08 18:00:10 -0700 | [diff] [blame^] | 74 | void ManagerDBusAdaptor::RemoveProfile(const string& name, |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 75 | ::DBus::Error &error) { |
| 76 | } |
| 77 | |
Chris Masone | ccc8881 | 2011-06-08 18:00:10 -0700 | [diff] [blame^] | 78 | ::DBus::Path ManagerDBusAdaptor::PushProfile(const std::string& , |
| 79 | ::DBus::Error &error) { |
| 80 | return ::DBus::Path(); |
| 81 | } |
| 82 | |
| 83 | void ManagerDBusAdaptor::PopProfile(const std::string& , ::DBus::Error &error) { |
| 84 | } |
| 85 | |
| 86 | void ManagerDBusAdaptor::PopAnyProfile(::DBus::Error &error) { |
| 87 | } |
| 88 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 89 | void ManagerDBusAdaptor::RequestScan(const string& , |
| 90 | ::DBus::Error &error) { |
| 91 | } |
| 92 | |
| 93 | void ManagerDBusAdaptor::EnableTechnology(const string& , |
| 94 | ::DBus::Error &error) { |
| 95 | } |
| 96 | |
| 97 | void ManagerDBusAdaptor::DisableTechnology(const string& , |
| 98 | ::DBus::Error &error) { |
| 99 | } |
| 100 | |
| 101 | ::DBus::Path ManagerDBusAdaptor::GetService( |
| 102 | const map<string, ::DBus::Variant>& , |
| 103 | ::DBus::Error &error) { |
| 104 | return ::DBus::Path(); |
| 105 | } |
| 106 | |
| 107 | ::DBus::Path ManagerDBusAdaptor::GetWifiService( |
| 108 | const map<string, ::DBus::Variant>& , |
| 109 | ::DBus::Error &error) { |
| 110 | return ::DBus::Path(); |
| 111 | } |
| 112 | |
| 113 | void ManagerDBusAdaptor::ConfigureWifiService( |
| 114 | const map<string, ::DBus::Variant>& , |
| 115 | ::DBus::Error &error) { |
| 116 | } |
| 117 | |
Chris Masone | ccc8881 | 2011-06-08 18:00:10 -0700 | [diff] [blame^] | 118 | ::DBus::Path ManagerDBusAdaptor::GetVPNService( |
| 119 | const map<string, ::DBus::Variant>& , |
| 120 | ::DBus::Error &error) { |
| 121 | return ::DBus::Path(); |
| 122 | } |
| 123 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 124 | void ManagerDBusAdaptor::RegisterAgent(const ::DBus::Path& , |
| 125 | ::DBus::Error &error) { |
| 126 | } |
| 127 | |
| 128 | void ManagerDBusAdaptor::UnregisterAgent(const ::DBus::Path& , |
| 129 | ::DBus::Error &error) { |
| 130 | } |
| 131 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame] | 132 | int32_t ManagerDBusAdaptor::GetDebugLevel(::DBus::Error &error) { |
| 133 | return logging::GetMinLogLevel(); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 134 | } |
| 135 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame] | 136 | void ManagerDBusAdaptor::SetDebugLevel(const int32_t& level, |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 137 | ::DBus::Error &error) { |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame] | 138 | if (level < logging::LOG_NUM_SEVERITIES) |
| 139 | logging::SetMinLogLevel(level); |
| 140 | else |
| 141 | LOG(WARNING) << "Ignoring attempt to set log level to " << level; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | string ManagerDBusAdaptor::GetServiceOrder(::DBus::Error &error) { |
| 145 | return string(); |
| 146 | } |
| 147 | |
| 148 | void ManagerDBusAdaptor::SetServiceOrder(const string& , |
| 149 | ::DBus::Error &error) { |
| 150 | } |
| 151 | |
| 152 | } // namespace shill |