AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent Class Reference

#include <MRMCapabilityAgent.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent:
Collaboration graph
[legend]

Public Member Functions

 ~MRMCapabilityAgent () override
 
std::string getVersionString () const
 
Overridden CapabilityAgent methods.
void preHandleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< DirectiveInfo > info) override
 
Overridden DirectiveHandlerInterface methods (which CapabilityAgent

derives from).

void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
Overridden SpeakerManagerObserverInterface methods.
void onSpeakerSettingsChanged (const avsCommon::sdkInterfaces::SpeakerManagerObserverInterface::Source &source, const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type &type, const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings &settings) override
 
Overridden UserInactivityMonitorObserverInterface methods.
void onUserInactivityReportSent () override
 
Overridden @c CallStateObserverInterface methods
void onCallStateChange (avsCommon::sdkInterfaces::CallStateObserverInterface::CallState callState) override
 
Overridden @c DialogUXStateChanged methods.
void onDialogUXStateChanged (avsCommon::sdkInterfaces::DialogUXStateObserverInterface::DialogUXState newState) override
 
Overridden CapabilityConfigurationInterface methods.
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations () override
 
Overridden RenderPlayerInfoCardsProviderInterface methods.
void setObserver (std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface > observer) override
 
Overridden RequiresShutdown methods.
void doShutdown () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
virtual ~CapabilityAgent ()=default
 
void preHandleDirective (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) override final
 
bool handleDirective (const std::string &messageId) override final
 
void cancelDirective (const std::string &messageId) override final
 
void onDeregistered () override
 
void onFocusChanged (FocusState newFocus, MixingBehavior behavior) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
virtual void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive)=0
 
virtual void preHandleDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< DirectiveHandlerResultInterface > result)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface
virtual ~ChannelObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface
virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::NamespaceAndName &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 
virtual bool shouldQueryState ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const std::string &jsonContext)
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface
virtual ~SpeakerManagerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface
virtual ~UserInactivityMonitorObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
virtual ~CallStateObserverInterface ()=default
 
virtual void onCallStateInfoChange (const CallStateInfo &stateInfo)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
virtual ~DialogUXStateObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface
virtual ~CapabilityConfigurationInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::RenderPlayerInfoCardsProviderInterface
virtual ~RenderPlayerInfoCardsProviderInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::shared_ptr< MRMCapabilityAgentcreate (std::shared_ptr< MRMHandlerInterface > mrmHandler, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > speakerManager, std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorInterface > userInactivityMonitor, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
static bool isStateActive (const CallStateObserverInterface::CallState &state)
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
static std::string stateToString (DialogUXState state)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface
enum  Source { Source::DIRECTIVE, Source::LOCAL_API, Source::EXTERNAL_CLIENT }
 Indicates whether the source of the call is from an AVS Directive or through a Local API call. More...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
enum  CallState {
  CallState::CONNECTING, CallState::INBOUND_RINGING, CallState::CALL_CONNECTED, CallState::CALL_DISCONNECTED,
  CallState::NONE
}
 An enumeration representing the state of a call. More...
 
typedef struct alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo CallStateInfo
 An struct containing call state information. More...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
enum  DialogUXState {
  DialogUXState::IDLE, DialogUXState::LISTENING, DialogUXState::EXPECTING, DialogUXState::THINKING,
  DialogUXState::SPEAKING, DialogUXState::FINISHED
}
 The different dialog specific AVS UX states. More...
 
- Protected Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
 CapabilityAgent (const std::string &nameSpace, std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
virtual std::shared_ptr< DirectiveInfocreateDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result)
 
void removeDirective (const std::string &messageId)
 
void sendExceptionEncounteredAndReportFailed (std::shared_ptr< DirectiveInfo > info, const std::string &message, avsCommon::avs::ExceptionErrorType type=avsCommon::avs::ExceptionErrorType::INTERNAL_ERROR)
 
const std::pair< std::string, std::string > buildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdString="", const std::string &payload="{}", const std::string &context="") const
 
- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
const std::string m_namespace
 The namespace of the capability agent. More...
 
std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterfacem_exceptionEncounteredSender
 Object to use to send exceptionEncountered messages. More...
 

Detailed Description

Implementation of an MRM Capability Agent.

Constructor & Destructor Documentation

◆ ~MRMCapabilityAgent()

alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::~MRMCapabilityAgent ( )
override

Destructor.

Member Function Documentation

◆ cancelDirective()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::cancelDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Cancel an ongoing preHandleDirective() or handleDirective() operation for the AVSDirective in . Once this has been called the CapabilityAgent should not expect to receive further calls regarding this directive.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ create()

std::shared_ptr< MRMCapabilityAgent > alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::create ( std::shared_ptr< MRMHandlerInterface mrmHandler,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface speakerManager,
std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorInterface userInactivityMonitor,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender 
)
static

Creates an instance of this Capability Agent.

Parameters
handlerThe MRM Handler, which handles all MRM-specific implementation.
speakerManagerAn object which allows us to detect changes to device Speakers.
userInactivityMonitorAn object which allows us to know about general user activity with the client.
exceptionEncounteredSenderAn object which may send System.ExceptionEncountered Events to AVS if needed.
Returns
A pointer to an object of this type, or nullptr if there were problems during construction.

◆ doShutdown()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ getCapabilityConfigurations()

std::unordered_set< std::shared_ptr< CapabilityConfiguration > > alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::getCapabilityConfigurations ( )
overridevirtual

Returns the configurations of the capability interfaces being implemented.

Returns
A set of CapabilityConfigurations

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface.

◆ getConfiguration()

DirectiveHandlerConfiguration alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::getConfiguration ( ) const
overridevirtual

Returns the configuration of the directive handler.

The configuration consists of multiple directive routing rules and their respective blocking policy. The directives will be matched from the most specific rule (with all fields defined) to the least specific rule (which only matches the directive endpointId).

Returns
The avs::DirectiveHandlerConfiguration of the handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ getVersionString()

std::string alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::getVersionString ( ) const

Returns the string representation of the version of this MRM implementation.

Returns
The string representation of the version of this MRM implementation.

◆ handleDirective()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::handleDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Handle the action specified by the AVSDirective in info. The handling of subsequent directives with the same DialogRequestId may be blocked until the DirectiveHandler calls the setSucceeded() method of the DirectiveHandlingResult present in info. If handling of this directive fails setFailed() should be called to indicate a failure.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ handleDirectiveImmediately()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
override

◆ onCallStateChange()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::onCallStateChange ( avsCommon::sdkInterfaces::CallStateObserverInterface::CallState  state)
overridevirtual

Allows the observer to react to a change in call state.

Parameters
stateThe new CallState.

Implements alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface.

◆ onDialogUXStateChanged()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::onDialogUXStateChanged ( avsCommon::sdkInterfaces::DialogUXStateObserverInterface::DialogUXState  newState)
overridevirtual

This function is called whenever the AVS UX dialog state of the system changes. This function will block processing of other state changes, so any implementation of this should return quickly.

Parameters
newStateThe new dialog specific AVS UX state.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface.

◆ onSpeakerSettingsChanged()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::onSpeakerSettingsChanged ( const avsCommon::sdkInterfaces::SpeakerManagerObserverInterface::Source source,
const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type type,
const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings settings 
)
overridevirtual

A callback for when the SpeakerInterface::SpeakerSettings successfully changes.

Parameters
source.This indicates the origin of the call.
type.This indicates the type of ChannelVolumeInterface that was modified.
settings.This indicates the current settings after the change.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface.

◆ onUserInactivityReportSent()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::onUserInactivityReportSent ( )
overridevirtual

This function is called when the System.UserInactivityReport Event has been sent.

Implements alexaClientSDK::avsCommon::sdkInterfaces::UserInactivityMonitorObserverInterface.

◆ preHandleDirective()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::preHandleDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Notification that a directive has arrived. This notification gives the DirectiveHandler a chance to prepare for handling of an AVSDirective. If an error occurs during the pre-Handling phase and that error should cancel the handling of subsequent AVSDirectives with the same DialogRequestId, the DirectiveHandler should call the setFailed method on the result instance passed in to this call.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ setObserver()

void alexaClientSDK::capabilityAgents::mrm::MRMCapabilityAgent::setObserver ( std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface observer)
overridevirtual

This function sets an RenderPlayerInfoCardsObserverInterface so that it will get notified for RenderPlayerInfoCards state changes. This implies that there can be one or no observer at a given time.

Parameters
observerThe RenderPlayerInfoCardsObserverInterface

Implements alexaClientSDK::avsCommon::sdkInterfaces::RenderPlayerInfoCardsProviderInterface.


The documentation for this class was generated from the following files:

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0