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

#include <InteractionManager.h>

Inheritance diagram for alexaClientSDK::sampleApp::InteractionManager:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApp::InteractionManager:
Collaboration graph
[legend]

Public Member Functions

 InteractionManager (std::shared_ptr< defaultClient::DefaultClient > client, std::shared_ptr< applicationUtilities::resources::audio::MicrophoneInterface > micWrapper, std::shared_ptr< sampleApp::UIManager > userInterface, capabilityAgents::aip::AudioProvider holdToTalkAudioProvider, capabilityAgents::aip::AudioProvider tapToTalkAudioProvider, std::shared_ptr< sampleApp::GuiRenderer > guiRenderer=nullptr, capabilityAgents::aip::AudioProvider wakeWordAudioProvider=capabilityAgents::aip::AudioProvider::null(), std::shared_ptr< avsCommon::sdkInterfaces::CallManagerInterface > callManager=nullptr, std::shared_ptr< avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface > diagnostics=nullptr)
 
void begin ()
 
void help ()
 
void limitedHelp ()
 
void microphoneToggle ()
 
void holdToggled ()
 
void tap ()
 
void stopForegroundActivity ()
 
void playbackPlay ()
 
void playbackPause ()
 
void playbackNext ()
 
void playbackPrevious ()
 
void playbackSkipForward ()
 
void playbackSkipBackward ()
 
void playbackShuffle ()
 
void playbackLoop ()
 
void playbackRepeat ()
 
void playbackThumbsUp ()
 
void playbackThumbsDown ()
 
void settings ()
 
void alarmVolumeRamp ()
 
void wakewordConfirmation ()
 
void speechConfirmation ()
 
void locale ()
 
void clearCachedEndpointIdentifiers (const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &deletedEndpoints)
 
void timeZone ()
 
void networkInfo ()
 
void doNotDisturb ()
 
void errorValue ()
 
void speakerControl ()
 
void firmwareVersionControl ()
 
void setFirmwareVersion (avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion)
 
void volumeControl ()
 
void adjustVolume (avsCommon::sdkInterfaces::ChannelVolumeInterface::Type type, int8_t delta)
 
void setMute (avsCommon::sdkInterfaces::ChannelVolumeInterface::Type type, bool mute)
 
void resetDevice ()
 
void confirmResetDevice ()
 
void confirmReauthorizeDevice ()
 
void onDialogUXStateChanged (DialogUXState newState) override
 
void onCallStateChange (CallState newState) override
 
void setDoNotDisturbMode (bool enable)
 
void setAlarmVolumeRamp (bool enable)
 
void setSpeechConfirmation (settings::SpeechConfirmationSettingType value)
 
void setWakewordConfirmation (settings::WakeWordConfirmationSettingType value)
 
void setTimeZone (const std::string &value)
 
void setLocale (const settings::DeviceLocales &value)
 
settings::types::NetworkInfo getNetworkInfo ()
 
void setNetworkInfo (const settings::types::NetworkInfo &value)
 
void stopMicrophone ()
 
void startMicrophone ()
 
void diagnosticsControl ()
 
void devicePropertiesControl ()
 
void showDeviceProperties ()
 
void audioInjectionControl ()
 
void injectWavFile (const std::string &absoluteFilePath)
 
void deviceProtocolTraceControl ()
 
void printProtocolTrace ()
 
void setProtocolTraceFlag (bool enabled)
 
void clearProtocolTrace ()
 
void sendDeviceSetupComplete ()
 
Network Info Prompt Functions

Should be called whenever a user requests a specific 'NETWORK_INFO' change.

void networkInfoConnectionTypePrompt ()
 
void networkInfoESSIDPrompt ()
 
void networkInfoBSSIDPrompt ()
 
void networkInfoIpPrompt ()
 
void networkInfoSubnetPrompt ()
 
void networkInfoMacPrompt ()
 
void networkInfoDHCPPrompt ()
 
void networkInfoStaticIpPrompt ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
virtual ~DialogUXStateObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
virtual ~CallStateObserverInterface ()=default
 
virtual void onCallStateInfoChange (const CallStateInfo &stateInfo)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Additional Inherited Members

- 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...
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
enum  CallState {
  CallState::CONNECTING, CallState::INBOUND_RINGING, CallState::CALL_CONNECTED, CallState::CALL_DISCONNECTED,
  CallState::NONE
}
 An enumeration representing the state of a call. More...
 
typedef struct alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo CallStateInfo
 An struct containing call state information. More...
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
static std::string stateToString (DialogUXState state)
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
static bool isStateActive (const CallStateObserverInterface::CallState &state)
 

Detailed Description

This class manages most of the user interaction by taking in commands and notifying the DefaultClient and the userInterface (the view) accordingly.

Constructor & Destructor Documentation

◆ InteractionManager()

alexaClientSDK::sampleApp::InteractionManager::InteractionManager ( std::shared_ptr< defaultClient::DefaultClient client,
std::shared_ptr< applicationUtilities::resources::audio::MicrophoneInterface micWrapper,
std::shared_ptr< sampleApp::UIManager userInterface,
capabilityAgents::aip::AudioProvider  holdToTalkAudioProvider,
capabilityAgents::aip::AudioProvider  tapToTalkAudioProvider,
std::shared_ptr< sampleApp::GuiRenderer guiRenderer = nullptr,
capabilityAgents::aip::AudioProvider  wakeWordAudioProvider = capabilityAgents::aip::AudioProvider::null(),
std::shared_ptr< avsCommon::sdkInterfaces::CallManagerInterface callManager = nullptr,
std::shared_ptr< avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface diagnostics = nullptr 
)

Constructor.

Member Function Documentation

◆ adjustVolume()

void alexaClientSDK::sampleApp::InteractionManager::adjustVolume ( avsCommon::sdkInterfaces::ChannelVolumeInterface::Type  type,
int8_t  delta 
)

Should be called after a user wishes to modify the volume.

◆ alarmVolumeRamp()

void alexaClientSDK::sampleApp::InteractionManager::alarmVolumeRamp ( )

Should be called whenever a user requests 'ALARM_VOLUME_RAMP' change.

◆ audioInjectionControl()

void alexaClientSDK::sampleApp::InteractionManager::audioInjectionControl ( )

Prints the audio injection screen.

◆ begin()

void alexaClientSDK::sampleApp::InteractionManager::begin ( )

Begins the interaction between the Sample App and the user. This should only be called at startup.

◆ clearCachedEndpointIdentifiers()

void alexaClientSDK::sampleApp::InteractionManager::clearCachedEndpointIdentifiers ( const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &  deletedEndpoints)

Resets cached endpoint identifiers.

◆ clearProtocolTrace()

void alexaClientSDK::sampleApp::InteractionManager::clearProtocolTrace ( )

Clears the protocol trace message list.

◆ confirmReauthorizeDevice()

void alexaClientSDK::sampleApp::InteractionManager::confirmReauthorizeDevice ( )

Prompts the user to confirm the intent to re-authorize the device.

◆ confirmResetDevice()

void alexaClientSDK::sampleApp::InteractionManager::confirmResetDevice ( )

Prompts the user to confirm the intent to reset the device.

◆ devicePropertiesControl()

void alexaClientSDK::sampleApp::InteractionManager::devicePropertiesControl ( )

Prints the device properties screen.

◆ deviceProtocolTraceControl()

void alexaClientSDK::sampleApp::InteractionManager::deviceProtocolTraceControl ( )

Prints device protocol tracer screen.

◆ diagnosticsControl()

void alexaClientSDK::sampleApp::InteractionManager::diagnosticsControl ( )

Prints the diagnostics screen.

◆ doNotDisturb()

void alexaClientSDK::sampleApp::InteractionManager::doNotDisturb ( )

Should be called whenever a user requests 'DO_NOT_DISTURB' change.

◆ errorValue()

void alexaClientSDK::sampleApp::InteractionManager::errorValue ( )

Should be called whenever a user presses invalid option.

◆ firmwareVersionControl()

void alexaClientSDK::sampleApp::InteractionManager::firmwareVersionControl ( )

Should be called whenever a users requests to set the firmware version.

◆ getNetworkInfo()

settings::types::NetworkInfo alexaClientSDK::sampleApp::InteractionManager::getNetworkInfo ( )

Gets the network info of the device.

Returns
The network info.

◆ help()

void alexaClientSDK::sampleApp::InteractionManager::help ( )

Should be called when a user requests help.

◆ holdToggled()

void alexaClientSDK::sampleApp::InteractionManager::holdToggled ( )

Should be called whenever a user presses or releases the hold button.

◆ injectWavFile()

void alexaClientSDK::sampleApp::InteractionManager::injectWavFile ( const std::string &  absoluteFilePath)

Injects wav file into audio stream.

Note: Currently audio injection is supported for wav files with the following properties Sample Size: 16 bits Sample Rate: 16 KHz Number of channels : 1 Endianness : Little Encoding Format : LPCM

Parameters
absoluteFilePaththe absolute filepath of the wav file containing the audio to be injected.

◆ limitedHelp()

void alexaClientSDK::sampleApp::InteractionManager::limitedHelp ( )

Should be called when a user requests help and the application failed to connect to AVS.

◆ locale()

void alexaClientSDK::sampleApp::InteractionManager::locale ( )

Should be called whenever a user requests 'LOCALE' change.

◆ microphoneToggle()

void alexaClientSDK::sampleApp::InteractionManager::microphoneToggle ( )

Toggles the microphone state if the Sample App was built with wakeword. When the microphone is turned off, the app enters a privacy mode in which it stops recording audio data from the microphone, thus disabling Alexa waking up due to wake word. Note however that hold-to-talk and tap-to-talk modes will still work by recording microphone data temporarily until a user initiated interacion is complete. If this app was built without wakeword then this will do nothing as the microphone is already off.

◆ networkInfo()

void alexaClientSDK::sampleApp::InteractionManager::networkInfo ( )

Should be called whenever a user requests 'NETWORK_INFO' change.

◆ networkInfoBSSIDPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoBSSIDPrompt ( )

◆ networkInfoConnectionTypePrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoConnectionTypePrompt ( )

◆ networkInfoDHCPPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoDHCPPrompt ( )

◆ networkInfoESSIDPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoESSIDPrompt ( )

◆ networkInfoIpPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoIpPrompt ( )

◆ networkInfoMacPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoMacPrompt ( )

◆ networkInfoStaticIpPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoStaticIpPrompt ( )

◆ networkInfoSubnetPrompt()

void alexaClientSDK::sampleApp::InteractionManager::networkInfoSubnetPrompt ( )

◆ onCallStateChange()

void alexaClientSDK::sampleApp::InteractionManager::onCallStateChange ( CallState  newState)
overridevirtual

CallStateObserverInterface methods

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

◆ onDialogUXStateChanged()

void alexaClientSDK::sampleApp::InteractionManager::onDialogUXStateChanged ( DialogUXState  newState)
overridevirtual

UXDialogObserverInterface methods

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

◆ playbackLoop()

void alexaClientSDK::sampleApp::InteractionManager::playbackLoop ( )

Should be called whenever a user presses 'LOOP' for playback.

◆ playbackNext()

void alexaClientSDK::sampleApp::InteractionManager::playbackNext ( )

Should be called whenever a user presses 'NEXT' for playback.

◆ playbackPause()

void alexaClientSDK::sampleApp::InteractionManager::playbackPause ( )

Should be called whenever a user presses 'PAUSE' for playback.

◆ playbackPlay()

void alexaClientSDK::sampleApp::InteractionManager::playbackPlay ( )

Should be called whenever a user presses 'PLAY' for playback.

◆ playbackPrevious()

void alexaClientSDK::sampleApp::InteractionManager::playbackPrevious ( )

Should be called whenever a user presses 'PREVIOUS' for playback.

◆ playbackRepeat()

void alexaClientSDK::sampleApp::InteractionManager::playbackRepeat ( )

Should be called whenever a user presses 'REPEAT' for playback.

◆ playbackShuffle()

void alexaClientSDK::sampleApp::InteractionManager::playbackShuffle ( )

Should be called whenever a user presses 'SHUFFLE' for playback.

◆ playbackSkipBackward()

void alexaClientSDK::sampleApp::InteractionManager::playbackSkipBackward ( )

Should be called whenever a user presses 'SKIP_BACKWARD' for playback.

◆ playbackSkipForward()

void alexaClientSDK::sampleApp::InteractionManager::playbackSkipForward ( )

Should be called whenever a user presses 'SKIP_FORWARD' for playback.

◆ playbackThumbsDown()

void alexaClientSDK::sampleApp::InteractionManager::playbackThumbsDown ( )

Should be called whenever a user presses 'THUMBS_DOWN' for playback.

◆ playbackThumbsUp()

void alexaClientSDK::sampleApp::InteractionManager::playbackThumbsUp ( )

Should be called whenever a user presses 'THUMBS_UP' for playback.

◆ printProtocolTrace()

void alexaClientSDK::sampleApp::InteractionManager::printProtocolTrace ( )

Prints the protocol trace string.

◆ resetDevice()

void alexaClientSDK::sampleApp::InteractionManager::resetDevice ( )

Reset the device and remove any customer data.

◆ sendDeviceSetupComplete()

void alexaClientSDK::sampleApp::InteractionManager::sendDeviceSetupComplete ( )

Send the DeviceSetupComplete event

◆ setAlarmVolumeRamp()

void alexaClientSDK::sampleApp::InteractionManager::setAlarmVolumeRamp ( bool  enable)

Sets the Alarm Volume Ramp state.

◆ setDoNotDisturbMode()

void alexaClientSDK::sampleApp::InteractionManager::setDoNotDisturbMode ( bool  enable)

Sets the do not disturb mode state.

◆ setFirmwareVersion()

void alexaClientSDK::sampleApp::InteractionManager::setFirmwareVersion ( avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion)

Update the firmware version.

Parameters
firmwareVersionThe new firmware version.

◆ setLocale()

void alexaClientSDK::sampleApp::InteractionManager::setLocale ( const settings::DeviceLocales value)

Sets the locale of the device.

◆ setMute()

void alexaClientSDK::sampleApp::InteractionManager::setMute ( avsCommon::sdkInterfaces::ChannelVolumeInterface::Type  type,
bool  mute 
)

Should be called after a user wishes to set mute.

◆ setNetworkInfo()

void alexaClientSDK::sampleApp::InteractionManager::setNetworkInfo ( const settings::types::NetworkInfo value)

Sets the network info of the device.

Parameters
valueThe network info being set.

◆ setProtocolTraceFlag()

void alexaClientSDK::sampleApp::InteractionManager::setProtocolTraceFlag ( bool  enabled)

Enables the protocol trace utility.

Parameters
enabledflag indicating if protocol trace is enabled/disabled.

◆ setSpeechConfirmation()

void alexaClientSDK::sampleApp::InteractionManager::setSpeechConfirmation ( settings::SpeechConfirmationSettingType  value)

Sets the speech confirmation state.

◆ setTimeZone()

void alexaClientSDK::sampleApp::InteractionManager::setTimeZone ( const std::string &  value)

Sets the time zone of the device.

◆ settings()

void alexaClientSDK::sampleApp::InteractionManager::settings ( )

Should be called whenever a user presses 'SETTINGS' for settings options.

◆ setWakewordConfirmation()

void alexaClientSDK::sampleApp::InteractionManager::setWakewordConfirmation ( settings::WakeWordConfirmationSettingType  value)

Sets the wake word confirmation state.

◆ showDeviceProperties()

void alexaClientSDK::sampleApp::InteractionManager::showDeviceProperties ( )

Prints a requested device property.

◆ speakerControl()

void alexaClientSDK::sampleApp::InteractionManager::speakerControl ( )

Should be called whenever a users requests 'SPEAKER_CONTROL' for speaker control.

◆ speechConfirmation()

void alexaClientSDK::sampleApp::InteractionManager::speechConfirmation ( )

Should be called whenever a user requests 'SPEECH_CONFIRMATION' change.

◆ startMicrophone()

void alexaClientSDK::sampleApp::InteractionManager::startMicrophone ( )

Start streaming audio data from the microphone.

◆ stopForegroundActivity()

void alexaClientSDK::sampleApp::InteractionManager::stopForegroundActivity ( )

Acts as a "stop" button. This stops whatever has foreground focus.

◆ stopMicrophone()

void alexaClientSDK::sampleApp::InteractionManager::stopMicrophone ( )

Stop the microphone from streaming audio data.

◆ tap()

void alexaClientSDK::sampleApp::InteractionManager::tap ( )

Should be called whenever a user presses and releases the tap button.

◆ timeZone()

void alexaClientSDK::sampleApp::InteractionManager::timeZone ( )

Should be called whenever a user requests 'TIMEZONE' change.

◆ volumeControl()

void alexaClientSDK::sampleApp::InteractionManager::volumeControl ( )

Should be called after a user selects a speaker.

◆ wakewordConfirmation()

void alexaClientSDK::sampleApp::InteractionManager::wakewordConfirmation ( )

Should be called whenever a user requests 'WAKEWORD_CONFIRMATION' change.


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

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