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 | } |
| 26 | ManagerDBusAdaptor::~ManagerDBusAdaptor() {} |
| 27 | |
| 28 | void ManagerDBusAdaptor::UpdateRunning() {} |
| 29 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 30 | void ManagerDBusAdaptor::EmitBoolChanged(const std::string& name, bool value) { |
| 31 | PropertyChanged(name, DBusAdaptor::BoolToVariant(value)); |
| 32 | } |
| 33 | |
| 34 | void ManagerDBusAdaptor::EmitUintChanged(const std::string& name, |
| 35 | uint32 value) { |
| 36 | PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value)); |
| 37 | } |
| 38 | |
| 39 | void ManagerDBusAdaptor::EmitIntChanged(const std::string& name, int value) { |
| 40 | PropertyChanged(name, DBusAdaptor::IntToVariant(value)); |
| 41 | } |
| 42 | |
| 43 | void ManagerDBusAdaptor::EmitStringChanged(const std::string& name, |
| 44 | const std::string& value) { |
| 45 | PropertyChanged(name, DBusAdaptor::StringToVariant(value)); |
| 46 | } |
| 47 | |
| 48 | void ManagerDBusAdaptor::EmitStateChanged(const std::string& new_state) { |
| 49 | StateChanged(new_state); |
| 50 | } |
| 51 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 52 | map<string, ::DBus::Variant> ManagerDBusAdaptor::GetProperties( |
| 53 | ::DBus::Error &error) { |
| 54 | return map<string, ::DBus::Variant>(); |
| 55 | } |
| 56 | |
| 57 | void ManagerDBusAdaptor::SetProperty(const string& name, |
| 58 | const ::DBus::Variant& value, |
| 59 | ::DBus::Error &error) { |
| 60 | } |
| 61 | |
| 62 | string ManagerDBusAdaptor::GetState(::DBus::Error &error) { |
| 63 | return string(); |
| 64 | } |
| 65 | |
| 66 | ::DBus::Path ManagerDBusAdaptor::CreateProfile(const string& name, |
| 67 | ::DBus::Error &error) { |
| 68 | return ::DBus::Path(); |
| 69 | } |
| 70 | |
| 71 | void ManagerDBusAdaptor::RemoveProfile(const ::DBus::Path& path, |
| 72 | ::DBus::Error &error) { |
| 73 | } |
| 74 | |
| 75 | void ManagerDBusAdaptor::RequestScan(const string& , |
| 76 | ::DBus::Error &error) { |
| 77 | } |
| 78 | |
| 79 | void ManagerDBusAdaptor::EnableTechnology(const string& , |
| 80 | ::DBus::Error &error) { |
| 81 | } |
| 82 | |
| 83 | void ManagerDBusAdaptor::DisableTechnology(const string& , |
| 84 | ::DBus::Error &error) { |
| 85 | } |
| 86 | |
| 87 | ::DBus::Path ManagerDBusAdaptor::GetService( |
| 88 | const map<string, ::DBus::Variant>& , |
| 89 | ::DBus::Error &error) { |
| 90 | return ::DBus::Path(); |
| 91 | } |
| 92 | |
| 93 | ::DBus::Path ManagerDBusAdaptor::GetWifiService( |
| 94 | const map<string, ::DBus::Variant>& , |
| 95 | ::DBus::Error &error) { |
| 96 | return ::DBus::Path(); |
| 97 | } |
| 98 | |
| 99 | void ManagerDBusAdaptor::ConfigureWifiService( |
| 100 | const map<string, ::DBus::Variant>& , |
| 101 | ::DBus::Error &error) { |
| 102 | } |
| 103 | |
| 104 | void ManagerDBusAdaptor::RegisterAgent(const ::DBus::Path& , |
| 105 | ::DBus::Error &error) { |
| 106 | } |
| 107 | |
| 108 | void ManagerDBusAdaptor::UnregisterAgent(const ::DBus::Path& , |
| 109 | ::DBus::Error &error) { |
| 110 | } |
| 111 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame^] | 112 | int32_t ManagerDBusAdaptor::GetDebugLevel(::DBus::Error &error) { |
| 113 | return logging::GetMinLogLevel(); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame^] | 116 | void ManagerDBusAdaptor::SetDebugLevel(const int32_t& level, |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 117 | ::DBus::Error &error) { |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame^] | 118 | if (level < logging::LOG_NUM_SEVERITIES) |
| 119 | logging::SetMinLogLevel(level); |
| 120 | else |
| 121 | LOG(WARNING) << "Ignoring attempt to set log level to " << level; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | string ManagerDBusAdaptor::GetServiceOrder(::DBus::Error &error) { |
| 125 | return string(); |
| 126 | } |
| 127 | |
| 128 | void ManagerDBusAdaptor::SetServiceOrder(const string& , |
| 129 | ::DBus::Error &error) { |
| 130 | } |
| 131 | |
| 132 | } // namespace shill |