|
Astarte device API for C++ 0.8.1
Astarte device SDK for C++
|
Configuration for the Astarte MQTT connection. More...
#include <config.hpp>
Public Member Functions | |
| Config (Config &&other) noexcept | |
| Move constructor. | |
| auto | operator= (Config &&other) noexcept -> Config & |
| Move assignment operator. | |
| Config (const Config &)=delete | |
| Config is non-copyable. | |
| auto | operator= (const Config &) -> Config &=delete |
| Config is non-copyable. | |
| ~Config () | |
| Destructor. | |
| auto | realm () -> std::string_view |
| Gets the configured realm. | |
| auto | device_id () -> std::string_view |
| Gets the configured device ID. | |
| auto | pairing_url () -> std::string_view |
| Gets the configured Pairing API URL. | |
| auto | cred_is_credential_secret () -> bool |
| Checks if the credential is of type credential secret. | |
| auto | credential_secret () -> std::optional< std::string > |
| Retrieves the credential value. | |
| auto | store_dir () -> std::string_view |
| Gets the configured store directory. | |
| auto | keepalive (uint32_t duration) -> Config & |
| Sets the MQTT keep-alive interval. | |
| auto | ignore_ssl_errors () -> Config & |
| Configures the client to ignore TLS/SSL certificate validation errors. | |
| auto | connection_timeout (uint32_t duration) -> Config & |
| Sets the MQTT connection timeout. | |
| auto | disconnection_timeout (std::chrono::milliseconds duration) -> Config & |
| Sets the MQTT disconnection timeout. | |
| auto | keepalive () const -> uint32_t |
| Gets the MQTT keep-alive interval. | |
| auto | connection_timeout () const -> uint32_t |
| Gets the MQTT connection timeout. | |
| auto | disconnection_timeout () const -> std::chrono::milliseconds |
| Gets the MQTT disconnection timeout. | |
Static Public Member Functions | |
| static auto | with_credential_secret (std::string_view realm, std::string_view device_id, std::string_view credential, std::string_view pairing_url, std::string_view store_dir) -> Config |
| Creates a new Config instance using a credential secret. | |
Configuration for the Astarte MQTT connection.
This class holds all necessary settings for connecting a device to Astarte via MQTT. It uses a builder pattern, allowing for fluent and readable configuration.
|
noexcept |
Move constructor.
| [in,out] | other | The config instance to move data from. |
| astarte::device::mqtt::Config::~Config | ( | ) |
Destructor.
|
inlinenodiscard |
Gets the MQTT connection timeout.
|
inline |
Sets the MQTT connection timeout.
| [in] | duration | The timeout duration in seconds. |
|
nodiscard |
Checks if the credential is of type credential secret.
|
nodiscard |
Retrieves the credential value.
|
inlinenodiscard |
Gets the configured device ID.
|
inlinenodiscard |
Gets the MQTT disconnection timeout.
|
inline |
Sets the MQTT disconnection timeout.
| [in] | duration | The timeout duration in milliseconds. |
|
inline |
Configures the client to ignore TLS/SSL certificate validation errors.
|
inlinenodiscard |
Gets the MQTT keep-alive interval.
|
inline |
Sets the MQTT keep-alive interval.
| [in] | duration | The keep-alive duration in seconds. |
Move assignment operator.
| [in,out] | other | The config instance to move data from. |
Config is non-copyable.
|
inlinenodiscard |
Gets the configured Pairing API URL.
|
inlinenodiscard |
Gets the configured realm.
|
inlinenodiscard |
Gets the configured store directory.
|
staticnodiscard |
Creates a new Config instance using a credential secret.
| [in] | realm | The Astarte realm. |
| [in] | device_id | The device's unique ID. |
| [in] | credential | The credential secret string. |
| [in] | pairing_url | The base URL of the Astarte pairing API. |
| [in] | store_dir | Path to a local directory for persisting state. |