Mqtt backend configuration strcuture types and APIs.
More...
#include <stddef.h>
#include <stdbool.h>
Go to the source code of this file.
|
|
#define | MQTT_CONFIG_SERVER_URL_LEN (64) |
| | Maximum server URL length (not counting the termination byte)
|
| |
|
#define | MQTT_CONFIG_SERVER_URL_DEFAULT "default" |
| | Special value for the default server URL (determined by firmware)
|
| |
Mqtt backend configuration strcuture types and APIs.
◆ MqttClientCertType
Enumeration of supported client certificate types.
- Note
- To use custom certificates, put the files into the following locations:
- /ext/apps_assets/mqtt/device.crt : custom certificate
- /ext/apps_assets/mqtt/device.key : private key
| Enumerator |
|---|
| MqttClientCertTypeDefault | Built-in certificate.
|
| MqttClientCertTypeCustom | User-specified certificate.
|
| MqttClientCertTypeNone | No certificate.
|
| MqttClientCertTypeMax | Special value, internal use.
|
◆ mqtt_config_deserialize()
| bool mqtt_config_deserialize |
( |
MqttConfig * | config, |
|
|
const char * | json_text, |
|
|
size_t | json_text_len ) |
Construct a MqttConfig object from its JSON representation.
- Note
- Data pointed to by
json_text may either be 0-terminated or not, provided that json_text_len is correct.
- Parameters
-
| [out] | config | pointer to the config to be constructed (must be allocated) |
| [in] | json_text | pointer to a character array containing the JSON representation |
| [in] | json_text_len | length of the json_text |
◆ mqtt_config_is_valid()
| bool mqtt_config_is_valid |
( |
const MqttConfig * | config | ) |
|
Check whether a MqttConfig object has valid field values.
- Parameters
-
| [in] | config | pointer to the config to be checked |
- Returns
true if the config is valid, false otherwise
◆ mqtt_config_serialize()
| char * mqtt_config_serialize |
( |
const MqttConfig * | config | ) |
|
Convert the MqttConfig object to a JSON representation.
- Note
- The calling code is responsible for deleting the returned value when it is done with it
- Parameters
-
| [in] | config | pointer to the config to be serialized |
- Returns
- pointer to a 0-terminated string on success,
NULL on failure