![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <InteractionManager.h>
This class manages most of the user interaction by taking in commands and notifying the DefaultClient and the userInterface (the view) accordingly.
alexaClientSDK::sampleApplications::common::InteractionManager::InteractionManager | ( | std::shared_ptr< defaultClient::DefaultClient > | client, |
std::shared_ptr< applicationUtilities::resources::audio::MicrophoneInterface > | micWrapper, | ||
std::shared_ptr< UIManager > | userInterface, | ||
capabilityAgents::aip::AudioProvider | holdToTalkAudioProvider, | ||
capabilityAgents::aip::AudioProvider | tapToTalkAudioProvider, | ||
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.
void alexaClientSDK::sampleApplications::common::InteractionManager::adjustVolume | ( | avsCommon::sdkInterfaces::ChannelVolumeInterface::Type | type, |
int8_t | delta | ||
) |
Should be called after a user wishes to modify the volume.
void alexaClientSDK::sampleApplications::common::InteractionManager::alarmVolumeRamp | ( | ) |
Should be called whenever a user requests 'ALARM_VOLUME_RAMP' change.
void alexaClientSDK::sampleApplications::common::InteractionManager::audioInjectionControl | ( | ) |
Prints the audio injection screen.
void alexaClientSDK::sampleApplications::common::InteractionManager::begin | ( | ) |
Begins the interaction between the Sample App and the user. This should only be called at startup.
void alexaClientSDK::sampleApplications::common::InteractionManager::clearCachedEndpointIdentifiers | ( | const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > & | deletedEndpoints | ) |
Resets cached endpoint identifiers.
void alexaClientSDK::sampleApplications::common::InteractionManager::clearProtocolTrace | ( | ) |
Clears the protocol trace message list.
void alexaClientSDK::sampleApplications::common::InteractionManager::confirmReauthorizeDevice | ( | ) |
Prompts the user to confirm the intent to re-authorize the device.
void alexaClientSDK::sampleApplications::common::InteractionManager::confirmResetDevice | ( | ) |
Prompts the user to confirm the intent to reset the device.
void alexaClientSDK::sampleApplications::common::InteractionManager::devicePropertiesControl | ( | ) |
Prints the device properties screen.
void alexaClientSDK::sampleApplications::common::InteractionManager::deviceProtocolTraceControl | ( | ) |
Prints device protocol tracer screen.
void alexaClientSDK::sampleApplications::common::InteractionManager::diagnosticsControl | ( | ) |
Prints the diagnostics screen.
void alexaClientSDK::sampleApplications::common::InteractionManager::doNotDisturb | ( | ) |
Should be called whenever a user requests 'DO_NOT_DISTURB' change.
void alexaClientSDK::sampleApplications::common::InteractionManager::errorValue | ( | ) |
Should be called whenever a user presses invalid option.
void alexaClientSDK::sampleApplications::common::InteractionManager::firmwareVersionControl | ( | ) |
Should be called whenever a users requests to set the firmware version.
settings::types::NetworkInfo alexaClientSDK::sampleApplications::common::InteractionManager::getNetworkInfo | ( | ) |
Gets the network info of the device.
void alexaClientSDK::sampleApplications::common::InteractionManager::help | ( | ) |
Should be called when a user requests help.
void alexaClientSDK::sampleApplications::common::InteractionManager::holdToggled | ( | ) |
Should be called whenever a user presses or releases the hold button.
void alexaClientSDK::sampleApplications::common::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
absoluteFilePath | the absolute filepath of the wav file containing the audio to be injected. |
void alexaClientSDK::sampleApplications::common::InteractionManager::limitedHelp | ( | ) |
Should be called when a user requests help and the application failed to connect to AVS.
void alexaClientSDK::sampleApplications::common::InteractionManager::locale | ( | ) |
Should be called whenever a user requests 'LOCALE' change.
void alexaClientSDK::sampleApplications::common::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.
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfo | ( | ) |
Should be called whenever a user requests 'NETWORK_INFO' change.
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoBSSIDPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoConnectionTypePrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoDHCPPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoESSIDPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoIpPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoMacPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoStaticIpPrompt | ( | ) |
void alexaClientSDK::sampleApplications::common::InteractionManager::networkInfoSubnetPrompt | ( | ) |
|
overridevirtual |
CallStateObserverInterface methods
Implements alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface.
|
overridevirtual |
UXDialogObserverInterface methods
Implements alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface.
void alexaClientSDK::sampleApplications::common::InteractionManager::overrideHoldToTalkSpeechHandler | ( | std::shared_ptr< avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface > | holdToTalkHandler | ) |
Overrides the default SpeechInteractionHandlerInterface
for Hold To Talk interactions. Defaults to DefaultClient
.
holdToTalkHandler | the SpeechInteractionHandlerInterface to use as override for Hold To Talk interactions. |
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackLoop | ( | bool | action | ) |
Should be called whenever a user presses 'LOOP' for playback.
action | The boolean action for the toggle state that needs to be applied. If true, loop button is set to be active. |
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackNext | ( | ) |
Should be called whenever a user presses 'NEXT' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackPause | ( | ) |
Should be called whenever a user presses 'PAUSE' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackPlay | ( | ) |
Should be called whenever a user presses 'PLAY' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackPrevious | ( | ) |
Should be called whenever a user presses 'PREVIOUS' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackRepeat | ( | bool | action | ) |
Should be called whenever a user presses 'REPEAT' for playback.
action | The boolean action for the toggle state that needs to be applied. If true, repeat button is set to be active. |
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackShuffle | ( | bool | action | ) |
Should be called whenever a user presses 'SHUFFLE' for playback.
action | The boolean action for the toggle state that needs to be applied. If true, shuffle button is set to be active. |
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackSkipBackward | ( | ) |
Should be called whenever a user presses 'SKIP_BACKWARD' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackSkipForward | ( | ) |
Should be called whenever a user presses 'SKIP_FORWARD' for playback.
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackThumbsDown | ( | bool | action | ) |
Should be called whenever a user presses 'THUMBS_DOWN' for playback.
action | The boolean action for the toggle state that needs to be applied. If true, thumbs-down button is set to be active. |
void alexaClientSDK::sampleApplications::common::InteractionManager::playbackThumbsUp | ( | bool | action | ) |
Should be called whenever a user presses 'THUMBS_UP' for playback.
action | The boolean action for the toggle state that needs to be applied. If true, thumbs-up button is set to be active. |
void alexaClientSDK::sampleApplications::common::InteractionManager::printProtocolTrace | ( | ) |
Prints the protocol trace string.
void alexaClientSDK::sampleApplications::common::InteractionManager::resetDevice | ( | ) |
Reset the device and remove any customer data.
void alexaClientSDK::sampleApplications::common::InteractionManager::sendDeviceSetupComplete | ( | ) |
Send the DeviceSetupComplete event
void alexaClientSDK::sampleApplications::common::InteractionManager::setAlarmVolumeRamp | ( | bool | enable | ) |
Sets the Alarm Volume Ramp state.
void alexaClientSDK::sampleApplications::common::InteractionManager::setDoNotDisturbMode | ( | bool | enable | ) |
Sets the do not disturb mode state.
void alexaClientSDK::sampleApplications::common::InteractionManager::setFirmwareVersion | ( | avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion | firmwareVersion | ) |
Update the firmware version.
firmwareVersion | The new firmware version. |
void alexaClientSDK::sampleApplications::common::InteractionManager::setLocale | ( | const settings::DeviceLocales & | value | ) |
Sets the locale of the device.
void alexaClientSDK::sampleApplications::common::InteractionManager::setMute | ( | avsCommon::sdkInterfaces::ChannelVolumeInterface::Type | type, |
bool | mute | ||
) |
Should be called after a user wishes to set mute.
void alexaClientSDK::sampleApplications::common::InteractionManager::setNetworkInfo | ( | const settings::types::NetworkInfo & | value | ) |
Sets the network info of the device.
value | The network info being set. |
void alexaClientSDK::sampleApplications::common::InteractionManager::setProtocolTraceFlag | ( | bool | enabled | ) |
Enables the protocol trace utility.
enabled | flag indicating if protocol trace is enabled/disabled. |
void alexaClientSDK::sampleApplications::common::InteractionManager::setSpeechConfirmation | ( | settings::SpeechConfirmationSettingType | value | ) |
Sets the speech confirmation state.
void alexaClientSDK::sampleApplications::common::InteractionManager::setTimeZone | ( | const std::string & | value | ) |
Sets the time zone of the device.
void alexaClientSDK::sampleApplications::common::InteractionManager::settings | ( | ) |
Should be called whenever a user presses 'SETTINGS' for settings options.
void alexaClientSDK::sampleApplications::common::InteractionManager::setWakewordConfirmation | ( | settings::WakeWordConfirmationSettingType | value | ) |
Sets the wake word confirmation state.
void alexaClientSDK::sampleApplications::common::InteractionManager::showDeviceProperties | ( | ) |
Prints a requested device property.
void alexaClientSDK::sampleApplications::common::InteractionManager::speakerControl | ( | ) |
Should be called whenever a users requests 'SPEAKER_CONTROL' for speaker control.
void alexaClientSDK::sampleApplications::common::InteractionManager::speechConfirmation | ( | ) |
Should be called whenever a user requests 'SPEECH_CONFIRMATION' change.
void alexaClientSDK::sampleApplications::common::InteractionManager::startMicrophone | ( | ) |
Start streaming audio data from the microphone.
void alexaClientSDK::sampleApplications::common::InteractionManager::stopForegroundActivity | ( | ) |
Acts as a "stop" button. This stops whatever has foreground focus.
void alexaClientSDK::sampleApplications::common::InteractionManager::stopMicrophone | ( | ) |
Stop the microphone from streaming audio data.
void alexaClientSDK::sampleApplications::common::InteractionManager::tap | ( | ) |
Should be called whenever a user presses and releases the tap button.
void alexaClientSDK::sampleApplications::common::InteractionManager::timeZone | ( | ) |
Should be called whenever a user requests 'TIMEZONE' change.
void alexaClientSDK::sampleApplications::common::InteractionManager::volumeControl | ( | ) |
Should be called after a user selects a speaker.
void alexaClientSDK::sampleApplications::common::InteractionManager::wakewordConfirmation | ( | ) |
Should be called whenever a user requests 'WAKEWORD_CONFIRMATION' change.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0