AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler Class Reference

#include <PeripheralEndpointRangeControllerHandler.h>

Inheritance diagram for alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler:
Collaboration graph
[legend]

Public Member Functions

void setRangeValue (double value)
 
RangeControllerInterface methods
avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeControllerConfiguration getConfiguration () override
 
std::pair< avsCommon::avs::AlexaResponseType, std::string > setRangeValue (double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustRangeValue (double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeState > > getRangeState () override
 
bool addObserver (std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > observer) override
 
void removeObserver (const std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > &observer) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface
virtual ~RangeControllerInterface ()=default
 
virtual bool addObserver (std::shared_ptr< RangeControllerObserverInterface > observer)=0
 
virtual void removeObserver (const std::shared_ptr< RangeControllerObserverInterface > &observer)=0
 

Static Public Member Functions

static std::shared_ptr< PeripheralEndpointRangeControllerHandlercreate (const std::string &endpointName, const std::string &instance)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface
using RangeState = avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface::RangeState
 Alias to improve readability. More...
 

Detailed Description

An implementation of an RangeControllerInterface.

Member Function Documentation

◆ addObserver()

bool alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::addObserver ( std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface observer)
override

◆ adjustRangeValue()

std::pair<avsCommon::avs::AlexaResponseType, std::string> alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::adjustRangeValue ( double  deltaRange,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

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.

Implements alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface.

◆ create()

static std::shared_ptr<PeripheralEndpointRangeControllerHandler> alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::create ( const std::string &  endpointName,
const std::string &  instance 
)
static

Create a PeripheralEndpointRangeControllerHandler object.

Parameters
endpointNameThe name of the endpoint.
instanceThe instance name of the capability.
Returns
A pointer to a new PeripheralEndpointRangeControllerHandler object if it succeeds; otherwise, nullptr.

◆ getConfiguration()

avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeControllerConfiguration alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::getConfiguration ( )
overridevirtual

Gets the controller configuration as defined in RangeControllerConfiguration

Returns
RangeControllerConfiguration

Implements alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface.

◆ getRangeState()

std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional<avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeState> > alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::getRangeState ( )
overridevirtual

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.

Implements alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface.

◆ removeObserver()

void alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::removeObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > &  observer)
override

◆ setRangeValue() [1/2]

std::pair<avsCommon::avs::AlexaResponseType, std::string> alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::setRangeValue ( double  range,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

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.

Implements alexaClientSDK::avsCommon::sdkInterfaces::rangeController::RangeControllerInterface.

◆ setRangeValue() [2/2]

void alexaClientSDK::sampleApplications::common::PeripheralEndpointRangeControllerHandler::setRangeValue ( double  value)

Set the range of the controller.

Parameters
valueRange value to be set.

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

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