AlexaClientSDK  1.26.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::sampleApp::PeripheralEndpointPowerControllerHandler Class Reference

#include <PeripheralEndpointPowerControllerHandler.h>

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

Public Member Functions

void setPowerState (bool powerState)
 
PowerControllerInterface methods
std::pair< avsCommon::avs::AlexaResponseType, std::string > setPowerState (bool state, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
 
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::powerController::PowerControllerInterface::PowerState > > getPowerState () override
 
bool addObserver (std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface > observer) override
 
void removeObserver (const std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface > &observer) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerInterface
virtual ~PowerControllerInterface ()=default
 
virtual bool addObserver (std::shared_ptr< PowerControllerObserverInterface > observer)=0
 
virtual void removeObserver (const std::shared_ptr< PowerControllerObserverInterface > &observer)=0
 

Static Public Member Functions

static std::shared_ptr< PeripheralEndpointPowerControllerHandlercreate (const std::string &endpointName)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerInterface
using PowerState = avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface::PowerState
 

Detailed Description

An implementation of an PowerControllerInterface.

Member Function Documentation

◆ addObserver()

bool alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::addObserver ( std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface observer)
override

◆ create()

std::shared_ptr< PeripheralEndpointPowerControllerHandler > alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::create ( const std::string &  endpointName)
static

Create a PeripheralEndpointPowerControllerHandler object.

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

◆ getPowerState()

std::pair< AlexaResponseType, avsCommon::utils::Optional< PowerControllerInterface::PowerState > > alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::getPowerState ( )
overridevirtual

Get the current power state of the endpoint.

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

Implements alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerInterface.

◆ removeObserver()

void alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::removeObserver ( const std::shared_ptr< avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface > &  observer)
override

◆ setPowerState() [1/2]

void alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::setPowerState ( bool  powerState)

Set the power state of the controller.

Parameters
powerStateThe power state of the controller. true indicates ON and false as OFF.

◆ setPowerState() [2/2]

std::pair< AlexaResponseType, std::string > alexaClientSDK::sampleApp::PeripheralEndpointPowerControllerHandler::setPowerState ( bool  powerState,
avsCommon::sdkInterfaces::AlexaStateChangeCauseType  cause 
)
overridevirtual

Set the power state of the endpoint.

Parameters
powerStateThe desired power state of the endpoint, true indicates 'ON' and false as 'OFF'
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 string with log message that would be logged in cloud for debugging purpose.

Implements alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerInterface.


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