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

#include <DevicePropertyAggregator.h>

Inheritance diagram for alexaClientSDK::diagnostics::DevicePropertyAggregator:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::diagnostics::DevicePropertyAggregator:
Collaboration graph
[legend]

Public Member Functions

DevicePropertyAggregatorInterface
avsCommon::utils::Optional< std::string > getDeviceProperty (const std::string &propertyKey) override
 
std::unordered_map< std::string, std::string > getAllDeviceProperties () override
 
void setContextManager (std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager) override
 
void setDeviceSettingsManager (std::shared_ptr< settings::DeviceSettingsManager > settingManager) override
 
void initializeVolume (std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > speakerManager) override
 
AlertObserverInterface Functions
void onAlertStateChange (const AlertObserverInterface::AlertInfo &alertInfo) override
 
AuthObserverInterface Functions
virtual void onAuthStateChange (AuthObserverInterface::State newState, AuthObserverInterface::Error error) override
 
AudioPlayerObserverInterface Functions
void onPlayerActivityChanged (avsCommon::avs::PlayerActivity state, const Context &context) override
 
ConnectionStatusObserverInterface Functions
void onConnectionStatusChanged (const Status status, const ChangedReason reason) override
 
ContextRequesterInterface Functions
void onContextAvailable (const std::string &jsonContext) override
 
void onContextFailure (const avsCommon::sdkInterfaces::ContextRequestError error) override
 
NotificationsObserverInterface Functions
void onSetIndicator (avsCommon::avs::IndicatorState state) override
 
void onNotificationReceived () override
 
SpeakerManagerObserverInterface Functions
void onSpeakerSettingsChanged (const Source &source, const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type &type, const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings &settings) override
 
DialogUXStateObserverInterface Functions
void onDialogUXStateChanged (DialogUXState newState) override
 
RangeControllerObserverInterface Functions
void onRangeChanged (const avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface::RangeState &rangeState, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
PowerControllerObserverInterface Functions
void onPowerStateChanged (const avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface::PowerState &powerState, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::DevicePropertyAggregatorInterface
virtual void setContextManager (std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager)=0
 
virtual void initializeVolume (std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > speakerManager)=0
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlertsInterfaces::AlertObserverInterface
virtual ~AlertObserverInterface ()=default
 
virtual void onAlertStateChange (const AlertInfo &alertInfo)=0
 
- Public Member Functions inherited from alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface
virtual ~AudioPlayerObserverInterface ()=default
 
virtual void onSeekActivity (const SeekStatus seekStatus, const Context &context)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
virtual ~AuthObserverInterface ()=default
 
virtual void onAuthStateChange (State newState, Error error)=0
 
- 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::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- Public Member Functions inherited from alexaClientSDK::acsdkNotificationsInterfaces::NotificationsObserverInterface
virtual ~NotificationsObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface
virtual ~SpeakerManagerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
virtual ~DialogUXStateObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface
virtual ~RangeControllerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface
virtual ~PowerControllerObserverInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< DevicePropertyAggregatorcreate ()
 
- 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)
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
static std::string stateToString (DialogUXState state)
 

Additional Inherited Members

- 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 }
 
- Public Types inherited from alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface
enum  SeekStatus { SeekStatus::SEEK_START, SeekStatus::SEEK_COMPLETE }
 Enum representing Seek activities. More...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
enum  State {
  State::UNINITIALIZED, State::REFRESHED, State::EXPIRED, State::UNRECOVERABLE_ERROR,
  State::AUTHORIZING
}
 The enum State describes the state of authorization. More...
 
enum  Error {
  Error::SUCCESS, Error::UNKNOWN_ERROR, Error::AUTHORIZATION_FAILED, Error::UNAUTHORIZED_CLIENT,
  Error::SERVER_ERROR, Error::INVALID_REQUEST, Error::INVALID_VALUE, Error::AUTHORIZATION_EXPIRED,
  Error::UNSUPPORTED_GRANT_TYPE, Error::INVALID_CODE_PAIR, Error::AUTHORIZATION_PENDING, Error::SLOW_DOWN,
  Error::INTERNAL_ERROR, Error::INVALID_CBL_CLIENT_ID
}
 The enum Error encodes possible errors which may occur when changing state. More...
 
- 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::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...
 
- Static Public Attributes inherited from alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::DevicePropertyAggregatorInterface
static constexpr const char * DEVICE_CONTEXT = "DeviceContext"
 Property Key to get Device Context. The Property Value is the json string containing the device context. More...
 
static constexpr const char * ALERT_TYPE_AND_STATE = "AlertTypeAndState"
 Property Key for Alerts state. The Property Value is a string of format "Alert:State". Ex: "ALARM:STARTED". More...
 
static constexpr const char * AUDIO_PLAYER_STATE = "AudioPlayerState"
 
static constexpr const char * CONTENT_ID = "ContentId"
 Property Key for Audio Player Content ID. The Property Value is a content ID string. More...
 
static constexpr const char * CONNECTION_STATE = "ConnectionState"
 Property Key for Connection State. The Property Value is a string representing connection state. Ex: "CONNECTED". More...
 
static constexpr const char * NOTIFICATION_INDICATOR = "NotificationIndicator"
 
static constexpr const char * TTS_PLAYER_STATE = "TTSPlayerState"
 Property Key for TTS Player State. The Property Value is a string representing the TTS state. Ex: "THINKING". More...
 
static constexpr const char * AVS_SPEAKER_VOLUME = "AVSSpeakerVolume"
 Property Key for AVS Speaker Volume. The Property Value is a string representing the speaker volume. Ex: "25". More...
 
static constexpr const char * AVS_SPEAKER_MUTE = "AVSSpeakerMute"
 
static constexpr const char * AVS_ALERTS_VOLUME = "AVSAlertsVolume"
 Property Key for AVS Alerts Volume. The Property Value is a string representing the alerts volume. Ex: "50". More...
 
static constexpr const char * AVS_ALERTS_MUTE = "AVSAlertsMute"
 
static constexpr const char * DO_NOT_DISTURB = "DoNotDisturb"
 
static constexpr const char * LOCALE = "Locale"
 
static constexpr const char * WAKE_WORDS = "WakeWords"
 
static constexpr const char * REGISTRATION_STATUS = "RegistrationStatus"
 
static constexpr const char * RANGE_CONTROLLER_STATUS = "RangeControllerStatus"
 
static constexpr const char * POWER_CONTROLLER_STATUS = "PowerControllerStatus"
 
- 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...
 

Detailed Description

Utility class to query for Device Properties.

Member Function Documentation

◆ create()

static std::shared_ptr<DevicePropertyAggregator> alexaClientSDK::diagnostics::DevicePropertyAggregator::create ( )
static

Creates a new DevicePropertyAggregator.

Returns
a new instance of DevicePropertyAggregator.

◆ getAllDeviceProperties()

std::unordered_map<std::string, std::string> alexaClientSDK::diagnostics::DevicePropertyAggregator::getAllDeviceProperties ( )
overridevirtual

This method returns a list of all properties.

Returns
A map of all properties.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::DevicePropertyAggregatorInterface.

◆ getDeviceProperty()

avsCommon::utils::Optional<std::string> alexaClientSDK::diagnostics::DevicePropertyAggregator::getDeviceProperty ( const std::string &  propertyKey)
overridevirtual

Gets the property for the given property key.

Parameters
propertyKeyThe property key string.
Returns
The property value as an Optional.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::DevicePropertyAggregatorInterface.

◆ initializeVolume()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::initializeVolume ( std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface speakerManager)
override

◆ onAlertStateChange()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onAlertStateChange ( const AlertObserverInterface::AlertInfo &  alertInfo)
override

◆ onAuthStateChange()

virtual void alexaClientSDK::diagnostics::DevicePropertyAggregator::onAuthStateChange ( AuthObserverInterface::State  newState,
AuthObserverInterface::Error  error 
)
overridevirtual

◆ onConnectionStatusChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::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.

◆ onContextAvailable()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onContextAvailable ( const std::string &  jsonContext)
overridevirtual

This is called by the ContextManager once the context is ready and available.

Deprecated:
This method is being deprecated since it cannot specify the source endpoint.
Note
The ContextRequester should perform minimum processing and return quickly. Otherwise it will block the processing of updating the of other ContextProviders.
Parameters
jsonContextContext information.Context provided is of the format {"context"[{...}, {...}]}

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface.

◆ onContextFailure()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onContextFailure ( const avsCommon::sdkInterfaces::ContextRequestError  error)
overridevirtual

The contextManager calls this if it is unable to process a getContext request successfully.

Deprecated:
This method is being deprecated since it cannot specify the optional token.
Note
The ContextRequester should perform minimum processing and return quickly. Otherwise it will block the processing of updating the of other ContextProviders.
Parameters
errorThe reason why the getContext request failed.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface.

◆ onDialogUXStateChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onDialogUXStateChanged ( 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.

◆ onNotificationReceived()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onNotificationReceived ( )
overridevirtual

Notifies the observer that a new notification has been received. This is called repeatedly for duplicate notifications.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsObserverInterface.

◆ onPlayerActivityChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onPlayerActivityChanged ( avsCommon::avs::PlayerActivity  state,
const Context context 
)
overridevirtual

Used to notify the observer when the AudioPlayer has a change in PlayerActivity.

Parameters
stateThe PlayerActivity of the AudioPlayer.
contextThe Context of the AudioPlayer.

Implements alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface.

◆ onPowerStateChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onPowerStateChanged ( const avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface::PowerState powerState,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

Notifies the change in the power state property of the endpoint.

Parameters
powerStateThe power state specified using PowerState.
causeThe cause for this change specified using AlexaStateChangeCauseType.

Implements alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface.

◆ onRangeChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onRangeChanged ( const avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface::RangeState rangeState,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

Notifies the change in the range value of the endpoint.

Parameters
rangeStateThe toggle state specified using RangeState.
causeThe cause for this change specified using AlexaStateChangeCauseType.

Implements alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface.

◆ onSetIndicator()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::onSetIndicator ( avsCommon::avs::IndicatorState  state)
overridevirtual

Notifies the observer that a SetIndicator directive has been processed

Parameters
stateThe value of the persistVisualIndicator field of the directive.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsObserverInterface.

◆ onSpeakerSettingsChanged()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::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.

◆ setContextManager()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::setContextManager ( std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface contextManager)
override

◆ setDeviceSettingsManager()

void alexaClientSDK::diagnostics::DevicePropertyAggregator::setDeviceSettingsManager ( std::shared_ptr< settings::DeviceSettingsManager settingManager)
overridevirtual

Set the DeviceSettingsManager

Parameters
settingManagerthe DeviceSettingsManager

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::DevicePropertyAggregatorInterface.


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