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/service_dbus_adaptor.h" |
| 6 | |
| 7 | #include <map> |
| 8 | #include <string> |
| 9 | |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 10 | #include "shill/service.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 ServiceDBusAdaptor::kInterfaceName[] = SHILL_INTERFACE; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 19 | // static |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 20 | const char ServiceDBusAdaptor::kPath[] = "/service/"; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 21 | |
Chris Masone | ec6b18b | 2011-06-08 14:09:10 -0700 | [diff] [blame^] | 22 | ServiceDBusAdaptor::ServiceDBusAdaptor(DBus::Connection* conn, Service *service) |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 23 | : DBusAdaptor(conn, kPath + service->UniqueName()), |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 24 | service_(service) {} |
Chris Masone | ec6b18b | 2011-06-08 14:09:10 -0700 | [diff] [blame^] | 25 | |
| 26 | ServiceDBusAdaptor::~ServiceDBusAdaptor() { |
| 27 | service_ = NULL; |
| 28 | } |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 29 | |
| 30 | void ServiceDBusAdaptor::UpdateConnected() {} |
| 31 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 32 | void ServiceDBusAdaptor::EmitBoolChanged(const std::string& name, bool value) { |
| 33 | PropertyChanged(name, DBusAdaptor::BoolToVariant(value)); |
| 34 | } |
| 35 | |
| 36 | void ServiceDBusAdaptor::EmitUintChanged(const std::string& name, |
| 37 | uint32 value) { |
| 38 | PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value)); |
| 39 | } |
| 40 | |
| 41 | void ServiceDBusAdaptor::EmitIntChanged(const std::string& name, int value) { |
| 42 | PropertyChanged(name, DBusAdaptor::IntToVariant(value)); |
| 43 | } |
| 44 | |
| 45 | void ServiceDBusAdaptor::EmitStringChanged(const std::string& name, |
| 46 | const std::string& value) { |
| 47 | PropertyChanged(name, DBusAdaptor::StringToVariant(value)); |
| 48 | |
| 49 | } |
| 50 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 51 | map<string, ::DBus::Variant> ServiceDBusAdaptor::GetProperties( |
| 52 | ::DBus::Error &error) { |
| 53 | return map<string, ::DBus::Variant>(); |
| 54 | } |
| 55 | |
| 56 | void ServiceDBusAdaptor::SetProperty(const string& , |
| 57 | const ::DBus::Variant& , |
| 58 | ::DBus::Error &error) { |
| 59 | } |
| 60 | |
| 61 | void ServiceDBusAdaptor::ClearProperty(const string& , ::DBus::Error &error) { |
| 62 | } |
| 63 | |
| 64 | void ServiceDBusAdaptor::Connect(::DBus::Error &error) { |
| 65 | } |
| 66 | |
| 67 | void ServiceDBusAdaptor::Disconnect(::DBus::Error &error) { |
| 68 | } |
| 69 | |
| 70 | void ServiceDBusAdaptor::Remove(::DBus::Error &error) { |
| 71 | } |
| 72 | |
| 73 | void ServiceDBusAdaptor::MoveBefore(const ::DBus::Path& , |
| 74 | ::DBus::Error &error) { |
| 75 | } |
| 76 | |
| 77 | void ServiceDBusAdaptor::MoveAfter(const ::DBus::Path& , |
| 78 | ::DBus::Error &error) { |
| 79 | } |
| 80 | |
| 81 | void ServiceDBusAdaptor::ActivateCellularModem(const string& , |
| 82 | ::DBus::Error &error) { |
| 83 | } |
| 84 | |
| 85 | } // namespace shill |