Astarte Device SDK ESP32
ESP32 device SDK for the Astarte platform
astarte_device.h File Reference

Astarte device SDK high level API. More...

#include "astarte.h"
#include "astarte_bson_deserializer.h"
#include "astarte_interface.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for astarte_device.h:

Go to the source code of this file.

Data Structures

struct  astarte_device_data_event_t
 
struct  astarte_device_unset_event_t
 
struct  astarte_device_connection_event_t
 
struct  astarte_device_disconnection_event_t
 
struct  astarte_device_config_t
 

Macros

#define ASTARTE_INVALID_TIMESTAMP   0
 

Typedefs

typedef struct astarte_device * astarte_device_handle_t
 
typedef void(* astarte_device_data_event_callback_t) (astarte_device_data_event_t *event)
 
typedef void(* astarte_device_connection_event_callback_t) (astarte_device_connection_event_t *event)
 
typedef void(* astarte_device_disconnection_event_callback_t) (astarte_device_disconnection_event_t *event)
 
typedef void(* astarte_device_unset_event_callback_t) (astarte_device_unset_event_t *event)
 

Functions

astarte_device_handle_t astarte_device_init (astarte_device_config_t *cfg)
 initialize Astarte device. More...
 
void astarte_device_destroy (astarte_device_handle_t device)
 destroy Astarte device. More...
 
astarte_err_t astarte_device_add_interface (astarte_device_handle_t device, const astarte_interface_t *interface)
 add an interface to the device. More...
 
astarte_err_t astarte_device_start (astarte_device_handle_t device)
 start Astarte device. More...
 
astarte_err_t astarte_device_stop (astarte_device_handle_t device)
 stop Astarte device. More...
 
astarte_err_t astarte_device_stream_double (astarte_device_handle_t device, const char *interface_name, const char *path, double value, int qos)
 send a double value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_double_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, double value, uint64_t ts_epoch_millis, int qos)
 send a double value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_integer (astarte_device_handle_t device, const char *interface_name, const char *path, int32_t value, int qos)
 send a 32 bit integer value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_integer_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, int32_t value, uint64_t ts_epoch_millis, int qos)
 send a 32 bit integer value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_longinteger (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value, int qos)
 send a 64 bit integer value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_longinteger_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value, uint64_t ts_epoch_millis, int qos)
 send a 64 bit integer value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_boolean (astarte_device_handle_t device, const char *interface_name, const char *path, bool value, int qos)
 send a boolean value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_boolean_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, bool value, uint64_t ts_epoch_millis, int qos)
 send a boolean value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_string (astarte_device_handle_t device, const char *interface_name, const char *path, const char *value, int qos)
 send a UTF8 encoded string on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_string_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const char *value, uint64_t ts_epoch_millis, int qos)
 send a UTF8 encoded string on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_binaryblob (astarte_device_handle_t device, const char *interface_name, const char *path, void *value, size_t size, int qos)
 send a binary value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_binaryblob_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, void *value, size_t size, uint64_t ts_epoch_millis, int qos)
 send a binary value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_datetime (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value, int qos)
 send a datetime value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_datetime_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value, uint64_t ts_epoch_millis, int qos)
 send a datetime value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_double_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const double *values, int count, uint64_t ts_epoch_millis, int qos)
 send a double array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_double_array (astarte_device_handle_t device, const char *interface_name, const char *path, const double *values, int count, uint64_t ts_epoch_millis, int qos)
 send a double array value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_integer_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const int32_t *values, int count, uint64_t ts_epoch_millis, int qos)
 send a 32 bit integer array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_integer_array (astarte_device_handle_t device, const char *interface_name, const char *path, const int32_t *values, int count, int qos)
 send a 32 bit integer array value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_longinteger_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const int64_t *values, int count, uint64_t ts_epoch_millis, int qos)
 send a 64 bit integer array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_longinteger_array (astarte_device_handle_t device, const char *interface_name, const char *path, const int64_t *values, int count, int qos)
 send a 64 bit integer array value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_boolean_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const bool *values, int count, uint64_t ts_epoch_millis, int qos)
 send a boolean array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_boolean_array (astarte_device_handle_t device, const char *interface_name, const char *path, const bool *values, int count, int qos)
 send a boolean array value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_string_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const char *const *values, int count, uint64_t ts_epoch_millis, int qos)
 send a string array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_string_array (astarte_device_handle_t device, const char *interface_name, const char *path, const char *const *values, int count, int qos)
 send a string array value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_binaryblob_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const void *const *values, const int *sizes, int count, uint64_t ts_epoch_millis, int qos)
 send a binary blob array value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_binaryblob_array (astarte_device_handle_t device, const char *interface_name, const char *path, const void *const *values, const int *sizes, int count, int qos)
 send a binary blob array value on a datastream endpoint with an explicit timestamp. More...
 
astarte_err_t astarte_device_stream_datetime_array_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path, const int64_t *values, int count, uint64_t ts_epoch_millis, int qos)
 send a datetime value on a datastream endpoint with an explicit timestamp. More...
 
static astarte_err_t astarte_device_stream_datetime_array (astarte_device_handle_t device, const char *interface_name, const char *path, const int64_t *values, int count, int qos)
 send a datetime value on a datastream endpoint. More...
 
astarte_err_t astarte_device_stream_aggregate (astarte_device_handle_t device, const char *interface_name, const char *path_prefix, const void *bson_document, int qos)
 send an aggregate value on a datastream endpoint of an interface with object aggregation. More...
 
astarte_err_t astarte_device_stream_aggregate_with_timestamp (astarte_device_handle_t device, const char *interface_name, const char *path_prefix, const void *bson_document, uint64_t ts_epoch_millis, int qos)
 send an aggregate value on a datastream endpoint of an interface with object aggregation with an explicit timestamp. More...
 
astarte_err_t astarte_device_set_double_property (astarte_device_handle_t device, const char *interface_name, const char *path, double value)
 send a double value on a properties endpoint. More...
 
astarte_err_t astarte_device_set_integer_property (astarte_device_handle_t device, const char *interface_name, const char *path, int32_t value)
 send a 32 bit integer value on a properties endpoint. More...
 
astarte_err_t astarte_device_set_longinteger_property (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value)
 send a 64 bit integer value on a properties endpoint. More...
 
astarte_err_t astarte_device_set_boolean_property (astarte_device_handle_t device, const char *interface_name, const char *path, bool value)
 send a boolean value on a properties endpoint. More...
 
astarte_err_t astarte_device_set_string_property (astarte_device_handle_t device, const char *interface_name, const char *path, const char *value)
 send a UTF8 encoded string on a properties endpoint. More...
 
astarte_err_t astarte_device_set_binaryblob_property (astarte_device_handle_t device, const char *interface_name, const char *path, void *value, size_t size)
 send a binary value on a properties endpoint. More...
 
astarte_err_t astarte_device_set_datetime_property (astarte_device_handle_t device, const char *interface_name, const char *path, int64_t value)
 send a datetime value on a properties endpoint. More...
 
astarte_err_t astarte_device_unset_path (astarte_device_handle_t device, const char *interface_name, const char *path)
 unset a path belonging to a properties interface. More...
 
bool astarte_device_is_connected (astarte_device_handle_t device)
 check if the device is connected. More...
 
char * astarte_device_get_encoded_id (astarte_device_handle_t device)
 Get the encoded hardware ID of the device. More...
 

Detailed Description

Astarte device SDK high level API.

Function Documentation

◆ astarte_device_add_interface()

astarte_err_t astarte_device_add_interface ( astarte_device_handle_t  device,
const astarte_interface_t interface 
)

add an interface to the device.

This function has to be called before astarte_device_start to add all the needed Astarte interfaces, that will be sent in the device introspection when it connects.

Parameters
deviceA valid Astarte device handle.
interfaceA pointer to an astarte_interface_t struct describing the interface. The caller is responsible for making sure the pointed interface remains valid for the lifetime of the astarte_device. It is recommended to declare interface structs as static const.
Returns
ASTARTE_OK if the interface was succesfully added, another astarte_err_t otherwise.

◆ astarte_device_destroy()

void astarte_device_destroy ( astarte_device_handle_t  device)

destroy Astarte device.

This function destroys the device, freeing all its resources.

Parameters
deviceA valid Astarte device handle.

◆ astarte_device_get_encoded_id()

char* astarte_device_get_encoded_id ( astarte_device_handle_t  device)

Get the encoded hardware ID of the device.

Get the encoded hardware ID of the device. The string is owned by astarte_device_handle_t and it is freed when the device is closed/freed.

Parameters
deviceAn Astarte device handle.
Returns
The string containing the encoded device ID.

◆ astarte_device_init()

astarte_device_handle_t astarte_device_init ( astarte_device_config_t cfg)

initialize Astarte device.

This function has to be called to initialize the device SDK before doing anything else.

If hwid is not defined explicitly in cfg, the device will use an hwid derived from unique device features (e.g. MAC address, CPU features...). An explicit hwid can be passed in the astarte_device_config_t struct. For example, it is possible to use a UUIDv5 as hwid, using a personal UUID namespace and some custom device data to derive it.

Example:

uuid_t uuid_ns; if (uuid_from_string("de40ff58-5696-4b35-a6d6-0cc7280bcd56", uuid_ns) != 0) { ESP_LOGE(TAG, "Error while parsing namespace UUID"); }

uuid_t device_uuid; const char *unique_data = "my_unique_data" uuid_generate_v5(uuid_ns, unique_data, strlen(unique_data), device_uuid);

char hwid[32]; astarte_hwid_encode(hwid, sizeof(hwid), device_uuid);

astarte_device_config_t cfg = { .data_event_callback = astarte_data_events_handler, .hwid = hwid, };

Returns
The handle to the device, NULL if an error occurred.

◆ astarte_device_is_connected()

bool astarte_device_is_connected ( astarte_device_handle_t  device)

check if the device is connected.

check if the Astarte device is currently connected to the MQTT broker.

Parameters
deviceAn Astarte device handle.
Returns
true if the device is currently connected to the broker, false if it's not.

◆ astarte_device_set_binaryblob_property()

astarte_err_t astarte_device_set_binaryblob_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
void *  value,
size_t  size 
)

send a binary value on a properties endpoint.

This function sends a binary value on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueA pointer to the binary data to be sent.
sizeThe length in bytes of the binary data to be sent.
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_boolean_property()

astarte_err_t astarte_device_set_boolean_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
bool  value 
)

send a boolean value on a properties endpoint.

This function sends a boolean value on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (0 or 1).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_datetime_property()

astarte_err_t astarte_device_set_datetime_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value 
)

send a datetime value on a properties endpoint.

This function sends a datetime value on a path of a given properties interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent, representing the number of milliseconds since Unix epoch (1970-01-01).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_double_property()

astarte_err_t astarte_device_set_double_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
double  value 
)

send a double value on a properties endpoint.

This function sends a double value on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_integer_property()

astarte_err_t astarte_device_set_integer_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int32_t  value 
)

send a 32 bit integer value on a properties endpoint.

This function sends a 32 bit int value on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_longinteger_property()

astarte_err_t astarte_device_set_longinteger_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value 
)

send a 64 bit integer value on a properties endpoint.

This function sends a 64 bit int value on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_set_string_property()

astarte_err_t astarte_device_set_string_property ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const char *  value 
)

send a UTF8 encoded string on a properties endpoint.

This function sends a UTF8 encoded string on a path of a given properties interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (a NULL terminated string).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBCOMP for QoS 2 messages

◆ astarte_device_start()

astarte_err_t astarte_device_start ( astarte_device_handle_t  device)

start Astarte device.

This function starts the device, making it connect to the broker and perform its work.

Parameters
deviceA valid Astarte device handle.
Returns
ASTARTE_OK if the device was succesfully started, another astarte_err_t otherwise.

◆ astarte_device_stop()

astarte_err_t astarte_device_stop ( astarte_device_handle_t  device)

stop Astarte device.

This function stops the device, making it disconnect from the broker.

Parameters
deviceA valid Astarte device handle.
Returns
ASTARTE_OK if the device was succesfully stopped, another astarte_err_t otherwise.

◆ astarte_device_stream_aggregate()

astarte_err_t astarte_device_stream_aggregate ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path_prefix,
const void *  bson_document,
int  qos 
)

send an aggregate value on a datastream endpoint of an interface with object aggregation.

This function sends an aggregate value on a path of a given datastream interface. The value is represented with a BSON document that can be built with astarte_bson_serializer.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
path_prefixA string containing the path prefix of the aggregate (beginning with /). The path prefix is the common prefix of the endpoints in the aggregate interface.
bson_documentA pointer to the document buffer containing the aggregate. Here's an example of how you can obtain the bson_document for an AirSensor interface containing 3 endpoints:

astarte_bson_serializer_handle_t bs = astarte_bson_serializer_new(); astarte_bson_serializer_append_double(bs, "co2", 4.0); astarte_bson_serializer_append_double(bs, "temperature", 20.0); astarte_bson_serializer_append_double(bs, "humidity", 77.2); astarte_bson_serializer_append_end_of_document(bs); int size; const void *document = astarte_bson_serializer_get_document(bs, &size); // Use the returned buffer before destroy call astarte_bson_serializer_destroy(bs);

Parameters
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_aggregate_with_timestamp()

astarte_err_t astarte_device_stream_aggregate_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path_prefix,
const void *  bson_document,
uint64_t  ts_epoch_millis,
int  qos 
)

send an aggregate value on a datastream endpoint of an interface with object aggregation with an explicit timestamp.

This function sends an aggregate value on a path of a given datastream interface. The value is represented with a BSON document that can be built with astarte_bson_serializer.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
path_prefixA string containing the path prefix of the aggregate (beginning with /). The path prefix is the common prefix of the endpoints in the aggregate interface.
bson_documentA pointer to the document buffer containing the aggregate. Here's an example of how you can obtain the bson_document for an AirSensor interface containing 3 endpoints:

astarte_bson_serializer_handle_t bs = astarte_bson_serializer_new(); astarte_bson_serializer_append_double(bs, "co2", 4.0); astarte_bson_serializer_append_double(bs, "temperature", 20.0); astarte_bson_serializer_append_double(bs, "humidity", 77.2); astarte_bson_serializer_append_end_of_document(bs); int size; const void *document = astarte_bson_serializer_get_document(bs, &size); // Use the returned buffer before destroy call astarte_bson_serializer_destroy(bs);

Parameters
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_binaryblob()

astarte_err_t astarte_device_stream_binaryblob ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
void *  value,
size_t  size,
int  qos 
)

send a binary value on a datastream endpoint.

This function sends a binary value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueA pointer to the binary data to be sent.
sizeThe length in bytes of the binary data to be sent.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_binaryblob_array()

static astarte_err_t astarte_device_stream_binaryblob_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const void *const *  values,
const int *  sizes,
int  count,
int  qos 
)
inlinestatic

send a binary blob array value on a datastream endpoint with an explicit timestamp.

This function sends a binary blob array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of binary blobs to be sent (having each one const void * type).
sizesThe size of each binary blob that is in the given values array.
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_binaryblob_array_with_timestamp()

astarte_err_t astarte_device_stream_binaryblob_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const void *const *  values,
const int *  sizes,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a binary blob array value on a datastream endpoint with an explicit timestamp.

This function sends a binary blob array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of binary blobs to be sent (having each one const void * type).
sizesThe size of each binary blob that is in the given values array.
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_binaryblob_with_timestamp()

astarte_err_t astarte_device_stream_binaryblob_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
void *  value,
size_t  size,
uint64_t  ts_epoch_millis,
int  qos 
)

send a binary value on a datastream endpoint with an explicit timestamp.

This function sends a binary value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueA pointer to the binary data to be sent.
sizeThe length in bytes of the binary data to be sent.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_boolean()

astarte_err_t astarte_device_stream_boolean ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
bool  value,
int  qos 
)

send a boolean value on a datastream endpoint.

This function sends a boolean value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (0 or 1).
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_boolean_array()

static astarte_err_t astarte_device_stream_boolean_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const bool *  values,
int  count,
int  qos 
)
inlinestatic

send a boolean array value on a datastream endpoint.

This function sends a boolean array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of booleans to be sent (false or true).
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_boolean_array_with_timestamp()

astarte_err_t astarte_device_stream_boolean_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const bool *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a boolean array value on a datastream endpoint with an explicit timestamp.

This function sends a boolean array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of booleans to be sent (false or true).
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_boolean_with_timestamp()

astarte_err_t astarte_device_stream_boolean_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
bool  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a boolean value on a datastream endpoint with an explicit timestamp.

This function sends a boolean value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (0 or 1).
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_datetime()

astarte_err_t astarte_device_stream_datetime ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value,
int  qos 
)

send a datetime value on a datastream endpoint.

This function sends a datetime value on a path of a given datastream interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent, representing the number of milliseconds since Unix epoch (1970-01-01).
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_datetime_array()

static astarte_err_t astarte_device_stream_datetime_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int64_t *  values,
int  count,
int  qos 
)
inlinestatic

send a datetime value on a datastream endpoint.

This function sends a datetime value on a path of a given datastream interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of datetimes, each one representing the number of milliseconds since Unix epoch (1970-01-01).
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_datetime_array_with_timestamp()

astarte_err_t astarte_device_stream_datetime_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int64_t *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a datetime value on a datastream endpoint with an explicit timestamp.

This function sends a datetime value on a path of a given datastream interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of datetimes, each one representing the number of milliseconds since Unix epoch (1970-01-01).
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_datetime_with_timestamp()

astarte_err_t astarte_device_stream_datetime_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a datetime value on a datastream endpoint with an explicit timestamp.

This function sends a datetime value on a path of a given datastream interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent, representing the number of milliseconds since Unix epoch (1970-01-01).
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_double()

astarte_err_t astarte_device_stream_double ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
double  value,
int  qos 
)

send a double value on a datastream endpoint.

This function sends a double value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_double_array()

static astarte_err_t astarte_device_stream_double_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const double *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)
inlinestatic

send a double array value on a datastream endpoint.

This function sends a double array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of double to be sent.
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_double_array_with_timestamp()

astarte_err_t astarte_device_stream_double_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const double *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a double array value on a datastream endpoint with an explicit timestamp.

This function sends a double array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of double to be sent.
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_double_with_timestamp()

astarte_err_t astarte_device_stream_double_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
double  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a double value on a datastream endpoint with an explicit timestamp.

This function sends a double value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_integer()

astarte_err_t astarte_device_stream_integer ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int32_t  value,
int  qos 
)

send a 32 bit integer value on a datastream endpoint.

This function sends a 32 bit int value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_integer_array()

static astarte_err_t astarte_device_stream_integer_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int32_t *  values,
int  count,
int  qos 
)
inlinestatic

send a 32 bit integer array value on a datastream endpoint.

This function sends a signed 32 bit int array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of int32_t to be sent.
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_integer_array_with_timestamp()

astarte_err_t astarte_device_stream_integer_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int32_t *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a 32 bit integer array value on a datastream endpoint with an explicit timestamp.

This function sends a signed 32 bit int array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of int32_t to be sent.
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_integer_with_timestamp()

astarte_err_t astarte_device_stream_integer_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int32_t  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a 32 bit integer value on a datastream endpoint with an explicit timestamp.

This function sends a 32 bit int value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_longinteger()

astarte_err_t astarte_device_stream_longinteger ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value,
int  qos 
)

send a 64 bit integer value on a datastream endpoint.

This function sends a 64 bit int value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_longinteger_array()

static astarte_err_t astarte_device_stream_longinteger_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int64_t *  values,
int  count,
int  qos 
)
inlinestatic

send a 64 bit integer array value on a datastream endpoint.

This function sends a signed 64 bit int array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of int64_t to be sent.
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_longinteger_array_with_timestamp()

astarte_err_t astarte_device_stream_longinteger_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const int64_t *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a 64 bit integer array value on a datastream endpoint with an explicit timestamp.

This function sends a signed 64 bit int array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of int64_t to be sent.
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_longinteger_with_timestamp()

astarte_err_t astarte_device_stream_longinteger_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
int64_t  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a 64 bit integer value on a datastream endpoint with an explicit timestamp.

This function sends a 64 bit int value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_string()

astarte_err_t astarte_device_stream_string ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const char *  value,
int  qos 
)

send a UTF8 encoded string on a datastream endpoint.

This function sends a UTF8 encoded string on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (a NULL terminated string).
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_string_array()

static astarte_err_t astarte_device_stream_string_array ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const char *const *  values,
int  count,
int  qos 
)
inlinestatic

send a string array value on a datastream endpoint.

This function sends a string array value on a path of a given datastream interface. The datetime represents the number of milliseconds since Unix epoch (1970-01-01).

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of C strings to be sent (having each one const char * type and encoded as 0 terminated UTF-8 string).
countThe number of values stored in values array.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_string_array_with_timestamp()

astarte_err_t astarte_device_stream_string_array_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const char *const *  values,
int  count,
uint64_t  ts_epoch_millis,
int  qos 
)

send a string array value on a datastream endpoint with an explicit timestamp.

This function sends a string array value on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valuesThe array of C strings to be sent (having each one const char * type and encoded as 0 terminated UTF-8 string).
countThe number of values stored in values array.
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_stream_string_with_timestamp()

astarte_err_t astarte_device_stream_string_with_timestamp ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path,
const char *  value,
uint64_t  ts_epoch_millis,
int  qos 
)

send a UTF8 encoded string on a datastream endpoint with an explicit timestamp.

This function sends a UTF8 encoded string on a path of a given datastream interface.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
valueThe value to be sent (a NULL terminated string).
ts_epoch_millisThe timestamp of the datastream. This is useful only on mappings with explicit_timestamp set to true and it's represented as milliseconds since epoch. A value of ASTARTE_INVALID_TIMESTAMP is ignored.
qosThe MQTT QoS to be used for the publish (0, 1 or 2).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages

◆ astarte_device_unset_path()

astarte_err_t astarte_device_unset_path ( astarte_device_handle_t  device,
const char *  interface_name,
const char *  path 
)

unset a path belonging to a properties interface.

This function is used to unset a path. It is possible to use it only with an interface of type properties and on a path belonging to an endpoint with allow_unset set to true.

Parameters
deviceA started Astarte device handle.
interface_nameA string containing the name of the interface.
pathA string containing the path (beginning with /).
Returns
ASTARTE_OK if the value was correctly published, another astarte_err_t otherwise. Note that this just checks that the publish sequence correctly started, i.e. it doesn't wait for PUBACK for QoS 1 messages or for PUBCOMP for QoS 2 messages