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

#include <DefaultClient.h>

Inheritance diagram for alexaClientSDK::defaultClient::DefaultClient:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::defaultClient::DefaultClient:
Collaboration graph
[legend]

Public Member Functions

void connect (bool performReset=true)
 
void disconnect ()
 
std::string getAVSGateway ()
 
void stopForegroundActivity ()
 
void stopAllActivities ()
 
void localStopActiveAlert ()
 
void addAlexaDialogStateObserver (std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface > observer)
 
void removeAlexaDialogStateObserver (std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface > observer)
 
void addMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)
 
void removeMessageObserver (std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface > observer)
 
void addConnectionObserver (std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface > observer)
 
void removeConnectionObserver (std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface > observer)
 
void addInternetConnectionObserver (std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionObserverInterface > observer)
 
void removeInternetConnectionObserver (std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionObserverInterface > observer)
 
void addAlertsObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer)
 
void removeAlertsObserver (std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface > observer)
 
void addAudioPlayerObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer)
 
void removeAudioPlayerObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer)
 
void addTemplateRuntimeObserver (std::shared_ptr< avsCommon::sdkInterfaces::TemplateRuntimeObserverInterface > observer)
 
void removeTemplateRuntimeObserver (std::shared_ptr< avsCommon::sdkInterfaces::TemplateRuntimeObserverInterface > observer)
 
void TemplateRuntimeDisplayCardCleared ()
 
void addNotificationsObserver (std::shared_ptr< acsdkNotificationsInterfaces::NotificationsObserverInterface > observer)
 
void removeNotificationsObserver (std::shared_ptr< acsdkNotificationsInterfaces::NotificationsObserverInterface > observer)
 
void addExternalMediaPlayerObserver (std::shared_ptr< avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaPlayerObserverInterface > observer)
 
void removeExternalMediaPlayerObserver (std::shared_ptr< avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaPlayerObserverInterface > observer)
 
void addBluetoothDeviceObserver (std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface > observer)
 
void removeBluetoothDeviceObserver (std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface > observer)
 
void addCaptionPresenter (std::shared_ptr< captions::CaptionPresenterInterface > presenter)
 
void setCaptionMediaPlayers (const std::vector< std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface >> &mediaPlayers)
 
std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterfacegetPlaybackRouter () const
 
void addSpeakerManagerObserver (std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerObserverInterface > observer)
 
void removeSpeakerManagerObserver (std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerObserverInterface > observer)
 
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterfacegetSpeakerManager ()
 
void addSpeechSynthesizerObserver (std::shared_ptr< avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface > observer)
 
void removeSpeechSynthesizerObserver (std::shared_ptr< avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface > observer)
 
std::shared_ptr< registrationManager::RegistrationManagergetRegistrationManager ()
 
std::shared_ptr< equalizer::EqualizerControllergetEqualizerController ()
 
void addEqualizerControllerListener (std::shared_ptr< avsCommon::sdkInterfaces::audio::EqualizerControllerListenerInterface > listener)
 
void removeEqualizerControllerListener (std::shared_ptr< avsCommon::sdkInterfaces::audio::EqualizerControllerListenerInterface > listener)
 
void addContextManagerObserver (std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerObserverInterface > observer)
 
void removeContextManagerObserver (std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerObserverInterface > observer)
 
bool setFirmwareVersion (avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface
virtual ~SpeechInteractionHandlerInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< DefaultClientcreate (std::shared_ptr< avsCommon::utils::DeviceInfo > deviceInfo, std::shared_ptr< registrationManager::CustomerDataManager > customerDataManager, const std::unordered_map< std::string, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface >> &externalMusicProviderMediaPlayers, const std::unordered_map< std::string, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >> &externalMusicProviderSpeakers, const capabilityAgents::externalMediaPlayer::ExternalMediaPlayer::AdapterCreationMap &adapterCreationMap, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > speakMediaPlayer, std::unique_ptr< avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface > audioMediaPlayerFactory, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > alertsMediaPlayer, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > notificationsMediaPlayer, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > bluetoothMediaPlayer, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > ringtoneMediaPlayer, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > systemSoundMediaPlayer, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > speakSpeaker, std::vector< std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >> audioSpeakers, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > alertsSpeaker, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > notificationsSpeaker, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > bluetoothSpeaker, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > ringtoneSpeaker, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > systemSoundSpeaker, const std::multimap< avsCommon::sdkInterfaces::ChannelVolumeInterface::Type, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >> additionalSpeakers, std::shared_ptr< EqualizerRuntimeSetup > equalizerRuntimeSetup, std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > audioFactory, std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > authDelegate, std::shared_ptr< acsdkAlerts::storage::AlertStorageInterface > alertStorage, std::shared_ptr< certifiedSender::MessageStorageInterface > messageStorage, std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > notificationsStorage, std::unique_ptr< settings::storage::DeviceSettingStorageInterface > deviceSettingStorage, std::shared_ptr< acsdkBluetooth::BluetoothStorageInterface > bluetoothStorage, std::shared_ptr< avsCommon::sdkInterfaces::storage::MiscStorageInterface > miscStorage, std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface >> alexaDialogStateObservers, std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface >> connectionObservers, std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface > internetConnectionMonitor, bool isGuiSupported, std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesDelegateInterface > capabilitiesDelegate, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< alexaClientSDK::acl::TransportFactoryInterface > transportFactory, std::shared_ptr< avsCommon::sdkInterfaces::AVSGatewayManagerInterface > avsGatewayManager, std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface > localeAssetsManager, std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface >> enabledConnectionRules=std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface >>(), std::shared_ptr< avsCommon::sdkInterfaces::SystemTimeZoneInterface > systemTimezone=nullptr, avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion=avsCommon::sdkInterfaces::softwareInfo::INVALID_FIRMWARE_VERSION, bool sendSoftwareInfoOnConnected=false, std::shared_ptr< avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface > softwareInfoSenderObserver=nullptr, std::unique_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface > bluetoothDeviceManager=nullptr, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr, std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface > powerResourceManager=nullptr, std::shared_ptr< avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface > diagnostics=nullptr, const std::shared_ptr< ExternalCapabilitiesBuilderInterface > &externalCapabilitiesBuilder=nullptr, std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeFactoryInterface > channelVolumeFactory=std::make_shared< alexaClientSDK::capabilityAgents::speakerManager::DefaultChannelVolumeFactory >(), bool startAlertSchedulingOnInitialization=true, std::shared_ptr< alexaClientSDK::acl::MessageRouterFactoryInterface > messageRouterFactory=std::make_shared< alexaClientSDK::acl::MessageRouterFactory >())
 

SpeechInteractionHandlerInterface Methods

std::future< bool > notifyOfWakeWord (capabilityAgents::aip::AudioProvider wakeWordAudioProvider, avsCommon::avs::AudioInputStream::Index beginIndex, avsCommon::avs::AudioInputStream::Index endIndex, std::string keyword, std::chrono::steady_clock::time_point startOfSpeechTimestamp, std::shared_ptr< const std::vector< char >> KWDMetadata=nullptr) override
 
std::future< bool > notifyOfTapToTalk (capabilityAgents::aip::AudioProvider tapToTalkAudioProvider, avsCommon::avs::AudioInputStream::Index beginIndex=capabilityAgents::aip::AudioInputProcessor::INVALID_INDEX, std::chrono::steady_clock::time_point startOfSpeechTimestamp=std::chrono::steady_clock::now()) override
 
std::future< bool > notifyOfHoldToTalkStart (capabilityAgents::aip::AudioProvider holdToTalkAudioProvider, std::chrono::steady_clock::time_point startOfSpeechTimestamp=std::chrono::steady_clock::now()) override
 
std::future< bool > notifyOfHoldToTalkEnd () override
 
std::future< bool > notifyOfTapToTalkEnd () override
 
std::shared_ptr< settings::DeviceSettingsManagergetSettingsManager ()
 } More...
 
std::unique_ptr< avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterfacecreateEndpointBuilder ()
 
std::future< endpoints::EndpointRegistrationManager::RegistrationResultregisterEndpoint (std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointInterface > endpoint)
 
std::future< endpoints::EndpointRegistrationManager::DeregistrationResultderegisterEndpoint (avsCommon::sdkInterfaces::endpoints::EndpointIdentifier endpointId)
 
std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterfacegetDefaultEndpointBuilder ()
 
void addCallStateObserver (std::shared_ptr< avsCommon::sdkInterfaces::CallStateObserverInterface > observer)
 
void removeCallStateObserver (std::shared_ptr< avsCommon::sdkInterfaces::CallStateObserverInterface > observer)
 
bool isCommsEnabled ()
 
void acceptCommsCall ()
 
void sendDtmf (avsCommon::sdkInterfaces::CallManagerInterface::DTMFTone dtmfTone)
 
void stopCommsCall ()
 
void audioPlayerLocalStop ()
 
bool isCommsCallMuted ()
 
void muteCommsCall ()
 
void unmuteCommsCall ()
 
void onSystemClockSynchronized ()
 
 ~DefaultClient ()
 

Detailed Description

This class serves to instantiate each default component with of the SDK with no specializations to provide an "out-of-box" component that users may utilize for AVS interaction.

Constructor & Destructor Documentation

◆ ~DefaultClient()

alexaClientSDK::defaultClient::DefaultClient::~DefaultClient ( )

Destructor.

Member Function Documentation

◆ acceptCommsCall()

void alexaClientSDK::defaultClient::DefaultClient::acceptCommsCall ( )

Accepts an incoming phone-call.

◆ addAlertsObserver()

void alexaClientSDK::defaultClient::DefaultClient::addAlertsObserver ( std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface observer)

Adds an observer to be notified of alert state changes.

Parameters
observerThe observer to add.

◆ addAlexaDialogStateObserver()

void alexaClientSDK::defaultClient::DefaultClient::addAlexaDialogStateObserver ( std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface observer)

Adds an observer to be notified of Alexa dialog related UX state.

Parameters
observerThe observer to add.

◆ addAudioPlayerObserver()

void alexaClientSDK::defaultClient::DefaultClient::addAudioPlayerObserver ( std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface observer)

Adds an observer to be notified of AudioPlayer state changes. This can be used to be be notified of the PlayerActivity of the AudioPlayer.

Parameters
observerThe observer to add.

◆ addBluetoothDeviceObserver()

void alexaClientSDK::defaultClient::DefaultClient::addBluetoothDeviceObserver ( std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface observer)

Adds an observer to be notified of bluetooth device changes.

Parameters
observerThe BluetoothDeviceObserverInterface to add.

◆ addCallStateObserver()

void alexaClientSDK::defaultClient::DefaultClient::addCallStateObserver ( std::shared_ptr< avsCommon::sdkInterfaces::CallStateObserverInterface observer)

Adds an observer to be notified when the call state has changed.

Parameters
observerThe observer to add.

◆ addCaptionPresenter()

void alexaClientSDK::defaultClient::DefaultClient::addCaptionPresenter ( std::shared_ptr< captions::CaptionPresenterInterface presenter)

Adds a presenter responsible for displaying formatted captions content.

Parameters
presenterThe CaptionPresenterInterface to add.

◆ addConnectionObserver()

void alexaClientSDK::defaultClient::DefaultClient::addConnectionObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface observer)

Adds an observer to be notified of connection status changes.

Parameters
observerThe observer to add.

◆ addContextManagerObserver()

void alexaClientSDK::defaultClient::DefaultClient::addContextManagerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerObserverInterface observer)

Adds a ContextManagerObserver to be notified of Context state changes.

Parameters
observerThe observer to be notified of Context state changes.

◆ addEqualizerControllerListener()

void alexaClientSDK::defaultClient::DefaultClient::addEqualizerControllerListener ( std::shared_ptr< avsCommon::sdkInterfaces::audio::EqualizerControllerListenerInterface listener)

Adds a EqualizerControllerListener to be notified of Equalizer state changes.

Parameters
listenerThe listener to be notified of Equalizer state changes.

◆ addExternalMediaPlayerObserver()

void alexaClientSDK::defaultClient::DefaultClient::addExternalMediaPlayerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaPlayerObserverInterface observer)

Adds an observer to be notified of ExternalMediaPlayer changes

Parameters
observerThe observer to add.

◆ addInternetConnectionObserver()

void alexaClientSDK::defaultClient::DefaultClient::addInternetConnectionObserver ( std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionObserverInterface observer)

Adds an observer to be notified of internet connection status changes.

Parameters
observerThe observer to add.

◆ addMessageObserver()

void alexaClientSDK::defaultClient::DefaultClient::addMessageObserver ( std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface observer)

Adds an observer to be notified when a message arrives from AVS.

Parameters
observerThe observer to add.

◆ addNotificationsObserver()

void alexaClientSDK::defaultClient::DefaultClient::addNotificationsObserver ( std::shared_ptr< acsdkNotificationsInterfaces::NotificationsObserverInterface observer)

Adds an observer to be notified of IndicatorState changes.

Parameters
observerThe observer to add.

◆ addSpeakerManagerObserver()

void alexaClientSDK::defaultClient::DefaultClient::addSpeakerManagerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerObserverInterface observer)

Adds a SpeakerManagerObserver to be alerted when the volume and mute changes.

Parameters
observerThe observer to be notified upon volume and mute changes.

◆ addSpeechSynthesizerObserver()

void alexaClientSDK::defaultClient::DefaultClient::addSpeechSynthesizerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface observer)

Adds a SpeechSynthesizerObserver to be alerted on SpeechSynthesizer state changes

Parameters
observerThe observer to be notified upon the state change

◆ addTemplateRuntimeObserver()

void alexaClientSDK::defaultClient::DefaultClient::addTemplateRuntimeObserver ( std::shared_ptr< avsCommon::sdkInterfaces::TemplateRuntimeObserverInterface observer)

Adds an observer to be notified when a TemplateRuntime directive is received.

Parameters
observerThe observer to add.

◆ audioPlayerLocalStop()

void alexaClientSDK::defaultClient::DefaultClient::audioPlayerLocalStop ( )

This function stops playback of the current song in the AudioPlayer.

◆ connect()

void alexaClientSDK::defaultClient::DefaultClient::connect ( bool  performReset = true)

Connects the client to AVS. After this call, users can observe the state of the connection asynchronously by using a connectionObserver that was passed in to the create() function.

Parameters
performResetTrue if the client wishes to reset the AVS gateway and clear the previous user's registration status as well on connection.

◆ create()

std::unique_ptr< DefaultClient > alexaClientSDK::defaultClient::DefaultClient::create ( std::shared_ptr< avsCommon::utils::DeviceInfo deviceInfo,
std::shared_ptr< registrationManager::CustomerDataManager customerDataManager,
const std::unordered_map< std::string, std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface >> &  externalMusicProviderMediaPlayers,
const std::unordered_map< std::string, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >> &  externalMusicProviderSpeakers,
const capabilityAgents::externalMediaPlayer::ExternalMediaPlayer::AdapterCreationMap adapterCreationMap,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface speakMediaPlayer,
std::unique_ptr< avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface audioMediaPlayerFactory,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface alertsMediaPlayer,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface notificationsMediaPlayer,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface bluetoothMediaPlayer,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface ringtoneMediaPlayer,
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface systemSoundMediaPlayer,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface speakSpeaker,
std::vector< std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >>  audioSpeakers,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface alertsSpeaker,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface notificationsSpeaker,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface bluetoothSpeaker,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface ringtoneSpeaker,
std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface systemSoundSpeaker,
const std::multimap< avsCommon::sdkInterfaces::ChannelVolumeInterface::Type, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface >>  additionalSpeakers,
std::shared_ptr< EqualizerRuntimeSetup equalizerRuntimeSetup,
std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface audioFactory,
std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface authDelegate,
std::shared_ptr< acsdkAlerts::storage::AlertStorageInterface alertStorage,
std::shared_ptr< certifiedSender::MessageStorageInterface messageStorage,
std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface notificationsStorage,
std::unique_ptr< settings::storage::DeviceSettingStorageInterface deviceSettingStorage,
std::shared_ptr< acsdkBluetooth::BluetoothStorageInterface bluetoothStorage,
std::shared_ptr< avsCommon::sdkInterfaces::storage::MiscStorageInterface miscStorage,
std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface >>  alexaDialogStateObservers,
std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface >>  connectionObservers,
std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface internetConnectionMonitor,
bool  isGuiSupported,
std::shared_ptr< avsCommon::sdkInterfaces::CapabilitiesDelegateInterface capabilitiesDelegate,
std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface contextManager,
std::shared_ptr< alexaClientSDK::acl::TransportFactoryInterface transportFactory,
std::shared_ptr< avsCommon::sdkInterfaces::AVSGatewayManagerInterface avsGatewayManager,
std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface localeAssetsManager,
std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface >>  enabledConnectionRules = std::unordered_set< std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface>>(),
std::shared_ptr< avsCommon::sdkInterfaces::SystemTimeZoneInterface systemTimezone = nullptr,
avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion = avsCommon::sdkInterfaces::softwareInfo::INVALID_FIRMWARE_VERSION,
bool  sendSoftwareInfoOnConnected = false,
std::shared_ptr< avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface softwareInfoSenderObserver = nullptr,
std::unique_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface bluetoothDeviceManager = nullptr,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr,
std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface powerResourceManager = nullptr,
std::shared_ptr< avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface diagnostics = nullptr,
const std::shared_ptr< ExternalCapabilitiesBuilderInterface > &  externalCapabilitiesBuilder = nullptr,
std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeFactoryInterface channelVolumeFactory = std::make_shared<alexaClientSDK::capabilityAgents::speakerManager::DefaultChannelVolumeFactory>(),
bool  startAlertSchedulingOnInitialization = true,
std::shared_ptr< alexaClientSDK::acl::MessageRouterFactoryInterface messageRouterFactory = std::make_shared<alexaClientSDK::acl::MessageRouterFactory>() 
)
static

Creates and initializes a default AVS SDK client. To connect the client to AVS, users should make a call to connect() after creation.

Parameters
deviceInfoDeviceInfo which reflects the device setup credentials.
customerDataManagerCustomerDataManager instance to be used by RegistrationManager and instances of all classes extending CustomDataHandler.
externalMusicProviderMediaPlayersThe map of <players, mediaPlayer> to use to play content from each external music provider.
externalMusicProviderSpeakersThe map of <players, speaker> to use to track volume of each external music provider media player.
adapterCreationMapThe map of <players, adapterCreationMethod> to use when creating the adapters for the different music providers supported by ExternalMediaPlayer.
speakMediaPlayerThe media player to use to play Alexa speech from.
audioMediaPlayerFactoryThe media player factory to use to generate players for Alexa audio content.
alertsMediaPlayerThe media player to use to play alerts from.
notificationsMediaPlayerThe media player to play notification indicators.
bluetoothMediaPlayerThe media player to play bluetooth content.
ringtoneMediaPlayerThe media player to play Comms ringtones.
systemSoundMediaPlayerThe media player to play system sounds.
speakSpeakerThe speaker to control volume of Alexa speech.
audioSpeakersA list of speakers to control volume of Alexa audio content.
alertsSpeakerThe speaker to control volume of alerts.
notificationsSpeakerThe speaker to control volume of notifications.
bluetoothSpeakerThe speaker to control volume of bluetooth.
ringtoneSpeakerThe speaker to control volume of Comms ringtones.
systemSoundSpeakerThe speaker to control volume of system sounds.
additionalSpeakersA map of additional speakers to receive volume changes. #ifdef ENABLE_COMMS_AUDIO_PROXY
commsMediaPlayerThe media player to play Comms calling audio.
commsSpeakerThe speaker to control volume of Comms calling audio.
sharedDataStreamThe stream to use which has the audio from microphone. #endif
equalizerRuntimeSetupEqualizer component runtime setup
audioFactoryThe audioFactory is a component that provides unique audio streams.
authDelegateThe component that provides the client with valid LWA authorization.
alertStorageThe storage interface that will be used to store alerts.
messageStorageThe storage interface that will be used to store certified sender messages.
notificationsStorageThe storage interface that will be used to store notification indicators.
deviceSettingStorageThe storage interface that will be used to store device settings.
bluetoothStorageThe storage interface that will be used to store bluetooth data.
miscStorageThe storage interface that will be used to store key / value pairs.
alexaDialogStateObserversObservers that can be used to be notified of Alexa dialog related UX state changes.
connectionObserversObservers that can be used to be notified of connection status changes.
isGuiSupportedWhether the device supports GUI.
capabilitiesDelegateThe component that provides the client with the ability to send messages to the Capabilities API.
contextManagerThe ContextManager which will provide the context for various components.
transportFactoryThe object passed in here will be used whenever a new transport object for AVS communication is needed.
avsGatewayManagerThe AVSGatewayManager instance used to create the ApiGateway CA.
localeAssetsManagerThe device locale assets manager.
enabledConnectionRulesThe set of BluetoothDeviceConnectionRuleInterface instances used to create the Bluetooth CA.
systemTimezoneOptional object used to set the system timezone.
firmwareVersionThe firmware version to report to AVS or INVALID_FIRMWARE_VERSION.
sendSoftwareInfoOnConnectedWhether to send SoftwareInfo upon connecting to AVS.
softwareInfoSenderObserverObject to receive notifications about sending SoftwareInfo.
bluetoothDeviceManagerThe BluetoothDeviceManager instance used to create the Bluetooth CA.
metricRecorderThe metric recorder object used to capture metrics.
powerResourceManagerObject to manage power resource.
diagnosticsDiagnostics interface which provides suite of APIs for diagnostic insight into SDK.
externalCapabilitiesBuilderOptional object used to build capabilities that are not included in the SDK.
channelVolumeFactoryOptional object used to build ChannelVolumeInterface in the SDK.
startAlertSchedulingOnInitializationWhether to start scheduling alerts after client initialization. If this is set to false, no alert scheduling will occur until onSystemClockSynchronized is called.
messageRouterFactoryObject used to instantiate MessageRouter in the SDK.
Returns
A std::unique_ptr to a DefaultClient if all went well or nullptr otherwise.

TODO: Allow the user to pass in a MediaPlayer factory rather than each media player individually.

◆ createEndpointBuilder()

std::unique_ptr< EndpointBuilderInterface > alexaClientSDK::defaultClient::DefaultClient::createEndpointBuilder ( )

Creates an endpoint builder which can be used to configure a new endpoint.

Note
Endpoints must be registered with the Endpoint Registration Manager to be controlled by the device.
Returns
An endpoint builder.

◆ deregisterEndpoint()

std::future< alexaClientSDK::endpoints::EndpointRegistrationManager::DeregistrationResult > alexaClientSDK::defaultClient::DefaultClient::deregisterEndpoint ( avsCommon::sdkInterfaces::endpoints::EndpointIdentifier  endpointId)

Deregisters an endpoint with the EndpointRegistrationManagerInterface.

Parameters
endpointIdThe EndpointIdentifier of the endpoint to deregister.
Returns
A future that will resolve to the DeregistratonResult for deregistering this endpoint.

◆ disconnect()

void alexaClientSDK::defaultClient::DefaultClient::disconnect ( )

Disconnects the client from AVS if it is connected. After the call, users can observer the state of the connection asynchronously by using a connectionObserver that was passed in to the create() function.

◆ getAVSGateway()

std::string alexaClientSDK::defaultClient::DefaultClient::getAVSGateway ( )

Get the gateway URL for the AVS connection.

Returns
The URL for the current AVS gateway.

◆ getDefaultEndpointBuilder()

std::shared_ptr< EndpointBuilderInterface > alexaClientSDK::defaultClient::DefaultClient::getDefaultEndpointBuilder ( )

Retrieves the builder for the default endpoint which contains all capabilities associated with this client.

This builder can be used to add extra capabilities to the default endpoint.

Returns
The default endpoint builder.
Warning
The default endpoint can only be configured before you call connect(). Adding new components after the client has been connected will fail.

◆ getEqualizerController()

std::shared_ptr< equalizer::EqualizerController > alexaClientSDK::defaultClient::DefaultClient::getEqualizerController ( )

Get a shared_ptr to the EqualizerController.

Note
Be sure to release all references to the returned EqualizerController before releasing the last reference to the DefaultClient.
Returns
shared_ptr to the EqualizerController.

◆ getPlaybackRouter()

std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterface > alexaClientSDK::defaultClient::DefaultClient::getPlaybackRouter ( ) const

◆ getRegistrationManager()

std::shared_ptr< registrationManager::RegistrationManager > alexaClientSDK::defaultClient::DefaultClient::getRegistrationManager ( )

Get a shared_ptr to the RegistrationManager.

Returns
shared_ptr to the RegistrationManager.

◆ getSettingsManager()

std::shared_ptr< settings::DeviceSettingsManager > alexaClientSDK::defaultClient::DefaultClient::getSettingsManager ( )

}

Retrieves the device settings manager which can be used to access device settings.

Returns
Pointer to the device settings manager.

◆ getSpeakerManager()

std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > alexaClientSDK::defaultClient::DefaultClient::getSpeakerManager ( )

Get a shared_ptr to the SpeakerManager.

Returns
shared_ptr to the SpeakerManager.

◆ isCommsCallMuted()

bool alexaClientSDK::defaultClient::DefaultClient::isCommsCallMuted ( )

Check if the Comms call is muted.

Returns
Whether the comms call is muted.

◆ isCommsEnabled()

bool alexaClientSDK::defaultClient::DefaultClient::isCommsEnabled ( )

Lets the caller know if Comms is enabled.

Returns
True if comms is enabled.

◆ localStopActiveAlert()

void alexaClientSDK::defaultClient::DefaultClient::localStopActiveAlert ( )

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.

◆ muteCommsCall()

void alexaClientSDK::defaultClient::DefaultClient::muteCommsCall ( )

Mute comms Call.

◆ notifyOfHoldToTalkEnd()

std::future< bool > alexaClientSDK::defaultClient::DefaultClient::notifyOfHoldToTalkEnd ( )
overridevirtual

Ends a hold to talk interaction by forcing the client to stop streaming audio data to the cloud and ending any currently ongoing recognize interactions.

Returns
A future indicating whether audio streaming was successfully stopped. This can be false if this was called in the wrong state.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface.

◆ notifyOfHoldToTalkStart()

std::future< bool > alexaClientSDK::defaultClient::DefaultClient::notifyOfHoldToTalkStart ( capabilityAgents::aip::AudioProvider  holdToTalkAudioProvider,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp = std::chrono::steady_clock::now() 
)
overridevirtual

Begins a hold to talk initiated Alexa interaction.

Parameters
holdToTalkAudioProviderThe audio provider containing the audio data stream along with its metadata.
startOfSpeechTimestampMoment in time when user started talking to Alexa. This parameter is optional and it is used to measure user perceived latency.
Returns
A future indicating whether the interaction was successfully started.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface.

◆ notifyOfTapToTalk()

std::future< bool > alexaClientSDK::defaultClient::DefaultClient::notifyOfTapToTalk ( capabilityAgents::aip::AudioProvider  tapToTalkAudioProvider,
avsCommon::avs::AudioInputStream::Index  beginIndex = capabilityAgents::aip::AudioInputProcessor::INVALID_INDEX,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp = std::chrono::steady_clock::now() 
)
overridevirtual

Begins a tap to talk initiated Alexa interaction. Note that this can also be used for wake word engines that don't support providing both a begin and end index.

Parameters
tapToTalkAudioProviderThe audio provider containing the audio data stream along with its metadata.
beginIndexAn optional parameter indicating where in the stream to start reading from.
startOfSpeechTimestampMoment in time when user started talking to Alexa. This parameter is optional and it is used to measure user perceived latency. INVALID_INDEX may be used to explicitly communicate that there is no wake work.
Returns
A future indicating whether the interaction was successfully started.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface.

◆ notifyOfTapToTalkEnd()

std::future< bool > alexaClientSDK::defaultClient::DefaultClient::notifyOfTapToTalkEnd ( )
overridevirtual

Ends a tap to talk interaction by forcing the client to stop streaming audio data to the cloud and ending any currently ongoing recognize interactions.

Returns
A future indicating whether audio streaming was successfully stopped. This can be false if this was called in the wrong state.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface.

◆ notifyOfWakeWord()

std::future< bool > alexaClientSDK::defaultClient::DefaultClient::notifyOfWakeWord ( capabilityAgents::aip::AudioProvider  wakeWordAudioProvider,
avsCommon::avs::AudioInputStream::Index  beginIndex,
avsCommon::avs::AudioInputStream::Index  endIndex,
std::string  keyword,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp,
std::shared_ptr< const std::vector< char >>  KWDMetadata = nullptr 
)
overridevirtual

Begins a wake word initiated Alexa interaction.

Parameters
wakeWordAudioProviderThe audio provider containing the audio data stream along with its metadata.
beginIndexThe begin index of the keyword found within the stream.
endIndexThe end index of the keyword found within the stream.
keywordThe keyword that was detected.
KWDMetadataWake word engine metadata.
startOfSpeechTimestampMoment in time when user started talking to Alexa.
Returns
A future indicating whether the interaction was successfully started.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface.

◆ onSystemClockSynchronized()

void alexaClientSDK::defaultClient::DefaultClient::onSystemClockSynchronized ( )

◆ registerEndpoint()

std::future< alexaClientSDK::endpoints::EndpointRegistrationManager::RegistrationResult > alexaClientSDK::defaultClient::DefaultClient::registerEndpoint ( std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointInterface endpoint)

Registers an endpoint with the EndpointRegistrationManagerInterface.

Parameters
endpointA pointer to the EndpointInterface to be registered.
Returns
A future that will resolve to the RegistrationResult for registering this endpoint.

◆ removeAlertsObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeAlertsObserver ( std::shared_ptr< acsdkAlertsInterfaces::AlertObserverInterface observer)

Removes an observer to be notified of alert state changes.

Parameters
observerThe observer to remove.

◆ removeAlexaDialogStateObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeAlexaDialogStateObserver ( std::shared_ptr< avsCommon::sdkInterfaces::DialogUXStateObserverInterface observer)

Removes an observer to be notified of Alexa dialog related UX state.

Note
This is a synchronous call which can not be made by an observer callback. Attempting to call removeObserver() from DialogUXStateObserverInterface::onDialogUXStateChanged() will result in a deadlock.
Parameters
observerThe observer to remove.

◆ removeAudioPlayerObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeAudioPlayerObserver ( std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface observer)

Removes an observer to be notified of AudioPlayer state changes.

Parameters
observerThe observer to remove.

◆ removeBluetoothDeviceObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeBluetoothDeviceObserver ( std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface observer)

Removes an observer to be notified of bluetooth device changes.

Parameters
observerThe BluetoothDeviceObserverInterface to remove.

◆ removeCallStateObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeCallStateObserver ( std::shared_ptr< avsCommon::sdkInterfaces::CallStateObserverInterface observer)

Removes an observer to be notified when the call state has changed.

Parameters
observerThe observer to remove.

◆ removeConnectionObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeConnectionObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ConnectionStatusObserverInterface observer)

Removes an observer to be notified of connection status changes.

Parameters
observerThe observer to remove.

◆ removeContextManagerObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeContextManagerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerObserverInterface observer)

Removes a ContextManagerObserver to be notified of Context state changes.

Parameters
observerThe observer to no longer be notified of Context state changes.

◆ removeEqualizerControllerListener()

void alexaClientSDK::defaultClient::DefaultClient::removeEqualizerControllerListener ( std::shared_ptr< avsCommon::sdkInterfaces::audio::EqualizerControllerListenerInterface listener)

Removes a EqualizerControllerListener to be notified of Equalizer state changes.

Parameters
listenerThe listener to no longer be notified of Equalizer state changes.

◆ removeExternalMediaPlayerObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeExternalMediaPlayerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::externalMediaPlayer::ExternalMediaPlayerObserverInterface observer)

Removes an observer to be notified of ExternalMediaPlayer changes.

Parameters
observerThe observer to remove.

◆ removeInternetConnectionObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeInternetConnectionObserver ( std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionObserverInterface observer)

Removes an observer to be notified of internet connection status changes.

Parameters
observerThe observer to remove.

◆ removeMessageObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeMessageObserver ( std::shared_ptr< avsCommon::sdkInterfaces::MessageObserverInterface observer)

Removes an observer to be notified when a message arrives from AVS.

Parameters
observerThe observer to remove.

◆ removeNotificationsObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeNotificationsObserver ( std::shared_ptr< acsdkNotificationsInterfaces::NotificationsObserverInterface observer)

Removes an observer to be notified of IndicatorState changes.

Parameters
observerThe observer to remove.

◆ removeSpeakerManagerObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeSpeakerManagerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerObserverInterface observer)

Removes a SpeakerManagerObserver from being alerted when the volume and mute changes.

Parameters
observerThe observer to be notified upon volume and mute changes.

◆ removeSpeechSynthesizerObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeSpeechSynthesizerObserver ( std::shared_ptr< avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface observer)

Removes a SpeechSynthesizerObserver from being alerted on SpeechSynthesizer state changes

Parameters
observerThe observer to be removed

◆ removeTemplateRuntimeObserver()

void alexaClientSDK::defaultClient::DefaultClient::removeTemplateRuntimeObserver ( std::shared_ptr< avsCommon::sdkInterfaces::TemplateRuntimeObserverInterface observer)

Removes an observer to be notified when a TemplateRuntime directive is received.

Parameters
observerThe observer to remove.

◆ sendDtmf()

void alexaClientSDK::defaultClient::DefaultClient::sendDtmf ( avsCommon::sdkInterfaces::CallManagerInterface::DTMFTone  dtmfTone)

Send dtmf tones during the call.

Parameters
dtmfToneThe signal of the dtmf message.

◆ setCaptionMediaPlayers()

void alexaClientSDK::defaultClient::DefaultClient::setCaptionMediaPlayers ( const std::vector< std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface >> &  mediaPlayers)

Sets the media players that can produce or control captioned content.

Parameters
mediaPlayersThe MediaPlayerInterface instances to add.

◆ setFirmwareVersion()

bool alexaClientSDK::defaultClient::DefaultClient::setFirmwareVersion ( avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion)

Update the firmware version.

Parameters
firmwareVersionThe new firmware version.
Returns
Whether the setting was accepted.

◆ stopAllActivities()

void alexaClientSDK::defaultClient::DefaultClient::stopAllActivities ( )

Stops all active channels/activities if there are any(has acquired focus atleast once). This acts as a "stop" button that can be used to stop all ongoing activities. This call will block until all the activities has stopped. There is a possibility of race condition of some activity about to start when this API is invoked.

◆ stopCommsCall()

void alexaClientSDK::defaultClient::DefaultClient::stopCommsCall ( )

Stops a phone-call.

◆ stopForegroundActivity()

void alexaClientSDK::defaultClient::DefaultClient::stopForegroundActivity ( )

Stops the foreground activity if there is one. This acts as a "stop" button that can be used to stop an ongoing activity. This call will block until the foreground activity has stopped all user-observable activities.

◆ TemplateRuntimeDisplayCardCleared()

void alexaClientSDK::defaultClient::DefaultClient::TemplateRuntimeDisplayCardCleared ( )

Notify the TemplateRuntime Capability Agent that the display card is cleared from the screen.

◆ unmuteCommsCall()

void alexaClientSDK::defaultClient::DefaultClient::unmuteCommsCall ( )

Unmute Comms call.


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

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