aboutsummaryrefslogtreecommitdiff
path: root/src/device_manager.cc
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2015-12-15 14:46:47 -0800
committerVitaly Buka <vitalybuka@google.com>2015-12-16 01:32:53 +0000
commit34668e731bb194b443bc0e6029d6d3583f08de28 (patch)
tree977de929eeaf54e264d1693d1a392a161ebf52f5 /src/device_manager.cc
parentc3bc82a29cdff05d67d3b583ca0bc25df96ab382 (diff)
downloadlibweave-34668e731bb194b443bc0e6029d6d3583f08de28.tar.gz
Reformat
Change-Id: Ia98499f9ada220151b24ecb8b60b02524d700bc4 Reviewed-on: https://weave-review.googlesource.com/1967 Reviewed-by: Vitaly Buka <vitalybuka@google.com>
Diffstat (limited to 'src/device_manager.cc')
-rw-r--r--src/device_manager.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/device_manager.cc b/src/device_manager.cc
index 88256da..ab2e225 100644
--- a/src/device_manager.cc
+++ b/src/device_manager.cc
@@ -129,10 +129,9 @@ bool DeviceManager::SetStateProperties(const std::string& component,
return component_manager_->SetStateProperties(component, dict, error);
}
-const base::Value* DeviceManager::GetStateProperty(
- const std::string& component,
- const std::string& name,
- ErrorPtr* error) const {
+const base::Value* DeviceManager::GetStateProperty(const std::string& component,
+ const std::string& name,
+ ErrorPtr* error) const {
return component_manager_->GetStateProperty(component, name, error);
}
@@ -162,9 +161,8 @@ void DeviceManager::AddCommandDefinitions(const base::DictionaryValue& dict) {
bool DeviceManager::AddCommand(const base::DictionaryValue& command,
std::string* id,
ErrorPtr* error) {
- auto command_instance =
- component_manager_->ParseCommandInstance(command, Command::Origin::kLocal,
- UserRole::kOwner, id, error);
+ auto command_instance = component_manager_->ParseCommandInstance(
+ command, Command::Origin::kLocal, UserRole::kOwner, id, error);
if (!command_instance)
return false;
component_manager_->AddCommand(std::move(command_instance));
@@ -212,10 +210,12 @@ bool DeviceManager::SetStateProperties(const base::DictionaryValue& dict,
std::string component =
component_manager_->FindComponentWithTrait(it.key());
if (component.empty()) {
- Error::AddToPrintf(
- error, FROM_HERE, errors::commands::kDomain, "unrouted_state",
- "Unable to set property value because there is no component supporting "
- "trait '%s'", it.key().c_str());
+ Error::AddToPrintf(error, FROM_HERE, errors::commands::kDomain,
+ "unrouted_state",
+ "Unable to set property value because there is no "
+ "component supporting "
+ "trait '%s'",
+ it.key().c_str());
return false;
}
base::DictionaryValue trait_state;
@@ -242,9 +242,10 @@ bool DeviceManager::SetStateProperty(const std::string& name,
std::string component = component_manager_->FindComponentWithTrait(trait);
if (component.empty()) {
Error::AddToPrintf(
- error, FROM_HERE, errors::commands::kDomain, "unrouted_state",
- "Unable set value of state property '%s' because there is no component "
- "supporting trait '%s'", name.c_str(), trait.c_str());
+ error, FROM_HERE, errors::commands::kDomain, "unrouted_state",
+ "Unable set value of state property '%s' because there is no component "
+ "supporting trait '%s'",
+ name.c_str(), trait.c_str());
return false;
}
return component_manager_->SetStateProperty(component, name, value, error);