AWS IoT Device SDK C++ v2: Aws::Iot::MqttClient Class Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Public Member Functions | List of all members
Aws::Iot::MqttClient Class Referencefinal

`#include <MqttClient.h>`

## Public Member Functions
| MqttClient (Crt::Io::ClientBootstrap &bootstrap, Crt::Allocator *allocator=Crt::g_allocator) noexcept
std::shared_ptr< Crt::Mqtt::MqttConnection > | NewConnection (const MqttClientConnectionConfig &config) noexcept
int | LastError () const noexcept
| operator bool () const noexcept

## Detailed Description

AWS IOT specific Mqtt Client. Sets defaults for using the AWS IOT service. You'll need an instance of MqttClientConnectionConfig to use. Once NewConnection returns, you use it's return value identically to how you would use Aws::Crt::Mqtt::MqttConnection

## Constructor & Destructor Documentation

## ◆ MqttClient()

Aws::Iot::MqttClient::MqttClient | ( | Crt::Io::ClientBootstrap & | bootstrap,
|  | Crt::Allocator * | allocator = `Crt::g_allocator`
| ) |  |
| noexcept

## Member Function Documentation

## ◆ LastError()

int Aws::Iot::MqttClient::LastError | ( |  | ) | const
| inlinenoexcept

Returns
  the value of the last aws error encountered by operations on this instance.

## ◆ NewConnection()

std::shared_ptr< Crt::Mqtt::MqttConnection > Aws::Iot::MqttClient::NewConnection | ( | const MqttClientConnectionConfig & | config | ) |
| noexcept

Creates a new mqtt connection from a connection configuration object

Parameters

  config | mqtt connection configuration

Returns
  a new mqtt connection

## ◆ operator bool()

Aws::Iot::MqttClient::operator bool | ( |  | ) | const
| inlineexplicitnoexcept

Returns
  true if the instance is in a valid state, false otherwise.

The documentation for this class was generated from the following files:

- crt/aws-crt-cpp/include/aws/iot/MqttClient.h
- crt/aws-crt-cpp/source/iot/MqttClient.cpp