![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <PowerControllerInterface.h>
Public Types | |
using | PowerState = avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface::PowerState |
Public Member Functions | |
virtual | ~PowerControllerInterface ()=default |
virtual std::pair< avsCommon::avs::AlexaResponseType, std::string > | setPowerState (bool powerState, AlexaStateChangeCauseType cause)=0 |
virtual std::pair< avsCommon::avs::AlexaResponseType, utils::Optional< PowerState > > | getPowerState ()=0 |
virtual bool | addObserver (std::shared_ptr< PowerControllerObserverInterface > observer)=0 |
virtual void | removeObserver (const std::shared_ptr< PowerControllerObserverInterface > &observer)=0 |
The PowerControllerInterface carries out power controller actions such as turning the endpoint ‘ON’ or ‘OFF’.
An implementation of the PowerControllerInterface controls the endpoint’s power state and may allow its methods to be called by multiple callers; for example the Alexa Capability Agent or the application’s GUI.
using alexaClientSDK::avsCommon::sdkInterfaces::powerController::PowerControllerInterface::PowerState = avsCommon::sdkInterfaces::powerController::PowerControllerObserverInterface::PowerState |
|
virtualdefault |
Virtual destructor to assure proper cleanup of derived types.
|
pure virtual |
Adds a PowerControllerObserverInterface
observer.
PowerControllerObserverInterface
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.observer | The pointer to the PowerControllerObserverInterface . |
true
if the object supports observer notification and observer was successfully added; otherwise, return false
|
pure virtual |
Get the current power state of the endpoint.
AlexaResponseType::SUCCESS
and PowerState
otherwise returns a pair with the appropriate reason from AlexaResponseType
and a empty PowerState
Implemented in alexaClientSDK::sampleApplications::common::PeripheralEndpointPowerControllerHandler.
|
pure virtual |
Removes a observer of PowerControllerObserverInterface
.
observer | The pointer to the PowerControllerObserverInterface . |
|
pure virtual |
Set the power state of the endpoint.
powerState | The desired power state of the endpoint, true indicates 'ON' and false as 'OFF' |
cause | The cause type for this action represented using AlexaStateChangeCauseType . |
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. Implemented in alexaClientSDK::sampleApplications::common::PeripheralEndpointPowerControllerHandler.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0