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

#include <PeripheralEndpointModeControllerHandler.h>

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

Public Member Functions

void setMode (const std::string &mode)
 
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< PeripheralEndpointModeControllerHandlercreate (const std::string &endpointName, const std::string &instance)
 

Static Public Attributes

static const std::string MODE_CONTROLLER_MODE_RED = "Red"
 The mode 'Red' of the controller. More...
 
static const std::string MODE_CONTROLLER_MODE_GREEN = "Green"
 The mode 'Green' of the controller. More...
 
static const std::string MODE_CONTROLLER_MODE_BLUE = "Blue"
 The mode 'Blue' of the controller. 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 an ModeControllerInterface.

Member Function Documentation

◆ addObserver()

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

◆ adjustMode()

std::pair< AlexaResponseType, std::string > alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::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< PeripheralEndpointModeControllerHandler > alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::create ( const std::string &  endpointName,
const std::string &  instance 
)
static

Create a PeripheralEndpointModeControllerHandler object.

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

◆ getConfiguration()

ModeControllerInterface::ModeControllerConfiguration alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::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::PeripheralEndpointModeControllerHandler::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::PeripheralEndpointModeControllerHandler::removeObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > &  observer)
override

◆ setMode() [1/2]

void alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::setMode ( const std::string &  mode)

Set the mode the controller.

Parameters
modeMode of the controller.

◆ setMode() [2/2]

std::pair< AlexaResponseType, std::string > alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::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_BLUE

const std::string alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::MODE_CONTROLLER_MODE_BLUE = "Blue"
static

The mode 'Blue' of the controller.

◆ MODE_CONTROLLER_MODE_GREEN

const std::string alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::MODE_CONTROLLER_MODE_GREEN = "Green"
static

The mode 'Green' of the controller.

◆ MODE_CONTROLLER_MODE_RED

const std::string alexaClientSDK::sampleApp::PeripheralEndpointModeControllerHandler::MODE_CONTROLLER_MODE_RED = "Red"
static

The mode 'Red' of the controller.


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