AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DefaultEndpointModeControllerHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTMODECONTROLLERHANDLER_H_
17 #define ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTMODECONTROLLERHANDLER_H_
18 
19 #include <list>
20 
23 
24 namespace alexaClientSDK {
25 namespace sampleApplications {
26 namespace common {
27 
32 public:
35 
38 
41 
44 
47 
50 
57  static std::shared_ptr<DefaultEndpointModeControllerHandler> create(const std::string& instance);
58 
62  override;
63  std::pair<avsCommon::avs::AlexaResponseType, std::string> setMode(
64  const std::string& mode,
66  std::pair<avsCommon::avs::AlexaResponseType, std::string> adjustMode(
67  int modeDelta,
69  std::pair<
72  getMode() override;
73  bool addObserver(
74  std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface> observer) override;
75  void removeObserver(
76  const std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface>& observer)
77  override;
79 
80 private:
87 
89  std::string m_instance;
90 
92  std::string m_currentMode;
93 
95  std::vector<std::string> m_modes;
96 
98  std::mutex m_mutex;
99 
101  std::list<std::shared_ptr<avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface>> m_observers;
102 };
103 
104 } // namespace common
105 } // namespace sampleApplications
106 } // namespace alexaClientSDK
107 
108 #endif // ACSDK_SAMPLE_ENDPOINT_DEFAULTENDPOINT_DEFAULTENDPOINTMODECONTROLLERHANDLER_H_
AlexaResponseType
Definition: AlexaResponseType.h:30
std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustMode(int modeDelta, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
static const std::string MODE_CONTROLLER_MODE_FAN_ONLY
The &#39;Fan Only&#39; mode of the controller.
Definition: DefaultEndpointModeControllerHandler.h:34
::std::string string
Definition: gtest-port.h:1097
std::pair< avsCommon::avs::AlexaResponseType, std::string > setMode(const std::string &mode, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
bool addObserver(std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > observer) override
static const std::string MODE_CONTROLLER_MODE_FAN_ONLY_FRIENDLY_NAME
The friendly name of &#39;Fan Only&#39; mode.
Definition: DefaultEndpointModeControllerHandler.h:37
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
std::vector< std::string > ModeControllerConfiguration
Definition: ModeControllerInterface.h:51
avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeControllerConfiguration getConfiguration() override
void removeObserver(const std::shared_ptr< avsCommon::sdkInterfaces::modeController::ModeControllerObserverInterface > &observer) override
Definition: common.py:1
static const std::string MODE_CONTROLLER_MODE_HEAT
The &#39;HEAT&#39; mode of the controller.
Definition: DefaultEndpointModeControllerHandler.h:40
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::modeController::ModeControllerInterface::ModeState > > getMode() override
static const std::string MODE_CONTROLLER_MODE_COOL_FRIENDLY_NAME
The friendly name of &#39;Cool&#39; mode.
Definition: DefaultEndpointModeControllerHandler.h:49
static const std::string MODE_CONTROLLER_MODE_COOL
The &#39;Cool&#39; mode of the controller.
Definition: DefaultEndpointModeControllerHandler.h:46
static const std::string MODE_CONTROLLER_MODE_HEAT_FRIENDLY_NAME
The friendly name of &#39;HEAT&#39; mode.
Definition: DefaultEndpointModeControllerHandler.h:43
static std::shared_ptr< DefaultEndpointModeControllerHandler > create(const std::string &instance)

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