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

#include <UIManager.h>

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

Public Types

using DeviceAttributes = acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface::DeviceAttributes
 
- 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::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::CapabilitiesDelegateObserverInterface
enum  State { State::UNINITIALIZED, State::SUCCESS, State::FATAL_ERROR, State::RETRIABLE_ERROR }
 The enum State describes the state of the CapabilitiesDelegate. More...
 
enum  Error {
  Error::UNINITIALIZED, Error::SUCCESS, Error::UNKNOWN_ERROR, Error::CANCELED,
  Error::FORBIDDEN, Error::SERVER_INTERNAL_ERROR, Error::BAD_REQUEST
}
 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 Member Functions

void printDoNotDisturbScreen ()
 
void printDiagnosticsScreen ()
 
void printDevicePropertiesScreen ()
 
void printAllDeviceProperties (const std::unordered_map< std::string, std::string > &deviceProperties)
 
void printDeviceProtocolTracerScreen ()
 
void printProtocolTrace (const std::string &protocolTrace)
 
void printProtocolTraceFlag (bool enabled)
 
void printAudioInjectionScreen ()
 
void printAudioInjectionFailureMessage ()
 
DialogUxStateObserverInetrface methods.
void onDialogUXStateChanged (DialogUXState state) override
 
ConnectionStatusObserverInterface methods.
void onConnectionStatusChanged (const Status status, const ChangedReason reason) override
 
SingleSettingObserverInterface methods
void onSettingChanged (const std::string &key, const std::string &value) override
 
SpeakerManagerObserverInterface Functions
void onSpeakerSettingsChanged (const avsCommon::sdkInterfaces::SpeakerManagerObserverInterface::Source &source, const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type &type, const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings &settings) override
 
NotificationsObserverInterface Functions

}

void onSetIndicator (avsCommon::avs::IndicatorState state) override
 
void onNotificationReceived () override
 
UIManagerInterface Functions

}

void printMessage (const std::string &message) override
 
AuthObserverInterface Methods

}

void onAuthStateChange (avsCommon::sdkInterfaces::AuthObserverInterface::State newState, avsCommon::sdkInterfaces::AuthObserverInterface::Error newError) override
 
CapabilitiesDelegateObserverInterface Methods

}

void onCapabilitiesStateChange (avsCommon::sdkInterfaces::CapabilitiesDelegateObserverInterface::State newState, avsCommon::sdkInterfaces::CapabilitiesDelegateObserverInterface::Error newError, const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &addedOrUpdatedEndpoints, const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &deletedEndpoints) override
 
BluetoothDeviceObserverInterface Methods

}

void onActiveDeviceConnected (const DeviceAttributes &deviceAttributes) override
 
void onActiveDeviceDisconnected (const DeviceAttributes &deviceAttributes) override
 
void printWelcomeScreen ()
 } More...
 
void printHelpScreen ()
 
void printLimitedHelp ()
 
void printAudioInjectionHeader ()
 
void printSettingsScreen ()
 
void printEndpointModificationScreen ()
 
void printEndpointModificationError (const std::string &message)
 
void printEndpointControllerScreen ()
 
void printLocaleScreen ()
 
void printPowerControllerScreen ()
 
void printToggleControllerScreen ()
 
void printModeControllerScreen ()
 
void printRangeControllerScreen ()
 
void printSpeakerControlScreen ()
 
void printFirmwareVersionControlScreen ()
 
void printVolumeControlScreen ()
 
void printErrorScreen ()
 
void microphoneOff ()
 
void microphoneOn ()
 
void printResetWarning ()
 
void printResetConfirmation ()
 
void printReauthorizeConfirmation ()
 
void printCommsNotSupported ()
 
bool configureSettingsNotifications (std::shared_ptr< settings::DeviceSettingsManager > settingsManager)
 
void printAlarmVolumeRampScreen ()
 
void printWakeWordConfirmationScreen ()
 
void printSpeechConfirmationScreen ()
 
void printTimeZoneScreen ()
 
void printNetworkInfoScreen ()
 
Print network info menu options
void printNetworkInfoConnectionTypePrompt ()
 
void printNetworkInfoESSIDPrompt ()
 
void printNetworkInfoBSSIDPrompt ()
 
void printNetworkInfoIpPrompt ()
 
void printNetworkInfoSubnetPrompt ()
 
void printNetworkInfoMacPrompt ()
 
void printNetworkInfoDHCPPrompt ()
 
void printNetworkInfoStaticIpPrompt ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
virtual ~DialogUXStateObserverInterface ()=default
 
virtual void onDialogUXStateChanged (DialogUXState newState)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
virtual ~AuthObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilitiesDelegateObserverInterface
virtual ~CapabilitiesDelegateObserverInterface ()=default
 
virtual void onCapabilitiesStateChange (State newState, Error newError, const std::vector< std::string > &addedOrUpdatedEndpointIds, const std::vector< std::string > &deletedEndpointIds)=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::SingleSettingObserverInterface
virtual ~SingleSettingObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerManagerObserverInterface
virtual ~SpeakerManagerObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkNotificationsInterfaces::NotificationsObserverInterface
virtual ~NotificationsObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface
virtual ~BluetoothDeviceObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkSampleApplicationInterfaces::UIManagerInterface
virtual ~UIManagerInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< UIManagercreate (const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface > &localeAssetsManager, const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo)
 
- Static Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DialogUXStateObserverInterface
static std::string stateToString (DialogUXState state)
 

Detailed Description

This class manages the states that the user will see when interacting with the Sample Application. For now, it simply prints states to the screen.

Member Typedef Documentation

◆ DeviceAttributes

Member Function Documentation

◆ configureSettingsNotifications()

bool alexaClientSDK::sampleApp::UIManager::configureSettingsNotifications ( std::shared_ptr< settings::DeviceSettingsManager settingsManager)

Configure settings notifications.

Parameters
Pointerto the settings manager
Returns
@true if it succeeds to configure the settings notifications; false otherwise.

◆ create()

std::shared_ptr< UIManager > alexaClientSDK::sampleApp::UIManager::create ( const std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface > &  localeAssetsManager,
const std::shared_ptr< avsCommon::utils::DeviceInfo > &  deviceInfo 
)
static

Create a UIManager.

Parameters
localeAssetsManagerThe LocaleAssetsManagerInterface that provides the supported locales.
deviceInfoInformation about the device. For example, the default endpoint.
Returns
a new instance of UIManager.

◆ microphoneOff()

void alexaClientSDK::sampleApp::UIManager::microphoneOff ( )

Notifies the user that the microphone is off.

◆ microphoneOn()

void alexaClientSDK::sampleApp::UIManager::microphoneOn ( )

◆ onActiveDeviceConnected()

void alexaClientSDK::sampleApp::UIManager::onActiveDeviceConnected ( const DeviceAttributes attributes)
overridevirtual

Used to notify the observer when an active bluetooth device is connected.

Parameters
attributesThe DeviceAttributes of the active bluetooth device.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface.

◆ onActiveDeviceDisconnected()

void alexaClientSDK::sampleApp::UIManager::onActiveDeviceDisconnected ( const DeviceAttributes attributes)
overridevirtual

Used to notify the observer when an active bluetooth device is disconnected.

Parameters
attributesThe DeviceAttributes of the active bluetooth device.

Implements alexaClientSDK::acsdkBluetoothInterfaces::BluetoothDeviceObserverInterface.

◆ onAuthStateChange()

void alexaClientSDK::sampleApp::UIManager::onAuthStateChange ( avsCommon::sdkInterfaces::AuthObserverInterface::State  newState,
avsCommon::sdkInterfaces::AuthObserverInterface::Error  error 
)
overridevirtual

Notification that an authorization state has changed.

Note
Implementations of this method must not call AuthDelegate methods because the AuthDelegate may be in a 'locked' state at the time this call is made.
Parameters
newStateThe new state of the authorization token.
errorThe error associated to the state change.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface.

◆ onCapabilitiesStateChange()

void alexaClientSDK::sampleApp::UIManager::onCapabilitiesStateChange ( avsCommon::sdkInterfaces::CapabilitiesDelegateObserverInterface::State  newState,
avsCommon::sdkInterfaces::CapabilitiesDelegateObserverInterface::Error  newError,
const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &  addedOrUpdatedEndpoints,
const std::vector< avsCommon::sdkInterfaces::endpoints::EndpointIdentifier > &  deletedEndpoints 
)
override

◆ onConnectionStatusChanged()

void alexaClientSDK::sampleApp::UIManager::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.

◆ onDialogUXStateChanged()

void alexaClientSDK::sampleApp::UIManager::onDialogUXStateChanged ( DialogUXState  state)
override

◆ onNotificationReceived()

void alexaClientSDK::sampleApp::UIManager::onNotificationReceived ( )
inlineoverridevirtual

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

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsObserverInterface.

◆ onSetIndicator()

void alexaClientSDK::sampleApp::UIManager::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.

◆ onSettingChanged()

void alexaClientSDK::sampleApp::UIManager::onSettingChanged ( const std::string &  key,
const std::string &  value 
)
overridevirtual

The callback executed when a setting is changed.

Parameters
keyThe name of the Setting.
valueThe value to which the setting has to be changed.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SingleSettingObserverInterface.

◆ onSpeakerSettingsChanged()

void alexaClientSDK::sampleApp::UIManager::onSpeakerSettingsChanged ( const avsCommon::sdkInterfaces::SpeakerManagerObserverInterface::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.

◆ printAlarmVolumeRampScreen()

void alexaClientSDK::sampleApp::UIManager::printAlarmVolumeRampScreen ( )

Prints menu for alarm volume ramp.

◆ printAllDeviceProperties()

void alexaClientSDK::sampleApp::UIManager::printAllDeviceProperties ( const std::unordered_map< std::string, std::string > &  deviceProperties)

Print all the device properties from DevicePropertyAggregator on screen.

Parameters
devicePropertiesThe deviceProperties map.

◆ printAudioInjectionFailureMessage()

void alexaClientSDK::sampleApp::UIManager::printAudioInjectionFailureMessage ( )

Prints audio injection failure message.

◆ printAudioInjectionHeader()

void alexaClientSDK::sampleApp::UIManager::printAudioInjectionHeader ( )

Prints the audio injection header to warn that audio recording is unavailable when audio injection is enabled.

◆ printAudioInjectionScreen()

void alexaClientSDK::sampleApp::UIManager::printAudioInjectionScreen ( )

Prints the Audio Injection screen.

◆ printCommsNotSupported()

void alexaClientSDK::sampleApp::UIManager::printCommsNotSupported ( )

Prints an error message when trying to access Comms controls if Comms is not supported.

◆ printDevicePropertiesScreen()

void alexaClientSDK::sampleApp::UIManager::printDevicePropertiesScreen ( )

Prints the menu for the device properties screen.

◆ printDeviceProtocolTracerScreen()

void alexaClientSDK::sampleApp::UIManager::printDeviceProtocolTracerScreen ( )

Prints the Device Protocol Tracer screen.

◆ printDiagnosticsScreen()

void alexaClientSDK::sampleApp::UIManager::printDiagnosticsScreen ( )

Prints menu for diagnostics screen.

◆ printDoNotDisturbScreen()

void alexaClientSDK::sampleApp::UIManager::printDoNotDisturbScreen ( )

Prints menu for do not disturb mode.

◆ printEndpointControllerScreen()

void alexaClientSDK::sampleApp::UIManager::printEndpointControllerScreen ( )

Prints the Endpoint Controller Options screen.

◆ printEndpointModificationError()

void alexaClientSDK::sampleApp::UIManager::printEndpointModificationError ( const std::string &  message)

Prints an error message.

Parameters
messageThe error message to print.

◆ printEndpointModificationScreen()

void alexaClientSDK::sampleApp::UIManager::printEndpointModificationScreen ( )

Prints the endpoint modification screen.

◆ printErrorScreen()

void alexaClientSDK::sampleApp::UIManager::printErrorScreen ( )

Prints the Error Message for Wrong Input.

◆ printFirmwareVersionControlScreen()

void alexaClientSDK::sampleApp::UIManager::printFirmwareVersionControlScreen ( )

Prints the Firmware Version Control screen. This prompts the user to enter a positive decimal integer.

◆ printHelpScreen()

void alexaClientSDK::sampleApp::UIManager::printHelpScreen ( )

Prints the help screen.

◆ printLimitedHelp()

void alexaClientSDK::sampleApp::UIManager::printLimitedHelp ( )

Prints the help screen with limited options. This is used when not connected to AVS.

◆ printLocaleScreen()

void alexaClientSDK::sampleApp::UIManager::printLocaleScreen ( )

Prints the Locale Options screen.

◆ printMessage()

void alexaClientSDK::sampleApp::UIManager::printMessage ( const std::string &  message)
overridevirtual

Show a message to the user.

Parameters
messageThe message to show the user.

Implements alexaClientSDK::acsdkSampleApplicationInterfaces::UIManagerInterface.

◆ printModeControllerScreen()

void alexaClientSDK::sampleApp::UIManager::printModeControllerScreen ( )

Prints the Mode Controller Options screen.

◆ printNetworkInfoBSSIDPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoBSSIDPrompt ( )

◆ printNetworkInfoConnectionTypePrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoConnectionTypePrompt ( )

◆ printNetworkInfoDHCPPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoDHCPPrompt ( )

◆ printNetworkInfoESSIDPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoESSIDPrompt ( )

◆ printNetworkInfoIpPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoIpPrompt ( )

◆ printNetworkInfoMacPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoMacPrompt ( )

◆ printNetworkInfoScreen()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoScreen ( )

Prints menu for device network info.

◆ printNetworkInfoStaticIpPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoStaticIpPrompt ( )

◆ printNetworkInfoSubnetPrompt()

void alexaClientSDK::sampleApp::UIManager::printNetworkInfoSubnetPrompt ( )

◆ printPowerControllerScreen()

void alexaClientSDK::sampleApp::UIManager::printPowerControllerScreen ( )

Prints the Power Controller Options screen.

◆ printProtocolTrace()

void alexaClientSDK::sampleApp::UIManager::printProtocolTrace ( const std::string &  protocolTrace)

Prints the captured protocol trace.

Parameters
Theprotocol trace string.

◆ printProtocolTraceFlag()

void alexaClientSDK::sampleApp::UIManager::printProtocolTraceFlag ( bool  enabled)

Prints the protocol trace flag.

Parameters
enabledthe boolean indicating if protocol trace is enabled/disabled.

◆ printRangeControllerScreen()

void alexaClientSDK::sampleApp::UIManager::printRangeControllerScreen ( )

Prints the Range Controller Options screen.

◆ printReauthorizeConfirmation()

void alexaClientSDK::sampleApp::UIManager::printReauthorizeConfirmation ( )

Prints a confirmation message prompting the user to confirm their intent to reauthorize the device.

◆ printResetConfirmation()

void alexaClientSDK::sampleApp::UIManager::printResetConfirmation ( )

Prints a confirmation message prompting the user to confirm their intent.

◆ printResetWarning()

void alexaClientSDK::sampleApp::UIManager::printResetWarning ( )

Prints a warning that the customer still has to manually deregister the device.

◆ printSettingsScreen()

void alexaClientSDK::sampleApp::UIManager::printSettingsScreen ( )

Prints the Settings Options screen.

◆ printSpeakerControlScreen()

void alexaClientSDK::sampleApp::UIManager::printSpeakerControlScreen ( )

Prints the Speaker Control Options screen. This prompts the user to select a ChannelVolumeInterface::Type to modify.

◆ printSpeechConfirmationScreen()

void alexaClientSDK::sampleApp::UIManager::printSpeechConfirmationScreen ( )

Prints menu for speech confirmation.

◆ printTimeZoneScreen()

void alexaClientSDK::sampleApp::UIManager::printTimeZoneScreen ( )

Prints menu for device time zone.

◆ printToggleControllerScreen()

void alexaClientSDK::sampleApp::UIManager::printToggleControllerScreen ( )

Prints the Toggle Controller Options screen.

◆ printVolumeControlScreen()

void alexaClientSDK::sampleApp::UIManager::printVolumeControlScreen ( )

Prints the Volume Control Options screen. This gives the user the possible volume control options.

◆ printWakeWordConfirmationScreen()

void alexaClientSDK::sampleApp::UIManager::printWakeWordConfirmationScreen ( )

Prints menu for wake word confirmation.

◆ printWelcomeScreen()

void alexaClientSDK::sampleApp::UIManager::printWelcomeScreen ( )

}

Prints the welcome screen.


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