aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2016-01-04 15:18:51 -0800
committerVitaly Buka <vitalybuka@google.com>2016-01-04 23:49:49 +0000
commite6fee32eeccd56bc0e07e513aa53e31042baff7b (patch)
tree85b1116283c4fcbf1de5a0faf553847fb6c1fb46 /examples
parente6b17ed3577bfd093d6ec2b5959c110c7f9a1a6b (diff)
downloadlibweave-e6fee32eeccd56bc0e07e513aa53e31042baff7b.tar.gz
Update command definition of sample daemon
Now server requires "results" to be defined. BUG: 26384142 Change-Id: Ib3e7eea554995feb4c2d0b52f613ef225fa2f48a Reviewed-on: https://weave-review.googlesource.com/2100 Reviewed-by: Alex Vakulenko <avakulenko@google.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/daemon/sample/sample.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/daemon/sample/sample.cc b/examples/daemon/sample/sample.cc
index 1d036d5..f4ad3d9 100644
--- a/examples/daemon/sample/sample.cc
+++ b/examples/daemon/sample/sample.cc
@@ -19,6 +19,9 @@ const char kTraits[] = R"({
"minimalRole": "user",
"parameters": {
"name": { "type": "string" }
+ },
+ "results": {
+ "reply": { "type": "string" }
}
},
"ping": {
@@ -107,10 +110,9 @@ class SampleHandler {
base::FundamentalValue{++ping_count_}, nullptr);
LOG(INFO) << "New component state: " << device_->GetComponents();
- base::DictionaryValue result;
- cmd->Complete(result, nullptr);
+ cmd->Complete({}, nullptr);
- LOG(INFO) << cmd->GetName() << " command finished: " << result;
+ LOG(INFO) << cmd->GetName() << " command finished";
}
void OnCountdownCommand(const std::weak_ptr<weave::Command>& command) {
@@ -146,10 +148,9 @@ class SampleHandler {
return;
}
- base::DictionaryValue result;
- cmd->Complete(result, nullptr);
+ cmd->Complete({}, nullptr);
LOG(INFO) << "countdown finished";
- LOG(INFO) << cmd->GetName() << " command finished: " << result;
+ LOG(INFO) << cmd->GetName() << " command finished";
}
weave::Device* device_{nullptr};