Commit df2314bc authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Improve OOB experience for battor_agent

When running battor_agent.exe for the first time one is likely to
encounter the message "Unable to find a BattOr." Once a BattOr is found
and battor_agent starts running there is a more informative help message
printed if you type <enter>, but that is too late. This change prints an
informative help message when a BattOr cannot be found, and also adds a
bug link to the code to explain why BattOrs are not auto-found on
Windows.

BUG=588244

Change-Id: I1206f906b32c2f2e6ec18517e6c184aaf44bb7a7
Reviewed-on: https://chromium-review.googlesource.com/598657Reviewed-by: default avatarCharlie Andrews <charliea@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491779}
parent 891e65c5
......@@ -50,6 +50,7 @@
#include "base/task_scheduler/task_scheduler.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "tools/battor_agent/battor_agent.h"
#include "tools/battor_agent/battor_error.h"
#include "tools/battor_agent/battor_finder.h"
......@@ -122,6 +123,11 @@ class BattOrAgentBin : public BattOrAgent::Listener {
std::string path = BattOrFinder::FindBattOr();
if (path.empty()) {
std::cout << "Unable to find a BattOr." << endl;
#if defined(OS_WIN)
std::cout << "Try \"--battor-path=<path>\" to specify the COM port where "
"the BattOr can be found, typically COM3."
<< endl;
#endif
exit(1);
}
......
......@@ -35,7 +35,7 @@ std::string BattOrFinder::FindBattOr() {
kBattOrPathSwitch);
if (switch_specified_path.empty()) {
// If we have no switch-specified path, look for a device with the right
// display name.
// display name. See crbug.com/588244 for why this never works on Windows.
for (size_t i = 0; i < devices.size(); i++) {
if (!devices[i]->display_name)
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment