blob: 60e5ae43df97448d0b2438aca0d59e53ea54bdc4 [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -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
5#include <time.h>
Paul Stewart75897df2011-04-27 09:05:53 -07006#include <stdio.h>
Chris Masoneee929b72011-05-10 10:02:18 -07007
Chris Masone8fe2c7e2011-06-09 15:51:19 -07008#include <map>
Paul Stewart75897df2011-04-27 09:05:53 -07009#include <string>
Chris Masone8fe2c7e2011-06-09 15:51:19 -070010#include <vector>
Paul Stewart75897df2011-04-27 09:05:53 -070011
Chris Masoneee929b72011-05-10 10:02:18 -070012#include <base/logging.h>
13
Paul Stewart75897df2011-04-27 09:05:53 -070014#include "shill/control_interface.h"
Chris Masonec1e50412011-06-07 13:04:53 -070015#include "shill/device_config_interface.h"
Chris Masone8fe2c7e2011-06-09 15:51:19 -070016#include "shill/error.h"
Paul Stewart75897df2011-04-27 09:05:53 -070017#include "shill/service.h"
Chris Masoned7732e42011-05-20 11:08:56 -070018#include "shill/service_dbus_adaptor.h"
Paul Stewart75897df2011-04-27 09:05:53 -070019
Chris Masone8fe2c7e2011-06-09 15:51:19 -070020using std::map;
Paul Stewart75897df2011-04-27 09:05:53 -070021using std::string;
Chris Masone8fe2c7e2011-06-09 15:51:19 -070022using std::vector;
Paul Stewart75897df2011-04-27 09:05:53 -070023
24namespace shill {
25Service::Service(ControlInterface *control_interface,
mukesh agrawalb54601c2011-06-07 17:39:22 -070026 EventDispatcher *dispatcher,
Chris Masonec1e50412011-06-07 13:04:53 -070027 DeviceConfigInterfaceRefPtr config_interface,
Chris Masonea82b7112011-05-25 15:16:29 -070028 const string& name)
mukesh agrawalb54601c2011-06-07 17:39:22 -070029 : dispatcher_(dispatcher),
30 name_(name),
Chris Masonea82b7112011-05-25 15:16:29 -070031 available_(false),
32 configured_(false),
33 auto_connect_(false),
34 configuration_(NULL),
35 connection_(NULL),
Chris Masonec1e50412011-06-07 13:04:53 -070036 config_interface_(config_interface),
Chris Masonea82b7112011-05-25 15:16:29 -070037 adaptor_(control_interface->CreateServiceAdaptor(this)) {
Chris Masonede21bba2011-05-10 09:15:39 -070038 // Initialize Interface montior, so we can detect new interfaces
Chris Masoneb07006b2011-05-14 16:10:04 -070039 VLOG(2) << "Service initialized.";
Paul Stewart75897df2011-04-27 09:05:53 -070040}
41
Paul Stewartba41b992011-05-26 07:02:46 -070042Service::~Service() {}
Paul Stewart75897df2011-04-27 09:05:53 -070043
Chris Masone8fe2c7e2011-06-09 15:51:19 -070044bool Service::SetBoolProperty(const string& name, bool value, Error *error) {
45 VLOG(2) << "Setting " << name << " as a bool.";
46 // TODO(cmasone): Set actual properties.
47 return true;
48}
49
50bool Service::SetInt32Property(const std::string& name,
51 int32 value,
52 Error *error) {
53 VLOG(2) << "Setting " << name << " as an int32.";
54 // TODO(cmasone): Set actual properties.
55 return true;
56}
57
58bool Service::SetStringProperty(const string& name,
59 const string& value,
60 Error *error) {
61 VLOG(2) << "Setting " << name << " as a string.";
62 // TODO(cmasone): Set actual properties.
63 return true;
64}
65
66bool Service::SetStringmapProperty(const string& name,
67 const std::map<string, string>& values,
68 Error *error) {
69 VLOG(2) << "Setting " << name << " as a map of string:string";
70 // TODO(cmasone): Set actual properties.
71 return true;
72}
73
74bool Service::SetUint8Property(const std::string& name,
75 uint8 value,
76 Error *error) {
77 VLOG(2) << "Setting " << name << " as a uint8.";
78 // TODO(cmasone): Set actual properties.
79 return true;
80}
81
Paul Stewart75897df2011-04-27 09:05:53 -070082} // namespace shill