buffet: Add CommandInstance::ToJson
Method is needed to implement commands status requests from
privetd. Current implementation generates JSON on request.
BUG=brillo:430
TEST=unittest
Change-Id: Iee4a788792a33278c997ad535abe11f26fa7f422
Reviewed-on: https://chromium-review.googlesource.com/262215
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/commands/command_instance.h b/buffet/commands/command_instance.h
index c925b6c..2b09829 100644
--- a/buffet/commands/command_instance.h
+++ b/buffet/commands/command_instance.h
@@ -65,6 +65,9 @@
const CommandDictionary& dictionary,
chromeos::ErrorPtr* error);
+ // Returns JSON representation of the command.
+ std::unique_ptr<base::DictionaryValue> ToJson() const;
+
// Sets the command ID (normally done by CommandQueue when the command
// instance is added to it).
void SetID(const std::string& id) { id_ = id; }