aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp')
-rw-r--r--src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp b/src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp
index 78ef10a..57fc592 100644
--- a/src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp
+++ b/src/plugins/core/src/VRRequestProcessorDelegateImpl.cpp
@@ -62,6 +62,32 @@ string VRRequestProcessorDelegate::startRequestForVoiceAgent(
return newReqId;
}
+string VRRequestProcessorDelegate::loginEventsRequestForVoiceAgent(
+ shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent,
+ std::list<std::string> *args) {
+ if (!mApi) {
+ mLogger->log(Level::ERROR, TAG, "Failed to loginEventsRequestForVoiceAgent: " + voiceAgent->getId() + ", No API.");
+ return "";
+ }
+
+ // Generate a new request ID.
+ string newReqId = vshlcore::utilities::uuid::generateUUID();
+
+ // Create a new request and start listening.
+ shared_ptr<VRRequest> newRequest = VRRequest::create(mLogger, mApi, newReqId, voiceAgent);
+
+ mLogger->log(Level::DEBUG, TAG, "Starting login request with ID: " + newReqId);
+ if (!newRequest->subscribeToLoginEvents(args)) {
+ mLogger->log(Level::ERROR, TAG, "Failed to subscribe to login events.");
+ return "";
+ }
+
+ // Insert only if its started successfully.
+ mVRRequests.insert(make_pair(voiceAgent->getId(), newRequest));
+
+ return newReqId;
+}
+
void VRRequestProcessorDelegate::cancelAllRequests() {
// Cancel Pending requests
if (!mVRRequests.empty()) {