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

#include <DefaultEndpointModeControllerHandler.h>

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

Public Member Functions

ModeControllerInterface methods
avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeControllerConfiguration getConfiguration () override
 
std::pair< avsCommon::avs::AlexaResponseType, std::string > setMode (const std::string &mode, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustMode (int modeDelta, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeState > > getMode () override
 
bool addObserver (std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > observer) override
 
void removeObserver (const std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > &observer) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface
virtual ~ModeControllerInterface ()=default
 
virtual bool addObserver (std::shared_ptr< ModeControllerObserverInterface > observer)=0
 
virtual void removeObserver (const std::shared_ptr< ModeControllerObserverInterface > &observer)=0
 

Static Public Member Functions

static std::shared_ptr< DefaultEndpointModeControllerHandlercreate (const std::string &instance)
 

Static Public Attributes

static const std::string MODE_CONTROLLER_MODE_FAN_ONLY = "Fan Only"
 The 'Fan Only' mode of the controller. More...
 
static const std::string MODE_CONTROLLER_MODE_FAN_ONLY_FRIENDLY_NAME = "Fan Only"
 The friendly name of 'Fan Only' mode. More...
 
static const std::string MODE_CONTROLLER_MODE_HEAT = "Heat"
 The 'HEAT' mode of the controller. More...
 
static const std::string MODE_CONTROLLER_MODE_HEAT_FRIENDLY_NAME = "Heat"
 The friendly name of 'HEAT' mode. More...
 
static const std::string MODE_CONTROLLER_MODE_COOL = "Cool"
 The 'Cool' mode of the controller. More...
 
static const std::string MODE_CONTROLLER_MODE_COOL_FRIENDLY_NAME = "Cool"
 The friendly name of 'Cool' mode. More...
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface
using ModeState = avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface::ModeState
 Alias to improve readability. More...
 
using ModeControllerConfiguration = std::vector< std::string >
 

Detailed Description

An implementation of a ModeControllerInterface.

Member Function Documentation

◆ addObserver()

bool alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::addObserver ( std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface observer)
override

◆ adjustMode()

std::pair< AlexaResponseType, std::string > alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::adjustMode ( int  modeDelta,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

Adjust the mode of an instance.

Parameters
modeDeltaThe delta by which the controller mode should be changed (only applicable if the mode controller is ordered).
causeThe appropriate AlexaStateChangeCauseType for this change.
Returns
A pair of 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.

Implements alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface.

◆ create()

std::shared_ptr< DefaultEndpointModeControllerHandler > alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::create ( const std::string &  instance)
static

Create a DefaultEndpointModeControllerHandler object.

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

◆ getConfiguration()

ModeControllerInterface::ModeControllerConfiguration alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::getConfiguration ( )
overridevirtual

Gets the controller configuration as defined ModeControllerConfiguration

Returns
ModeControllerConfiguration

Implements alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface.

◆ getMode()

std::pair< AlexaResponseType, avsCommon::utils::Optional< ModeControllerInterface::ModeState > > alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::getMode ( )
overridevirtual

Gets the current mode of the instance.

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

Implements alexaClientSDK::avsCommon::sdkInterfaces::modeController::ModeControllerInterface.

◆ removeObserver()

void alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::removeObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > &  observer)
override

◆ setMode()

std::pair< AlexaResponseType, std::string > alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::setMode ( const std::string &  mode,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

Set the mode of the instance.

Parameters
modeThe desired mode 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::modeController::ModeControllerInterface.

Member Data Documentation

◆ MODE_CONTROLLER_MODE_COOL

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_COOL = "Cool"
static

The 'Cool' mode of the controller.

◆ MODE_CONTROLLER_MODE_COOL_FRIENDLY_NAME

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_COOL_FRIENDLY_NAME = "Cool"
static

The friendly name of 'Cool' mode.

◆ MODE_CONTROLLER_MODE_FAN_ONLY

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_FAN_ONLY = "Fan Only"
static

The 'Fan Only' mode of the controller.

◆ MODE_CONTROLLER_MODE_FAN_ONLY_FRIENDLY_NAME

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_FAN_ONLY_FRIENDLY_NAME = "Fan Only"
static

The friendly name of 'Fan Only' mode.

◆ MODE_CONTROLLER_MODE_HEAT

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_HEAT = "Heat"
static

The 'HEAT' mode of the controller.

◆ MODE_CONTROLLER_MODE_HEAT_FRIENDLY_NAME

const std::string alexaClientSDK::sampleApp::DefaultEndpointModeControllerHandler::MODE_CONTROLLER_MODE_HEAT_FRIENDLY_NAME = "Heat"
static

The friendly name of 'HEAT' mode.


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