AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <ModeControllerInterface.h>
Public Types | |
using | ModeState = avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface::ModeState |
Alias to improve readability. More... | |
using | ModeControllerConfiguration = std::vector< std::string > |
Public Member Functions | |
virtual | ~ModeControllerInterface ()=default |
virtual ModeControllerConfiguration | getConfiguration ()=0 |
virtual std::pair< avsCommon::avs::AlexaResponseType, std::string > | setMode (const std::string &mode, AlexaStateChangeCauseType cause)=0 |
virtual std::pair< avsCommon::avs::AlexaResponseType, std::string > | adjustMode (int modeDelta, AlexaStateChangeCauseType cause)=0 |
virtual std::pair< avsCommon::avs::AlexaResponseType, utils::Optional< ModeState > > | getMode ()=0 |
virtual bool | addObserver (std::shared_ptr< ModeControllerObserverInterface > observer)=0 |
virtual void | removeObserver (const std::shared_ptr< ModeControllerObserverInterface > &observer)=0 |
The ModeControllerInterface carries out mode actions on an instance of an endpoint.
An implementation of the ModeControllerInterface controls the instance's mode and may allow its methods to be called by multiple callers; for example the Alexa Capability Agent or the application’s GUI.
using alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeControllerConfiguration = std::vector<std::string> |
The configuration of the mode controller that represents the supported modes as a vector of string
using alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeState = avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface::ModeState |
Alias to improve readability.
|
virtualdefault |
Virtual destructor to assure proper cleanup of derived types.
|
pure virtual |
Adds a ModeControllerObserverInterface
observer
ModeControllerObserverInterface
for any change in its property state. This includes notifying the value when the device starts, if it is different from the last reported value.observer | The pointer to the ModeControllerObserverInterface . |
true
if the object supports observer notification and observer was successfully added; otherwise, return false
|
pure virtual |
Adjust the mode of an instance.
modeDelta | The delta by which the controller mode should be changed (only applicable if the mode controller is ordered). |
cause | The appropriate AlexaStateChangeCauseType for this change. |
AlexaResponseType
and string. For the successful operation, the controller should return a pair of AlexaResponseType::SUCCESS
with an empty string, otherwise it returns pair with the appropriate reason from AlexaResponseType
and a description of the error. Implemented in alexaClientSDK::sampleApplications::common::DefaultEndpointModeControllerHandler, and alexaClientSDK::sampleApplications::common::PeripheralEndpointModeControllerHandler.
|
pure virtual |
Gets the controller configuration as defined ModeControllerConfiguration
ModeControllerConfiguration
Implemented in alexaClientSDK::sampleApplications::common::DefaultEndpointModeControllerHandler, and alexaClientSDK::sampleApplications::common::PeripheralEndpointModeControllerHandler.
|
pure virtual |
Gets the current mode of the instance.
AlexaResponseType::SUCCESS
and ModeState
otherwise returns a pair with the appropriate reason from AlexaResponseType
and an empty ModeState
. Implemented in alexaClientSDK::sampleApplications::common::DefaultEndpointModeControllerHandler, and alexaClientSDK::sampleApplications::common::PeripheralEndpointModeControllerHandler.
|
pure virtual |
Removes an observer.
observer | The pointer to the ModeControllerObserverInterface . |
|
pure virtual |
Set the mode of the instance.
mode | The desired mode of the instance. |
cause | The cause type for this action represented using AlexaStateChangeCauseType . |
AlexaResponseType
and string. For the successful operation, the controller should return a pair with AlexaResponseType::SUCCESS
with an empty string, otherwise returns a pair with the appropriate reason from AlexaResponseType
and a description of the error. Implemented in alexaClientSDK::sampleApplications::common::DefaultEndpointModeControllerHandler, and alexaClientSDK::sampleApplications::common::PeripheralEndpointModeControllerHandler.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0