AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
NetworkInfo.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 #ifndef ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_NETWORKINFO_H_
16 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_NETWORKINFO_H_
17 
18 #include <istream>
19 #include <ostream>
20 #include <string>
21 
23 
24 namespace alexaClientSDK {
25 namespace settings {
26 namespace types {
27 
31 class NetworkInfo {
32 public:
36  enum class ConnectionType {
38  ETHERNET,
40  WIFI
41  };
42 
43  template <typename T>
45 
52 
59 
66 
73 
80 
87 
94 
101 
107  void setConnectionType(const ConnectionType& connectionType);
108 
114  void setEssid(const std::string& essid);
115 
123  bool setBssid(const std::string& bssid);
124 
131  bool setIpAddress(const std::string& ipAddress);
132 
139  bool setSubnetMask(const std::string& subnetMask);
140 
148  bool setMacAddress(const std::string& macAddress);
149 
156  bool setDhcpServerAddress(const std::string& dhcpServerAddress);
157 
163  void setIsStaticIP(bool isStaticIP);
164 
168  void resetConnectionType();
169 
173  void resetEssid();
174 
178  void resetBssid();
179 
183  void resetIpAddress();
184 
188  void resetSubnetMask();
189 
193  void resetMacAddress();
194 
198  void resetDhcpServerAddress();
199 
203  void resetIsStaticIP();
204 
208  bool operator==(const NetworkInfo& rhs) const;
209  bool operator!=(const NetworkInfo& rhs) const;
210 
211 private:
218  bool validMacAddress(const std::string& input);
219 
226  bool validIpAddress(const std::string& input);
227 
234  bool validSubnetMask(const std::string& input);
235 
237  Optional<ConnectionType> m_connectionType;
238 
240  Optional<std::string> m_essid;
241 
243  Optional<std::string> m_bssid;
244 
246  Optional<std::string> m_ipAddress;
247 
249  Optional<std::string> m_subnetMask;
250 
252  Optional<std::string> m_macAddress;
253 
255  Optional<std::string> m_dhcpServerAddress;
256 
258  Optional<bool> m_isStaticIP;
259 
261  friend std::ostream& operator<<(std::ostream& os, const NetworkInfo& info);
262 };
263 
271 std::ostream& operator<<(std::ostream& os, const NetworkInfo& info);
272 
280 std::istream& operator>>(std::istream& is, NetworkInfo& info);
281 
282 } // namespace types
283 } // namespace settings
284 } // namespace alexaClientSDK
285 
286 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_NETWORKINFO_H_
bool setMacAddress(const std::string &macAddress)
ConnectionType
Definition: NetworkInfo.h:36
::std::string string
Definition: gtest-port.h:1097
bool setSubnetMask(const std::string &subnetMask)
Optional< std::string > getIpAddress() const
Optional< std::string > getDhcpServerAddress() const
bool operator!=(const NetworkInfo &rhs) const
bool setBssid(const std::string &bssid)
friend std::ostream & operator<<(std::ostream &os, const NetworkInfo &info)
Friend output function.
bool operator==(const NetworkInfo &rhs) const
std::istream & operator>>(std::istream &is, AlarmVolumeRampTypes &value)
Definition: AlarmVolumeRampTypes.h:95
Optional< ConnectionType > getConnectionType() const
void setConnectionType(const ConnectionType &connectionType)
bool setDhcpServerAddress(const std::string &dhcpServerAddress)
void setEssid(const std::string &essid)
Optional< std::string > getBssid() const
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Optional< std::string > getSubnetMask() const
bool setIpAddress(const std::string &ipAddress)
Optional< std::string > getMacAddress() const
Optional< std::string > getEssid() const

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