AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
DiscoveryClient.h
Go to the documentation of this file.
1 #pragma once
2 
7 
9 
10 namespace Aws
11 {
12  namespace Discovery
13  {
14  using OnDiscoverResponse = std::function<void(DiscoverResponse *, int errorCode, int httpResponseCode)>;
15 
17  {
18  public:
19  DiscoveryClientConfig() noexcept;
22 
25 
27 
33 
39 
45 
51 
56 
62 
68  };
69 
71  {
72  public:
73  bool Discover(const Crt::String &thingName, const OnDiscoverResponse &onDiscoverResponse) noexcept;
74 
75  static std::shared_ptr<DiscoveryClient> CreateClient(
76  const DiscoveryClientConfig &config,
77  Crt::Allocator *allocator = Crt::DefaultAllocator());
78 
79  private:
80  DiscoveryClient(const DiscoveryClientConfig &config, Crt::Allocator *allocator) noexcept;
81 
82  std::shared_ptr<Crt::Http::HttpClientConnectionManager> m_connectionManager;
83  Crt::String m_hostName;
84  Crt::Allocator *m_allocator;
85  };
86  } // namespace Discovery
87 } // namespace Aws
Aws::Discovery::DiscoveryClientConfig
Definition: DiscoveryClient.h:17
Aws::Discovery::DiscoveryClientConfig::operator=
DiscoveryClientConfig & operator=(DiscoveryClientConfig &&rhs)=default
Aws::Discovery::DiscoveryClientConfig::MaxConnections
size_t MaxConnections
Definition: DiscoveryClient.h:55
HttpConnectionManager.h
DiscoverResponse.h
Aws::Discovery::DiscoveryClientConfig::~DiscoveryClientConfig
~DiscoveryClientConfig()=default
Aws::Discovery::DiscoveryClientConfig::ProxyOptions
Crt::Optional< Crt::Http::HttpClientConnectionProxyOptions > ProxyOptions
Definition: DiscoveryClient.h:61
Aws::Discovery::DiscoveryClientConfig::DiscoveryClientConfig
DiscoveryClientConfig(const DiscoveryClientConfig &rhs)=default
AWS_DISCOVERY_API
#define AWS_DISCOVERY_API
Definition: Exports.h:19
Aws::Discovery::DiscoveryClientConfig::ggServerName
Crt::Optional< Crt::String > ggServerName
Definition: DiscoveryClient.h:67
Aws::Discovery::DiscoveryClientConfig::DiscoveryClientConfig
DiscoveryClientConfig(DiscoveryClientConfig &&rhs)=default
Aws::Discovery::DiscoveryClientConfig::Region
Crt::String Region
Definition: DiscoveryClient.h:50
Aws::Discovery::DiscoveryClientConfig::operator=
DiscoveryClientConfig & operator=(const DiscoveryClientConfig &rhs)=default
Aws::Crt::Optional
Definition: Optional.h:18
Aws::Crt::DefaultAllocator
AWS_CRT_CPP_API Allocator * DefaultAllocator() noexcept
Definition: Allocator.cpp:17
Aws::Discovery::DiscoveryClientConfig::SocketOptions
Crt::Io::SocketOptions SocketOptions
Definition: DiscoveryClient.h:44
Aws::Crt::Io::SocketOptions
Definition: SocketOptions.h:48
Aws::Discovery::DiscoveryClientConfig::Bootstrap
Crt::Io::ClientBootstrap * Bootstrap
Definition: DiscoveryClient.h:32
Aws
Definition: Allocator.h:11
Aws::Crt::Allocator
aws_allocator Allocator
Definition: Allocator.h:14
Aws::Discovery::OnDiscoverResponse
std::function< void(DiscoverResponse *, int errorCode, int httpResponseCode)> OnDiscoverResponse
Definition: DiscoveryClient.h:14
Aws::Crt::Io::ClientBootstrap
Definition: Bootstrap.h:35
Aws::Discovery::DiscoveryClient
Definition: DiscoveryClient.h:71
Aws::Crt::String
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition: Types.h:45
Aws::Discovery::DiscoveryClientConfig::TlsContext
Crt::Optional< Crt::Io::TlsContext > TlsContext
Definition: DiscoveryClient.h:38
Aws::Discovery::DiscoverResponse
Definition: DiscoverResponse.h:13