AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
PeripheralEndpointRangeControllerHandler.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_PERIPHERALENDPOINT_PERIPHERALENDPOINTRANGECONTROLLERHANDLER_H_
17 #define ACSDK_SAMPLE_PERIPHERALENDPOINT_PERIPHERALENDPOINTRANGECONTROLLERHANDLER_H_
18 
19 #include <list>
20 
23 
24 namespace alexaClientSDK {
25 namespace sampleApplications {
26 namespace common {
27 
33 public:
41  static std::shared_ptr<PeripheralEndpointRangeControllerHandler> create(
42  const std::string& endpointName,
43  const std::string& instance);
44 
48  override;
49  std::pair<avsCommon::avs::AlexaResponseType, std::string> setRangeValue(
50  double value,
52  std::pair<avsCommon::avs::AlexaResponseType, std::string> adjustRangeValue(
53  double value,
55  std::pair<
58  getRangeState() override;
59  bool addObserver(
60  std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface> observer) override;
61  void removeObserver(
62  const std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface>& observer)
63  override;
65 
71  void setRangeValue(double value);
72 
73 private:
80  PeripheralEndpointRangeControllerHandler(const std::string& endpointName, const std::string& instance);
81 
83  std::string m_endpointName;
84 
86  std::string m_instance;
87 
89  double m_currentRangeValue;
90 
92  double m_maximumRangeValue;
93 
95  double m_minmumRangeValue;
96 
98  double m_precision;
99 
101  std::mutex m_mutex;
102 
104  std::list<std::shared_ptr<avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface>> m_observers;
105 };
106 
107 } // namespace common
108 } // namespace sampleApplications
109 } // namespace alexaClientSDK
110 
111 #endif // ACSDK_SAMPLE_PERIPHERALENDPOINT_PERIPHERALENDPOINTRANGECONTROLLERHANDLER_H_
AlexaResponseType
Definition: AlexaResponseType.h:30
::std::string string
Definition: gtest-port.h:1097
avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeControllerConfiguration getConfiguration() override
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
std::pair< avsCommon::avs::AlexaResponseType, std::string > adjustRangeValue(double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
Definition: PeripheralEndpointRangeControllerHandler.h:31
static std::shared_ptr< PeripheralEndpointRangeControllerHandler > create(const std::string &endpointName, const std::string &instance)
std::pair< avsCommon::avs::AlexaResponseType, std::string > setRangeValue(double value, avsCommon::sdkInterfaces::AlexaStateChangeCauseType cause) override
Definition: common.py:1
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool addObserver(std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > observer) override
std::pair< avsCommon::avs::AlexaResponseType, avsCommon::utils::Optional< avsCommon::sdkInterfaces::rangeController::RangeControllerInterface::RangeState > > getRangeState() override
void removeObserver(const std::shared_ptr< avsCommon::sdkInterfaces::rangeController::RangeControllerObserverInterface > &observer) override

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