summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-04-22 09:25:42 -0700
committerAlex Vakulenko <avakulenko@google.com>2016-04-22 16:27:45 +0000
commit23d2c98ec4798d5b4d7ffe152a2fb12609c023d8 (patch)
tree7744cacbe6764342ec7eec0b316aad6b794e0277
parent21e212af914b94f2b120dec456cf3295e41c5b6a (diff)
downloadexample-ledflasher-master.tar.gz
ledflasher: Remove handler for base.identify commandHEADmastermain
Since libweave no longer has the 'base' trait, its 'reboot' and 'identify' commands are removed too. Delete the command handler for 'base.identify' or else ledflasher just crashes at startup (with 'unknown command' error). Change-Id: I7d2a19640c53dd288620c0e6dabae389f26dbc11
-rw-r--r--src/ledflasher/ledflasher.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/ledflasher/ledflasher.cpp b/src/ledflasher/ledflasher.cpp
index bce3420..e3b79e8 100644
--- a/src/ledflasher/ledflasher.cpp
+++ b/src/ledflasher/ledflasher.cpp
@@ -36,8 +36,6 @@ using android::String16;
namespace {
const char kLedFlasherComponent[] = "ledflasher";
const char kLedFlasherTrait[] = "_ledflasher";
-const char kBaseComponent[] = "base";
-const char kBaseTrait[] = "base";
const char kLedComponentPrefix[] = "led";
const char kOnOffTrait[] = "onOff";
const char kLedInfoTrait[] = "_ledInfo";
@@ -62,7 +60,6 @@ class Daemon final : public brillo::Daemon {
// Particular command handlers for various commands.
void OnSetConfig(size_t led_index, std::unique_ptr<weaved::Command> command);
void OnAnimate(std::unique_ptr<weaved::Command> command);
- void OnIdentify(std::unique_ptr<weaved::Command> command);
// Helper methods to propagate device state changes to Buffet and hence to
// the cloud server or local clients.
@@ -125,9 +122,6 @@ void Daemon::OnWeaveServiceConnected(
kLedFlasherTrait,
"animate",
base::Bind(&Daemon::OnAnimate, weak_ptr_factory_.GetWeakPtr()));
- weave_service->AddCommandHandler(
- kBaseComponent, kBaseTrait, "identify",
- base::Bind(&Daemon::OnIdentify, weak_ptr_factory_.GetWeakPtr()));
weave_service->SetPairingInfoListener(
base::Bind(&Daemon::OnPairingInfoChanged,
@@ -258,19 +252,6 @@ void Daemon::OnAnimate(std::unique_ptr<weaved::Command> command) {
command->Complete({}, nullptr);
}
-void Daemon::OnIdentify(std::unique_ptr<weaved::Command> command) {
- if (!led_service_.get()) {
- command->Abort("_system_error", "ledservice unavailable", nullptr);
- return;
- }
- StartAnimation("blink", base::TimeDelta::FromMilliseconds(500));
- command->Complete({}, nullptr);
-
- brillo::MessageLoop::current()->PostDelayedTask(
- base::Bind(&Daemon::StopAnimation, weak_ptr_factory_.GetWeakPtr()),
- base::TimeDelta::FromSeconds(2));
-}
-
void Daemon::OnPairingInfoChanged(
const weaved::Service::PairingInfo* pairing_info) {
LOG(INFO) << "Daemon::OnPairingInfoChanged: " << pairing_info;