Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: device.cc

Issue 6575006: Add initial sketch to shill repository (Closed) Base URL: ssh://git@gitrw.chromium.org/shill.git@master
Patch Set: Add device and service mockups Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device.cc
diff --git a/device.cc b/device.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9b55d2f8dc0e8ef5b24544d3d9a268d207336f9e
--- /dev/null
+++ b/device.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <time.h>
+
+#include <stdio.h>
+#include <string>
+
+#include "shill/shill_logging.h"
+#include "shill/control_interface.h"
+#include "shill/device.h"
+
+using std::string;
+
+namespace shill {
+Device::Device(ControlInterface *control_interface,
+ EventDispatcher */* dispatcher */) {
+ running_ = false;
+ proxy_ = control_interface->CreateDeviceProxy(this);
+ // Initialize Interface montior, so we can detect new interfaces
+ SHILL_LOG(INFO, SHILL_LOG_DEVICE) << "Device initialized.";
+}
+
+Device::~Device() {
+ delete(proxy_);
+}
+
+void Device::Start() {
+ running_ = true;
+ proxy_->UpdateEnabled();
+}
+
+void Device::Stop() {
+ running_ = false;
+ proxy_->UpdateEnabled();
+}
+
+} // namespace shill

Powered by Google App Engine
This is Rietveld 408576698