|
Astarte device API for C++ 0.8.1
Astarte device SDK for C++
|
Class providing the methods to perform the Astarte pairing operations. More...
#include <pairing.hpp>
Public Member Functions | |
| auto | register_device (std::string_view pairing_token, std::chrono::milliseconds timeout_ms=0ms) const -> astarte_tl::expected< std::string, Error > |
| Registers a device. | |
| auto | get_broker_url (std::string_view credential_secret, int timeout_ms=0) const -> astarte_tl::expected< std::string, Error > |
| Retrieves the URL of the Astarte MQTT broker. | |
| auto | get_device_key_and_certificate (std::string_view credential_secret, int timeout_ms=0) const -> astarte_tl::expected< std::tuple< std::string, std::string >, Error > |
| Retrieves the Astarte device certificate and relative private key. | |
| auto | device_cert_valid (std::string_view certificate, std::string_view credential_secret, int timeout_ms=0) const -> astarte_tl::expected< bool, Error > |
| Checks if the Astarte device certificate is valid. | |
Static Public Member Functions | |
| static auto | create (std::string_view realm, std::string_view device_id, std::string_view astarte_base_url) -> astarte_tl::expected< PairingApi, Error > |
| Creates an instance of the PairingApi class. | |
Class providing the methods to perform the Astarte pairing operations.
This class handles interactions with the Astarte Pairing API, including device registration and fetching MQTT broker credentials or certificates.
|
static |
Creates an instance of the PairingApi class.
| [in] | realm | The Astarte realm name. |
| [in] | device_id | The Astarte device id. |
| [in] | astarte_base_url | string containing the Astarte pairing API URL. |
|
nodiscard |
Checks if the Astarte device certificate is valid.
| [in] | certificate | The Astarte device certificate. |
| [in] | credential_secret | The Astarte device credential necessary to authenticate to the broker. |
| [in] | timeout_ms | A timeout value to perform the HTTP request. |
|
nodiscard |
Retrieves the URL of the Astarte MQTT broker.
| [in] | credential_secret | The Astarte device credential necessary to authenticate to the broker. |
| [in] | timeout_ms | A timeout value to perform the HTTP request. |
|
nodiscard |
Retrieves the Astarte device certificate and relative private key.
| [in] | credential_secret | The Astarte device credential necessary to authenticate to the broker. |
| [in] | timeout_ms | A timeout value to perform the HTTP request. |
|
nodiscard |
Registers a device.
| [in] | pairing_token | The Astarte pairing token. |
| [in] | timeout_ms | A timeout value to perform the HTTP request. |