AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DeviceInfo.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_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_DEVICEINFO_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_DEVICEINFO_H_
18 
19 #include <string>
20 
23 
24 namespace alexaClientSDK {
25 namespace avsCommon {
26 namespace utils {
27 
31 class DeviceInfo {
32 public:
39  static std::shared_ptr<DeviceInfo> createFromConfiguration(
40  const std::shared_ptr<avsCommon::utils::configuration::ConfigurationNode>& configurationRoot);
41 
49  static std::unique_ptr<DeviceInfo> create(
51 
66  static std::unique_ptr<DeviceInfo> create(
67  const std::string& clientId,
68  const std::string& productId,
69  const std::string& deviceSerialNumber,
70  const std::string& manufacturerName,
71  const std::string& description,
72  const std::string& friendlyName = "",
73  const std::string& deviceType = "",
75  const std::string& registrationKey = "",
76  const std::string& productIdKey = "");
77 
83  std::string getClientId() const;
84 
90  std::string getProductId() const;
91 
97  std::string getDeviceSerialNumber() const;
98 
104  std::string getManufacturerName() const;
105 
111  std::string getDeviceDescription() const;
112 
118  std::string getFriendlyName() const;
119 
125  std::string getDeviceType() const;
126 
133 
139  std::string getRegistrationKey() const;
140 
146  std::string getProductIdKey() const;
147 
154  bool operator==(const DeviceInfo& rhs);
155 
162  bool operator!=(const DeviceInfo& rhs);
163 
164 private:
177  DeviceInfo(
178  const std::string& clientId,
179  const std::string& productId,
180  const std::string& deviceSerialNumber,
181  const std::string& manufacturerName,
182  const std::string& description,
183  const std::string& friendlyName,
184  const std::string& deviceType,
186  const std::string& registrationKey,
187  const std::string& productIdKey);
188 
190  std::string m_clientId;
191 
193  std::string m_productId;
194 
196  std::string m_deviceSerialNumber;
197 
199  std::string m_manufacturer;
200 
202  std::string m_deviceDescription;
203 
205  std::string m_friendlyName;
206 
208  std::string m_deviceType;
209 
212 
214  std::string m_registrationKey;
215 
217  std::string m_productIdKey;
218 };
219 
220 inline std::string DeviceInfo::getManufacturerName() const {
221  return m_manufacturer;
222 }
223 
224 inline std::string DeviceInfo::getDeviceDescription() const {
225  return m_deviceDescription;
226 }
227 
229  return m_defaultEndpointId;
230 }
231 
232 } // namespace utils
233 } // namespace avsCommon
234 } // namespace alexaClientSDK
235 
236 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_DEVICEINFO_H_
std::string getManufacturerName() const
Definition: DeviceInfo.h:220
std::string getDeviceSerialNumber() const
Definition: DeviceInfo.cpp:239
std::string getDeviceDescription() const
Definition: DeviceInfo.h:224
static std::shared_ptr< DeviceInfo > createFromConfiguration(const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot)
Definition: DeviceInfo.cpp:78
bool operator==(const DeviceInfo &rhs)
Definition: DeviceInfo.cpp:259
std::string getFriendlyName() const
Definition: DeviceInfo.cpp:243
std::string getDeviceType() const
Definition: DeviceInfo.cpp:247
bool operator!=(const DeviceInfo &rhs)
Definition: DeviceInfo.cpp:280
std::string getProductId() const
Definition: DeviceInfo.cpp:235
static std::unique_ptr< DeviceInfo > create(const avsCommon::utils::configuration::ConfigurationNode &configurationRoot)
Definition: DeviceInfo.cpp:87
std::string getProductIdKey() const
Definition: DeviceInfo.cpp:255
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string getClientId() const
Definition: DeviceInfo.cpp:231
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
std::string getRegistrationKey() const
Definition: DeviceInfo.cpp:251
sdkInterfaces::endpoints::EndpointIdentifier getDefaultEndpointId() const
Definition: DeviceInfo.h:228

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