Astarte Device SDK ESP32
ESP32 device SDK for the Astarte platform
|
Astarte pairing functions. More...
Go to the source code of this file.
Data Structures | |
struct | astarte_pairing_config |
Functions | |
astarte_err_t | astarte_pairing_get_credentials_secret (const struct astarte_pairing_config *config, char *out, size_t length) |
get the credentials secret. More... | |
astarte_err_t | astarte_pairing_register_device (const struct astarte_pairing_config *config) |
register a device. More... | |
astarte_err_t | astarte_pairing_get_mqtt_v1_credentials (const struct astarte_pairing_config *config, const char *csr, char *out, size_t length) |
obtain a new Astarte MQTT v1 certificate. More... | |
astarte_err_t | astarte_pairing_get_mqtt_v1_broker_url (const struct astarte_pairing_config *config, char *out, size_t length) |
get the Astarte MQTT v1 broker URL. More... | |
Astarte pairing functions.
astarte_err_t astarte_pairing_get_credentials_secret | ( | const struct astarte_pairing_config * | config, |
char * | out, | ||
size_t | length | ||
) |
get the credentials secret.
Get the credentials secret from NVS. If it isn't present, register the device to obtain it, save it and return it.
config | A struct containing the pairing configuration. |
out | A pointer to an allocated string which the credentials secret will be written to. |
length | The length of the out buffer. |
astarte_err_t astarte_pairing_get_mqtt_v1_broker_url | ( | const struct astarte_pairing_config * | config, |
char * | out, | ||
size_t | length | ||
) |
get the Astarte MQTT v1 broker URL.
Get the URL of the broker which the device will connect to.
config | A struct containing the pairing configuration. |
out | A pointer to an allocated string where the URL will be written. |
length | The length of the out buffer. |
astarte_err_t astarte_pairing_get_mqtt_v1_credentials | ( | const struct astarte_pairing_config * | config, |
const char * | csr, | ||
char * | out, | ||
size_t | length | ||
) |
obtain a new Astarte MQTT v1 certificate.
Call Pairing API to obtain a new Astarte MQTT v1 certificate.
config | A struct containing the pairing configuration. |
csr | A PEM encoded NULL-terminated string containing the CSR |
out | A pointer to an allocated buffer where the certificat will be written. |
length | The length of the out buffer. |
astarte_err_t astarte_pairing_register_device | ( | const struct astarte_pairing_config * | config | ) |
register a device.
Perform a device registration as agent.
config | A struct containing the pairing configuration. |