AlexaClientSDK  3.0.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::acsdkAlerts::AlertsCapabilityAgent Class Reference

#include <AlertsCapabilityAgent.h>

Inheritance diagram for alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent:
Collaboration graph
[legend]

Public Member Functions

int getAlertVolume ()
 
CapabilityAgent Functions
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void preHandleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< DirectiveInfo > info) override
 
void onDeregistered () override
 
void onConnectionStatusChanged (const Status status, const ChangedReason reason) override
 
void onFocusChanged (avsCommon::avs::FocusState focusState, avsCommon::avs::MixingBehavior behavior) override
 
AlertObserverInterface function.
void onAlertStateChange (const AlertInfo &alertInfo) override
 
FocusManagerObserverInterface Functions
void onFocusChanged (const std::string &channelName, avsCommon::avs::FocusState newFocus) override
 
CapabilityConfigurationInterface Functions
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations () override
 
SpeakerManagerObserverInterface Functions
void onSpeakerSettingsChanged (const Source &source, const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type &type, const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings &settings) override
 
SystemClockMonitorObserverInterface Functions
void onSystemClockSynchronized () override
 
CustomerDataHandler Functions
void clearData () override
 
AlertsCapabilityAgentInterface Functions
void addObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer) override
 
void removeObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer) override
 
void removeAllAlerts () override
 
void onLocalStop () 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
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
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::ConnectionStatusObserverInterface
virtual ~ConnectionStatusObserverInterface ()=default
 
virtual void onConnectionStatusChanged (const Status status, const std::vector< EngineConnectionStatus > &engineStatuses)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface
virtual ~CapabilityConfigurationInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface
virtual ~SpeakerManagerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::FocusManagerObserverInterface
virtual ~FocusManagerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlertsInterfaces::AlertObserverInterface
virtual ~AlertObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlertsInterfaces::AlertsCapabilityAgentInterface
virtual void addObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer)=0
 
virtual void removeObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer)=0
 
virtual ~AlertsCapabilityAgentInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkSystemClockMonitorInterfaces::SystemClockMonitorObserverInterface
virtual ~SystemClockMonitorObserverInterface ()=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
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandler
 CustomerDataHandler (const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &dataManager)
 
virtual ~CustomerDataHandler ()
 
- Public Member Functions inherited from alexaClientSDK::registrationManager::CustomerDataHandlerInterface
virtual ~CustomerDataHandlerInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< AlertsCapabilityAgentInterface > createAlertsCapabilityAgent (const std::shared_ptr< acsdkAlerts::renderer::Renderer > &alertRenderer, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, const std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > &connectionManager, const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &contextManager, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionEncounteredSender, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > &audioFocusManager, const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender, const std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > &speakerManager, const std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > &audioFactory, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &endpointCapabilitiesRegistrar, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder, const std::shared_ptr< acsdkSystemClockMonitorInterfaces::SystemClockNotifierInterface > &systemClockMonitor, const std::shared_ptr< certifiedSender::CertifiedSender > &certifiedSender, const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &dataManager, const std::shared_ptr< settings::DeviceSettingsManager > &settingsManager, const std::shared_ptr< storage::AlertStorageInterface > &alertStorage, bool startAlertSchedulingOnInitialization=true)
 
static std::shared_ptr< AlertsCapabilityAgentcreate (std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > connectionManager, std::shared_ptr< certifiedSender::CertifiedSender > certifiedMessageSender, std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface > focusManager, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > speakerManager, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender, std::shared_ptr< storage::AlertStorageInterface > alertStorage, std::shared_ptr< avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface > alertsAudioFactory, std::shared_ptr< renderer::RendererInterface > alertRenderer, std::shared_ptr< registrationManager::CustomerDataManagerInterface > dataManager, std::shared_ptr< settings::AlarmVolumeRampSetting > alarmVolumeRampSetting, std::shared_ptr< settings::DeviceSettingsManager > settingsManager, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr, bool startAlertSchedulingOnInitialization=true, std::shared_ptr< acsdkSystemClockMonitorInterfaces::SystemClockNotifierInterface > systemClockMonitor=nullptr)
 
static settings::SettingEventMetadata getAlarmVolumeRampMetadata ()
 
- Static Public Member Functions inherited from alexaClientSDK::acsdkAlertsInterfaces::AlertObserverInterface
template<class T >
static bool withinBounds (T value, T minVal, T maxVal)
 
static std::string stateToString (State state)
 
static std::string typeToString (Type type)
 
static std::string originalTimeToString (const OriginalTime &originalTime)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
enum  Status { Status::DISCONNECTED, Status::PENDING, Status::CONNECTED }
 
enum  ChangedReason {
  ChangedReason::NONE, ChangedReason::SUCCESS, ChangedReason::UNRECOVERABLE_ERROR, ChangedReason::ACL_CLIENT_REQUEST,
  ChangedReason::ACL_DISABLED, ChangedReason::DNS_TIMEDOUT, ChangedReason::CONNECTION_TIMEDOUT, ChangedReason::CONNECTION_THROTTLED,
  ChangedReason::INVALID_AUTH, ChangedReason::PING_TIMEDOUT, ChangedReason::WRITE_TIMEDOUT, ChangedReason::READ_TIMEDOUT,
  ChangedReason::FAILURE_PROTOCOL_ERROR, ChangedReason::INTERNAL_ERROR, ChangedReason::SERVER_INTERNAL_ERROR, ChangedReason::SERVER_SIDE_DISCONNECT,
  ChangedReason::SERVER_ENDPOINT_CHANGED
}
 
- 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::acsdkAlertsInterfaces::AlertObserverInterface
enum  State {
  State::READY, State::STARTED, State::STOPPED, State::SNOOZED,
  State::COMPLETED, State::PAST_DUE, State::FOCUS_ENTERED_FOREGROUND, State::FOCUS_ENTERED_BACKGROUND,
  State::ERROR, State::DELETED, State::SCHEDULED_FOR_LATER
}
 
enum  Type { Type::ALARM, Type::TIMER, Type::REMINDER }
 
- Static Public Attributes inherited from alexaClientSDK::acsdkAlertsInterfaces::AlertObserverInterface
static const int ORIGINAL_TIME_FIELD_MIN = 0
 The minimum value for the field in OriginalTime. More...
 
static const int ORIGINAL_TIME_HOUR_MAX = 23
 The maximum value for the hour field in OriginalTime. More...
 
static const int ORIGINAL_TIME_MINUTE_MAX = 59
 The maximum value for the minute field in OriginalTime. More...
 
static const int ORIGINAL_TIME_SECOND_MAX = 59
 The maximum value for the second field in OriginalTime. More...
 
static const int ORIGINAL_TIME_MILLISECOND_MAX = 999
 The maximum value for the millisecond field in OriginalTime. 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

This class implements an Alerts capability agent.

Member Function Documentation

◆ addObserver()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::addObserver ( std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface observer)
override

◆ cancelDirective()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::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.

◆ clearData()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::clearData ( )
overridevirtual

◆ create()

static std::shared_ptr<AlertsCapabilityAgent> alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::create ( std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface connectionManager,
std::shared_ptr< certifiedSender::CertifiedSender certifiedMessageSender,
std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface focusManager,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface speakerManager,
std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface contextManager,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender,
std::shared_ptr< storage::AlertStorageInterface alertStorage,
std::shared_ptr< avsCommon::sdkInterfaces::audio::AlertsAudioFactoryInterface alertsAudioFactory,
std::shared_ptr< renderer::RendererInterface alertRenderer,
std::shared_ptr< registrationManager::CustomerDataManagerInterface dataManager,
std::shared_ptr< settings::AlarmVolumeRampSetting alarmVolumeRampSetting,
std::shared_ptr< settings::DeviceSettingsManager settingsManager,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr,
bool  startAlertSchedulingOnInitialization = true,
std::shared_ptr< acsdkSystemClockMonitorInterfaces::SystemClockNotifierInterface systemClockMonitor = nullptr 
)
static

Create function.

Deprecated:
Parameters
messageSenderAn interface to which this object will send Events to AVS.
connectionManagerAn AVSConnectionManagerInterface instance to listen for connection status updates.
certifiedMessageSenderAn interface to which this object will send guaranteed Events to AVS.
focusManagerAn interface with which this object will request and release Alert channel focus.
speakerManagerAn interface to control volume of the Alerts.
contextManagerAn interface to which this object will send context updates as alert states change.
exceptionEncounteredSenderAn interface which allows ExceptionEncountered Events to be sent to AVS.
alertStorageAn interface to store, load, modify and delete Alerts.
alertsAudioFactoryA provider of audio streams specific to Alerts.
alertRendererAn alert renderer, which Alerts will use to generate user-perceivable effects when active.
dataManagerA dataManager object that will track the CustomerDataHandler.
alarmVolumeRampSettingThe alarm volume ramp setting.
settingsManagerA settingsManager object that manages alarm volume ramp setting.
metricRecorderThe metric recorder.
startAlertSchedulingOnInitializationWhether to start scheduling alerts after client initialization. If this is set to false, no alert scheduling will occur until onSystemClockSynchronized is called.
systemClockMonitorThis class notifies its observers of system clock synchronization.
Returns
A pointer to an object of this type, or nullptr if there were problems during construction.

◆ createAlertsCapabilityAgent()

static std::shared_ptr<AlertsCapabilityAgentInterface> alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::createAlertsCapabilityAgent ( const std::shared_ptr< acsdkAlerts::renderer::Renderer > &  alertRenderer,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier,
const std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > &  connectionManager,
const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &  contextManager,
const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &  exceptionEncounteredSender,
const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > &  audioFocusManager,
const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &  messageSender,
const std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > &  speakerManager,
const std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > &  audioFactory,
const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &  endpointCapabilitiesRegistrar,
const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &  metricRecorder,
const std::shared_ptr< acsdkSystemClockMonitorInterfaces::SystemClockNotifierInterface > &  systemClockMonitor,
const std::shared_ptr< certifiedSender::CertifiedSender > &  certifiedSender,
const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &  dataManager,
const std::shared_ptr< settings::DeviceSettingsManager > &  settingsManager,
const std::shared_ptr< storage::AlertStorageInterface > &  alertStorage,
bool  startAlertSchedulingOnInitialization = true 
)
static

Factory method that creates a new AlertsCapabilityAgentInterface.

Parameters
alertRendererAn alert renderer, which Alerts will use to generate user-perceivable effects when active.
shutdownNotifierAn object to notify this CA when to shut down.
connectionManagerAn AVSConnectionManagerInterface instance to listen for connection status updates.
contextManagerAn interface to which this object will send context updates as alert states change.
exceptionEncounteredSenderAn interface which allows ExceptionEncountered Events to be sent to AVS.
audioFocusManagerAn interface with which this object will request and release Alert channel focus.
messageSenderAn interface to which this object will send Events to AVS.
speakerManagerAn interface to control volume of the Alerts.
alertsAudioFactoryFactory that can provide a unique audio stream for alerts.
endpointCapabilitiesRegistrarThe object with which to register this AudioPlayer's capabilities for the default endpoint.
metricRecorderThe metric recorder.
systemClockMonitorThis class notifies its observers of system clock synchronization.
certifiedMessageSenderAn interface to which this object will send guaranteed Events to AVS.
dataManagerA dataManager object that will track the CustomerDataHandler.
settingsManagerA settingsManager object that manages alarm volume ramp setting.
alertStorageAn interface to store, load, modify and delete Alerts.
startAlertSchedulingOnInitializationWhether to start scheduling alerts after client initialization. If this is set to false, no alert scheduling will occur until onSystemClockSynchronized is called.
Returns
A pointer to an object of this type, or nullptr if there were problems during construction.

◆ getAlarmVolumeRampMetadata()

static settings::SettingEventMetadata alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::getAlarmVolumeRampMetadata ( )
static

Return the alarm volume ramp event metadata.

Returns
The alarm volume ramp event metadata.

◆ getAlertVolume()

int alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::getAlertVolume ( )

Returns the alert volume.

Returns
The alert volume.

◆ getCapabilityConfigurations()

std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration> > alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::getCapabilityConfigurations ( )
overridevirtual

Returns the configurations of the capability interfaces being implemented.

Returns
A set of CapabilityConfigurations

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

◆ getConfiguration()

avsCommon::avs::DirectiveHandlerConfiguration alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::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.

◆ handleDirective()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::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::acsdkAlerts::AlertsCapabilityAgent::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
overridevirtual

Handle the action specified AVSDirective. Once this has been called the DirectiveHandler 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.
If this operation fails, an ExceptionEncountered message should be sent to AVS.
Parameters
directiveThe directive to handle.

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

◆ onAlertStateChange()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onAlertStateChange ( const AlertInfo alertInfo)
overridevirtual

A callback function to notify an object that an alert has updated its state.

Parameters
alertInfoThe information of the updated alert.

Implements alexaClientSDK::acsdkAlertsInterfaces::AlertObserverInterface.

◆ onConnectionStatusChanged()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onConnectionStatusChanged ( const Status  status,
const ChangedReason  reason 
)
overridevirtual

Called when the AVS connection state changes.

Parameters
statusThe current connection status.
reasonThe reason the status change occurred.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.

◆ onDeregistered()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onDeregistered ( )
overridevirtual

Notification that this handler has been de-registered and will not receive any more calls.

Reimplemented from alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ onFocusChanged() [1/2]

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onFocusChanged ( avsCommon::avs::FocusState  newFocus,
avsCommon::avs::MixingBehavior  behavior 
)
overridevirtual

Used to notify the observer of the Channel of focus changes. Once called, the client should make a user observable change only and return immediately. Any additional work that needs to be done should be done on a separate thread or after returning. "User observable change" here refers to events that the end user of the product can visibly see or hear. For example, Alexa speech or music playing would be examples of user observable changes. Other work, such as database storing, logging, or communicating via network should be done on a different thread. Not doing so could result in delays for other clients trying to access the Channel.

Parameters
newFocusThe new Focus of the channel.
behaviorThe mixingBehavior for the ChannelObserver to take as per the interrupt model
Note
when newFocus is FocusState::FOREGROUND, the MixingBehavior shall be guaranteed to be PRIMARY when newFocus is FocusState::NONE, the MixingBehavior shall be guaranteed to be MUST_STOP

Reimplemented from alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ onFocusChanged() [2/2]

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onFocusChanged ( const std::string &  channelName,
avsCommon::avs::FocusState  newFocus 
)
overridevirtual

Used to notify the observer of focus changes. This function should return quickly.

Parameters
channelNameThe name of the channel which changed FocusState.
newFocusThe new FocusState of channelName.

Implements alexaClientSDK::avsCommon::sdkInterfaces::FocusManagerObserverInterface.

◆ onLocalStop()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onLocalStop ( )
overridevirtual

This function provides a way for application code to request this object stop any active alert as the result of a user action, such as pressing a physical 'stop' button on the device.

Implements alexaClientSDK::acsdkAlertsInterfaces::AlertsCapabilityAgentInterface.

◆ onSpeakerSettingsChanged()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onSpeakerSettingsChanged ( const 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.

◆ onSystemClockSynchronized()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::onSystemClockSynchronized ( )
overridevirtual

Take necessary actions as a result of an system clock change.

Implements alexaClientSDK::acsdkSystemClockMonitorInterfaces::SystemClockMonitorObserverInterface.

◆ preHandleDirective()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::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.

◆ removeAllAlerts()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::removeAllAlerts ( )
overridevirtual

A function that allows an application to clear all alerts from storage. This may be useful for a scenario where a user logs out of a device, and another user will log in. As the first user logs out, their pending alerts should not go off.

Implements alexaClientSDK::acsdkAlertsInterfaces::AlertsCapabilityAgentInterface.

◆ removeObserver()

void alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent::removeObserver ( std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface observer)
override

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

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