Astarte device API for C++ 0.8.1
Astarte device SDK for C++
Loading...
Searching...
No Matches
astarte::device::mqtt Namespace Reference

Namespace for Astarte device functionality using the MQTT transport protocol. More...

Classes

class  Config
 Configuration for the Astarte MQTT connection. More...
 
class  CryptoError
 Specific error for when an operation failed due to an internal error. More...
 
class  DeviceMqtt
 MQTT implementation of an Astarte device. More...
 
class  DeviceRegistrationError
 Specific error for when an operation failed due to an internal error. More...
 
class  HttpError
 Specific error for when an operation failed due to an internal error. More...
 
class  InvalidUrlError
 Specific error for when an operation failed due to an internal error. More...
 
class  JsonParsingError
 Specific error for when an operation failed due to an internal error. More...
 
class  MqttConnectionError
 Specific MQTT connection error. More...
 
class  MqttError
 Specific error for when an operation failed due to an internal error. More...
 
class  PairingApi
 Class providing the methods to perform the Astarte pairing operations. More...
 
class  PairingApiError
 Specific error for when an operation failed due to an internal error. More...
 
class  PairingConfigError
 Specific error for when the configuration to connect the device to Astarte is invalid. More...
 
class  ReadCredentialError
 Specific error for when reading from a file. More...
 
class  RetrieveBrokerUrlError
 Specific error for when an operation failed due to an internal error. More...
 
class  UuidError
 Specific error for when a UUID operation failed. More...
 
class  WriteCredentialError
 Specific error for when writing to a file. More...
 

Functions

auto create_random_device_id () -> std::string
 Creates a random Astarte device id starting from a UUIDv4.
 
auto create_deterministic_device_id (std::string_view namespc, std::string_view unique_data) -> astarte_tl::expected< std::string, Error >
 Creates a deterministic Astarte device id using a UUIDv5.
 

Variables

constexpr uint32_t DEFAULT_KEEP_ALIVE = 30
 Default keep alive interval in seconds for the MQTT connection.
 
constexpr uint32_t DEFAULT_CONNECTION_TIMEOUT = 5
 Default connection timeout in seconds for the MQTT connection.
 
constexpr auto DEFAULT_DISCONNECTION_TIMEOUT = 1s
 Default disconnection timeout in seconds for the MQTT connection.
 

Detailed Description

Namespace for Astarte device functionality using the MQTT transport protocol.

Function Documentation

◆ create_deterministic_device_id()

auto astarte::device::mqtt::create_deterministic_device_id ( std::string_view namespc,
std::string_view unique_data ) -> astarte_tl::expected< std::string, Error >

Creates a deterministic Astarte device id using a UUIDv5.

Generates a deterministic Astarte device id following Astarte specifications.

Parameters
[in]namespcnamespace necessary to generate a UUIDv5.
[in]unique_dataunique data necessary to generate a UUIDv5.
Returns
An expected containing the device id on success or Error on failure.

◆ create_random_device_id()

auto astarte::device::mqtt::create_random_device_id ( ) -> std::string

Creates a random Astarte device id starting from a UUIDv4.

Generates a random Astarte device id following Astarte specifications.

Returns
A string containing the device id.

Variable Documentation

◆ DEFAULT_CONNECTION_TIMEOUT

uint32_t astarte::device::mqtt::DEFAULT_CONNECTION_TIMEOUT = 5
constexpr

Default connection timeout in seconds for the MQTT connection.

◆ DEFAULT_DISCONNECTION_TIMEOUT

auto astarte::device::mqtt::DEFAULT_DISCONNECTION_TIMEOUT = 1s
constexpr

Default disconnection timeout in seconds for the MQTT connection.

◆ DEFAULT_KEEP_ALIVE

uint32_t astarte::device::mqtt::DEFAULT_KEEP_ALIVE = 30
constexpr

Default keep alive interval in seconds for the MQTT connection.