7#ifndef ASTARTE_DEVICE_SDK_DEVICE_H
8#define ASTARTE_DEVICE_SDK_DEVICE_H
103#if defined(CONFIG_ASTARTE_DEVICE_SDK_PERMANENT_STORAGE)
108 const char *interface_name;
112} astarte_device_property_loader_event_t;
115typedef void (*astarte_device_property_loader_cbk_t)(astarte_device_property_loader_event_t event);
243 const int64_t *timestamp);
258 size_t entries_len,
const int64_t *timestamp);
283#if defined(CONFIG_ASTARTE_DEVICE_SDK_PERMANENT_STORAGE)
301 const char *interface_name,
const char *path, astarte_device_property_loader_cbk_t loader_cbk,
Astarte types and defines.
Functions for the generation of Astarte device identifiers.
#define ASTARTE_DEVICE_ID_LEN
Number of characters in the string version of an Astarte device ID.
Definition device_id.h:31
void(* astarte_device_datastream_individual_cbk_t)(astarte_device_datastream_individual_event_t event)
Function pointer for datastream individual events.
Definition device.h:75
astarte_result_t astarte_device_unset_property(astarte_device_handle_t device, const char *interface_name, const char *path)
Unset a device property.
void(* astarte_device_property_unset_cbk_t)(astarte_device_data_event_t event)
Function pointer for property unset events.
Definition device.h:101
astarte_result_t astarte_device_stream_aggregated(astarte_device_handle_t device, const char *interface_name, const char *path, astarte_object_entry_t *entries, size_t entries_len, const int64_t *timestamp)
Send an aggregated object through the device connection.
void(* astarte_device_property_set_cbk_t)(astarte_device_property_set_event_t event)
Function pointer for property set events.
Definition device.h:98
astarte_result_t astarte_device_destroy(astarte_device_handle_t device)
Destroy the Astarte device instance.
astarte_result_t astarte_device_disconnect(astarte_device_handle_t device)
Disconnect the Astarte device instance.
astarte_result_t astarte_device_poll(astarte_device_handle_t device)
Poll data from Astarte.
astarte_result_t astarte_device_new(astarte_device_config_t *cfg, astarte_device_handle_t *device)
Allocate a new instance of an Astarte device.
astarte_result_t astarte_device_connect(astarte_device_handle_t device)
Connect a device to Astarte.
void(* astarte_device_datastream_object_cbk_t)(astarte_device_datastream_object_event_t event)
Function pointer for datastream object events.
Definition device.h:87
astarte_result_t astarte_device_stream_individual(astarte_device_handle_t device, const char *interface_name, const char *path, astarte_individual_t individual, const int64_t *timestamp)
Send an individual value through the device connection.
void(* astarte_device_connection_cbk_t)(astarte_device_connection_event_t event)
Function pointer for connection events.
Definition device.h:46
void(* astarte_device_disconnection_cbk_t)(astarte_device_disconnection_event_t event)
Function pointer for disconnection events.
Definition device.h:56
struct astarte_device * astarte_device_handle_t
Handle for an instance of an Astarte device.
Definition device.h:36
astarte_result_t astarte_device_add_interface(astarte_device_handle_t device, const astarte_interface_t *interface)
add an interface to the device.
astarte_result_t astarte_device_set_property(astarte_device_handle_t device, const char *interface_name, const char *path, astarte_individual_t individual)
Set a device property to the provided individual value.
#define ASTARTE_PAIRING_CRED_SECR_LEN
Number of characters in the string representation of a Base64 encoded credential secret.
Definition pairing.h:26
astarte_result_t
Astarte Device SDK return codes.
Definition result.h:31
Definitions for Astarte individual data types.
Astarte interface representation.
Definitions for Astarte object data types.
Functions for device pairing.
Configuration struct for an Astarte device.
Definition device.h:125
astarte_device_datastream_individual_cbk_t datastream_individual_cbk
Optional callback for a datastream individual reception event.
Definition device.h:145
int32_t mqtt_poll_timeout_ms
Polling timeout for the MQTT client.
Definition device.h:135
astarte_device_disconnection_cbk_t disconnection_cbk
Optional callback for a disconnection event.
Definition device.h:143
astarte_device_property_set_cbk_t property_set_cbk
Optional callback for a set property event.
Definition device.h:149
size_t interfaces_size
Number of elements in the interfaces array.
Definition device.h:157
void * cbk_user_data
User data passed to each callback function.
Definition device.h:153
astarte_device_property_unset_cbk_t property_unset_cbk
Optional callback for a unset property event.
Definition device.h:151
int32_t http_timeout_ms
Timeout for HTTP requests.
Definition device.h:127
const astarte_interface_t ** interfaces
Array of interfaces to be added to the device.
Definition device.h:155
int32_t mqtt_connection_timeout_ms
Connection timeout period.
Definition device.h:133
astarte_device_connection_cbk_t connection_cbk
Optional callback for a connection event.
Definition device.h:141
astarte_device_datastream_object_cbk_t datastream_object_cbk
Optional callback for a datastream object reception event.
Definition device.h:147
Context for a single connection event.
Definition device.h:40
astarte_device_handle_t device
Handle to the device triggering the event.
Definition device.h:41
void * user_data
User data configured during device initialization.
Definition device.h:42
Common context for all data events.
Definition device.h:60
const char * interface_name
Name of the interface on which the event is triggered.
Definition device.h:62
void * user_data
User data configured during device initialization.
Definition device.h:64
astarte_device_handle_t device
Handle to the device triggering the event.
Definition device.h:61
const char * path
Path on which event is triggered.
Definition device.h:63
Context for a single datastream individual event.
Definition device.h:69
astarte_device_data_event_t data_event
Generic data event context.
Definition device.h:70
astarte_individual_t individual
Received data from Astarte.
Definition device.h:71
Context for a single datastream object event.
Definition device.h:80
size_t entries_len
Length of the array of Astarte object entries.
Definition device.h:83
astarte_object_entry_t * entries
Received data from Astarte, as an array of entries.
Definition device.h:82
astarte_device_data_event_t data_event
Generic data event context.
Definition device.h:81
Context for a single disconnection event.
Definition device.h:50
void * user_data
User data configured during device initialization.
Definition device.h:52
astarte_device_handle_t device
Handle to the device triggering the event.
Definition device.h:51
Context for a single property set event.
Definition device.h:92
astarte_device_data_event_t data_event
Generic data event context.
Definition device.h:93
astarte_individual_t individual
Received data from Astarte.
Definition device.h:94
Base Astarte individual data type.
Definition individual.h:128
Astarte interface definition.
Definition interface.h:79
Object entry data type.
Definition object.h:40