summaryrefslogtreecommitdiffstats
path: root/tools/battor_agent
diff options
context:
space:
mode:
authorcharliea <charliea@chromium.org>2016-01-27 07:58:11 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-27 15:59:30 +0000
commit680ed5f673d656d666b638198712fad17ad55668 (patch)
treeda2e02b47e3e3d1169d5cbdb6767c21b15dbe4c5 /tools/battor_agent
parent2676b7cab0f75be48a4f554e7253187ea396cc7a (diff)
downloadchromium_src-680ed5f673d656d666b638198712fad17ad55668.zip
chromium_src-680ed5f673d656d666b638198712fad17ad55668.tar.gz
chromium_src-680ed5f673d656d666b638198712fad17ad55668.tar.bz2
Revert "tools/battor_agent: Adds a tool to find connected BattOrs"
This reverts commit 5897360aaf5ee2ab3abafdfc96ca6b45b827c8d7. TBR=thakis@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=581693 Review URL: https://codereview.chromium.org/1641573003 Cr-Commit-Position: refs/heads/master@{#371794}
Diffstat (limited to 'tools/battor_agent')
-rw-r--r--tools/battor_agent/BUILD.gn2
-rw-r--r--tools/battor_agent/DEPS1
-rw-r--r--tools/battor_agent/battor_agent.gyp2
-rw-r--r--tools/battor_agent/battor_agent_bin.cc24
-rw-r--r--tools/battor_agent/battor_finder.cc39
-rw-r--r--tools/battor_agent/battor_finder.h23
6 files changed, 4 insertions, 87 deletions
diff --git a/tools/battor_agent/BUILD.gn b/tools/battor_agent/BUILD.gn
index 1a057f3..2f6dd28 100644
--- a/tools/battor_agent/BUILD.gn
+++ b/tools/battor_agent/BUILD.gn
@@ -28,8 +28,6 @@ source_set("battor_agent_lib") {
"battor_connection_impl.cc",
"battor_connection_impl.h",
"battor_error.h",
- "battor_finder.cc",
- "battor_finder.h",
"battor_sample_converter.cc",
"battor_sample_converter.h",
]
diff --git a/tools/battor_agent/DEPS b/tools/battor_agent/DEPS
index b40de52..67358f38 100644
--- a/tools/battor_agent/DEPS
+++ b/tools/battor_agent/DEPS
@@ -1,5 +1,4 @@
include_rules = [
"+device/serial",
- "+mojo/public",
"+net/base",
] \ No newline at end of file
diff --git a/tools/battor_agent/battor_agent.gyp b/tools/battor_agent/battor_agent.gyp
index c34c5cd..051f66d 100644
--- a/tools/battor_agent/battor_agent.gyp
+++ b/tools/battor_agent/battor_agent.gyp
@@ -35,8 +35,6 @@
'battor_connection_impl.cc',
'battor_connection_impl.h',
'battor_error.h',
- 'battor_finder.cc',
- 'battor_finder.h',
'battor_sample_converter.cc',
'battor_sample_converter.h',
],
diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc
index 93036e2..360146d 100644
--- a/tools/battor_agent/battor_agent_bin.cc
+++ b/tools/battor_agent/battor_agent_bin.cc
@@ -19,7 +19,6 @@
#include "base/threading/thread.h"
#include "tools/battor_agent/battor_agent.h"
#include "tools/battor_agent/battor_error.h"
-#include "tools/battor_agent/battor_finder.h"
using std::cout;
using std::endl;
@@ -48,11 +47,12 @@ void PrintSupportsExplicitClockSync() {
cout << battor::BattOrAgent::SupportsExplicitClockSync() << endl;
}
-// Retrieves argument argnum from the argument list, or an empty string if the
-// argument doesn't exist.
+// Retrieves argument argnum from the argument list, printing the usage
+// guidelines and exiting with an error code if the argument doesn't exist.
std::string GetArg(int argnum, int argc, char* argv[]) {
if (argnum >= argc) {
- return std::string();
+ PrintUsage();
+ exit(1);
}
return argv[argnum];
@@ -89,10 +89,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
// Runs the BattOr binary and returns the exit code.
int Run(int argc, char* argv[]) {
std::string cmd = GetArg(1, argc, argv);
- if (cmd.empty()) {
- PrintUsage();
- exit(1);
- }
// SupportsExplicitClockSync doesn't need to use the serial connection, so
// handle it separately.
@@ -102,18 +98,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
}
std::string path = GetArg(2, argc, argv);
- // If no path is specified, see if we can find a BattOr and use that.
- if (path.empty())
- path = BattOrFinder::FindBattOr();
-
- // If we don't have any BattOr to use, exit.
- if (path.empty()) {
- cout << "Unable to find a BattOr, and no explicit BattOr path was "
- "specified."
- << endl;
- exit(1);
- }
-
SetUp(path);
if (cmd == "StartTracing") {
diff --git a/tools/battor_agent/battor_finder.cc b/tools/battor_agent/battor_finder.cc
deleted file mode 100644
index b0e32db..0000000
--- a/tools/battor_agent/battor_finder.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 The Chromium 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 "tools/battor_agent/battor_finder.h"
-
-#include "device/serial/serial.mojom.h"
-#include "device/serial/serial_device_enumerator.h"
-#include "mojo/public/cpp/bindings/array.h"
-
-namespace battor {
-
-namespace {
-
-// The USB display name prefix that all BattOrs have.
-const char kBattOrDisplayNamePrefix[] = "BattOr";
-
-} // namespace
-
-// Returns the path of the first BattOr that we find.
-std::string BattOrFinder::FindBattOr() {
- scoped_ptr<device::SerialDeviceEnumerator> serial_device_enumerator =
- device::SerialDeviceEnumerator::Create();
-
- mojo::Array<device::serial::DeviceInfoPtr> devices =
- serial_device_enumerator->GetDevices();
-
- for (size_t i = 0; i < devices.size(); i++) {
- std::string display_name = devices[i]->display_name.get();
-
- if (display_name.find(kBattOrDisplayNamePrefix) != std::string::npos) {
- return devices[i]->path;
- }
- }
-
- return std::string();
-}
-
-} // namespace battor
diff --git a/tools/battor_agent/battor_finder.h b/tools/battor_agent/battor_finder.h
deleted file mode 100644
index fe6fa79..0000000
--- a/tools/battor_agent/battor_finder.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_
-#define TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_
-
-#include <string>
-
-#include "base/macros.h"
-
-namespace battor {
-
-class BattOrFinder {
- public:
- static std::string FindBattOr();
-
- DISALLOW_COPY_AND_ASSIGN(BattOrFinder);
-};
-
-} // namespace battor
-
-#endif // TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_