From ed834a643e3843c0f805ea33363c9f2889d2bab3 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Mon, 9 Dec 2019 02:25:25 +0100 Subject: Add CBL processing CBL: Code Based Linking in the case of Alexa voice agent, or more generally Code Based Logging. It provides a url and code which allows the user to complete the authorization process and start using the authorized voice services. - add subscribeToLoginEvents verb - add cbl events handling - include new verb in vshl-core-api.json Bug-AGL: SPEC-2981 Signed-off-by: Raquel Medina Change-Id: If342d45638125682621cba707eac1d4ff5ad244c --- src/plugins/core/src/VRRequestImpl.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/plugins/core/src/VRRequestImpl.cpp') diff --git a/src/plugins/core/src/VRRequestImpl.cpp b/src/plugins/core/src/VRRequestImpl.cpp index 63302d8..d1a18ac 100644 --- a/src/plugins/core/src/VRRequestImpl.cpp +++ b/src/plugins/core/src/VRRequestImpl.cpp @@ -32,6 +32,7 @@ namespace core { string VRRequest::VA_VERB_STARTLISTENING = "startListening"; string VRRequest::VA_VERB_CANCEL = "cancel"; +string VRRequest::VA_VERB_SUBSCRIBETOCBLEVENTS = "subscribeToCBLEvents"; unique_ptr VRRequest::create( shared_ptr logger, @@ -76,6 +77,21 @@ bool VRRequest::startListening() { return true; } + bool VRRequest::subscribeToLoginEvents(std::list *args) { + json_object* argsJ = json_object_new_object(); + json_object* evJ = json_object_new_array(); + json_object* resultJ; + std::string error, info; + bool result = true; + + json_object_object_add(argsJ, "events", evJ); + int rc = mApi->callSync(mVoiceAgent->getApi(), VA_VERB_SUBSCRIBETOCBLEVENTS, argsJ, &resultJ, error, info); + + FREEIF(resultJ); + + return true; +} + bool VRRequest::cancel() { json_object* object = NULL; std::string error, info; -- cgit 1.2.3-korg