AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Types | Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface Class Referenceabstract

#include <RangeControllerInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface:
Inheritance graph
[legend]

Classes

struct  RangeControllerConfiguration
 

Public Types

using RangeState = avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface::RangeState
 Alias to improve readability. More...
 

Public Member Functions

virtual ~RangeControllerInterface ()=default
 
virtual RangeControllerConfiguration getConfiguration ()=0
 
virtual std::pair< avsCommon::avs::AlexaResponseType, std::string > setRangeValue (double range, AlexaStateChangeCauseType cause)=0
 
virtual std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustRangeValue (double deltaRange, AlexaStateChangeCauseType cause)=0
 
virtual std::pair< avsCommon::avs::AlexaResponseType, utils::Optional< RangeState > > getRangeState ()=0
 
virtual bool addObserver (std::shared_ptr< RangeControllerObserverInterface > observer)=0
 
virtual void removeObserver (const std::shared_ptr< RangeControllerObserverInterface > &observer)=0
 

Detailed Description

The RangeControllerInterface carries out range actions on an instance of an endpoint.

An implementation of the RangeControllerInterface controls the instance's range and may allow its methods to be called by multiple callers; for example the Alexa Capability Agent or the application’s GUI.

Note
Implementations of this interface must be thread-safe.

Member Typedef Documentation

◆ RangeState

Alias to improve readability.

Constructor & Destructor Documentation

◆ ~RangeControllerInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::~RangeControllerInterface ( )
virtualdefault

Virtual destructor to assure proper cleanup of derived types.

Member Function Documentation

◆ addObserver()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::addObserver ( std::shared_ptr< RangeControllerObserverInterface observer)
pure virtual

Adds a RangeControllerObserverInterface observer.

Note
If RangeControllerInterface implementation has configured its instance's property as proactively reported, then it is required to notify observers of RangeControllerObserverInterface 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.
Parameters
observerThe pointer to the RangeControllerObserverInterface.
Returns
true if the object supports observer notification and observer was successfully added; otherwise, return false

◆ adjustRangeValue()

virtual std::pair<avsCommon::avs::AlexaResponseType, std::string> alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::adjustRangeValue ( double  deltaRange,
AlexaStateChangeCauseType  cause 
)
pure virtual

Adjust the range of an instance.

Parameters
deltaRangeThe desired delta range of the instance.
causeThe cause type for this action represented using AlexaStateChangeCauseType.
Returns
A pair of 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::sampleApp::PeripheralEndpointRangeControllerHandler, and alexaClientSDK::sampleApp::DefaultEndpointRangeControllerHandler.

◆ getConfiguration()

virtual RangeControllerConfiguration alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::getConfiguration ( )
pure virtual

◆ getRangeState()

virtual std::pair<avsCommon::avs::AlexaResponseType, utils::Optional<RangeState> > alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::getRangeState ( )
pure virtual

Gets the current range state of the instance.

Returns
On successful, the instance to return a pair with AlexaResponseType::SUCCESS and RangeState otherwise returns a pair with the appropriate reason from AlexaResponseType and a empty RangeState.

Implemented in alexaClientSDK::sampleApp::PeripheralEndpointRangeControllerHandler, and alexaClientSDK::sampleApp::DefaultEndpointRangeControllerHandler.

◆ removeObserver()

virtual void alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::removeObserver ( const std::shared_ptr< RangeControllerObserverInterface > &  observer)
pure virtual

Removes a observer of RangeControllerObserverInterface.

Parameters
observerThe pointer to the RangeControllerObserverInterface.

◆ setRangeValue()

virtual std::pair<avsCommon::avs::AlexaResponseType, std::string> alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::setRangeValue ( double  range,
AlexaStateChangeCauseType  cause 
)
pure virtual

Set the range of the instance.

Parameters
rangeThe desired range value of the instance.
causeThe cause type for this action represented using AlexaStateChangeCauseType.
Returns
A pair of 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::sampleApp::PeripheralEndpointRangeControllerHandler, and alexaClientSDK::sampleApp::DefaultEndpointRangeControllerHandler.


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

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