AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SoftwareInfoSendRequest.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 ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_SOFTWAREINFOSENDREQUEST_H_
17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_SOFTWAREINFOSENDREQUEST_H_
18 
19 #include <cstdint>
20 #include <memory>
21 #include <mutex>
22 #include <string>
23 
29 
31 
32 namespace alexaClientSDK {
33 namespace capabilityAgents {
34 namespace system {
35 
45  , public std::enable_shared_from_this<SoftwareInfoSendRequest> {
46 public:
55  static std::shared_ptr<SoftwareInfoSendRequest> create(
57  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
58  std::shared_ptr<avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface> observer);
59 
63  void send();
64 
68  void onExceptionReceived(const std::string& message) override;
70 
73  void doShutdown() override;
75 
76 private:
87  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
88  std::shared_ptr<avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface> observer);
89 
97  static bool buildJsonForSoftwareInfo(
98  std::string* jsonContent,
100 
103 
105  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> m_messageSender;
106 
111  std::shared_ptr<avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface> m_observer;
112 
114  std::mutex m_mutex;
115 
120  int m_retryCounter;
121 
130  avsCommon::utils::timing::Timer m_retryTimers[2];
131 };
132 
133 } // namespace system
134 } // namespace capabilityAgents
135 } // namespace alexaClientSDK
136 
137 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_SOFTWAREINFOSENDREQUEST_H_
void onSendCompleted(avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status status) override
Definition: SoftwareInfoSendRequest.cpp:92
void doShutdown() override
Definition: SoftwareInfoSendRequest.cpp:126
void send()
Definition: SoftwareInfoSendRequest.cpp:152
void onExceptionReceived(const std::string &message) override
Definition: SoftwareInfoSendRequest.cpp:122
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
int32_t FirmwareVersion
Type to use to communicate a firmware version.
Definition: SoftwareInfoSenderObserverInterface.h:29
Status
Definition: MessageRequestObserverInterface.h:33
static std::shared_ptr< SoftwareInfoSendRequest > create(avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface > observer)
Definition: SoftwareInfoSendRequest.cpp:72

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