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/VRRequestProcessorImpl.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/plugins/core/VRRequestProcessorImpl.cpp') diff --git a/src/plugins/core/VRRequestProcessorImpl.cpp b/src/plugins/core/VRRequestProcessorImpl.cpp index c07f745..d9fa846 100644 --- a/src/plugins/core/VRRequestProcessorImpl.cpp +++ b/src/plugins/core/VRRequestProcessorImpl.cpp @@ -57,6 +57,20 @@ string VRRequestProcessor::startListening() { return mDelegate->startRequestForVoiceAgent(defaultVA); } +string VRRequestProcessor::subscribeToLoginEvents(std::string va_id, std::list *args) { + // Currently simply send the request to the default voice agent, ignoring va_id + shared_ptr defaultVA = mDelegate->getDefaultVoiceAgent(); + if (!defaultVA) { + mLogger->log(Level::ERROR, TAG, "Failed to subscribeToLoginEvents. No default voiceagent found."); + return ""; + } + + // If the requests container is not empty, then clear the + // existing requests in flight and create a new request. + mDelegate->cancelAllRequests(); + return mDelegate->loginEventsRequestForVoiceAgent(defaultVA, args); +} + void VRRequestProcessor::cancel() { // Cancel all pending requests mDelegate->cancelAllRequests(); -- cgit 1.2.3-korg