5#ifndef ASTARTE_DEVICE_SDK_DEVICE_H
6#define ASTARTE_DEVICE_SDK_DEVICE_H
76 -> astarte_tl::expected<void, Error> = 0;
85 -> astarte_tl::expected<void, Error> = 0;
94 -> astarte_tl::expected<void, Error> = 0;
104 virtual auto connect() -> astarte_tl::expected<void, Error> = 0;
129 const std::chrono::system_clock::time_point* timestamp)
130 -> astarte_tl::expected<
void,
Error> = 0;
141 virtual auto
send_object(std::string_view interface_name, std::string_view path,
143 const std::chrono::system_clock::time_point* timestamp)
144 -> astarte_tl::expected<
void,
Error> = 0;
154 virtual auto
set_property(std::string_view interface_name, std::string_view path,
155 const
Data& data) -> astarte_tl::expected<
void,
Error> = 0;
164 virtual auto
unset_property(std::string_view interface_name, std::string_view path)
165 -> astarte_tl::expected<
void,
Error> = 0;
205 virtual auto
get_property(std::string_view interface_name, std::string_view path)
Represents a single Astarte data value.
Definition data.hpp:61
Astarte object class, representing the Astarte object datastream data.
Definition object.hpp:33
virtual auto add_interface_from_file(const std::filesystem::path &json_file) -> astarte_tl::expected< void, Error >=0
Adds an interface definition to the device from a JSON file.
virtual auto send_object(std::string_view interface_name, std::string_view path, const DatastreamObject &object, const std::chrono::system_clock::time_point *timestamp) -> astarte_tl::expected< void, Error >=0
Sends an aggregated object to an Astarte Interface.
Device(const Device &other)=delete
Device is non-copyable.
virtual auto remove_interface(const std::string &interface_name) -> astarte_tl::expected< void, Error >=0
Removes an installed interface from the device.
virtual auto poll_incoming(const std::chrono::milliseconds &timeout) -> std::optional< Message >=0
Polls for incoming messages from Astarte.
virtual auto get_property(std::string_view interface_name, std::string_view path) -> astarte_tl::expected< PropertyIndividual, Error >=0
Retrieves a specific property value.
virtual auto disconnect() -> astarte_tl::expected< void, Error >=0
Disconnects the device from Astarte.
virtual auto unset_property(std::string_view interface_name, std::string_view path) -> astarte_tl::expected< void, Error >=0
Unsets (deletes) a device property.
virtual auto get_properties(std::string_view interface_name) -> astarte_tl::expected< std::list< StoredProperty >, Error >=0
Retrieves all stored properties belonging to a specific interface.
auto operator=(const Device &other) -> Device &=delete
Device is non-copyable.
virtual auto get_all_properties(const std::optional< Ownership > &ownership) -> astarte_tl::expected< std::list< StoredProperty >, Error >=0
Retrieves all stored properties matching an ownership filter.
virtual auto is_connected() const -> bool=0
Checks connectivity status.
virtual auto send_individual(std::string_view interface_name, std::string_view path, const Data &data, const std::chrono::system_clock::time_point *timestamp) -> astarte_tl::expected< void, Error >=0
Sends an individual data point to an Astarte Interface.
virtual auto set_property(std::string_view interface_name, std::string_view path, const Data &data) -> astarte_tl::expected< void, Error >=0
Updates a local device property and synchronize it with Astarte.
virtual auto add_interface_from_str(std::string_view json) -> astarte_tl::expected< void, Error >=0
Adds an interface definition to the device from a JSON string.
virtual auto connect() -> astarte_tl::expected< void, Error >=0
Connects the device to the Astarte platform.
virtual ~Device()=default
Virtual destructor.
auto operator=(Device &&other) -> Device &=default
Move assignment operator.
Device(Device &&other)=default
Move constructor.
Astarte message class, represents a full message for/from Astarte.
Definition msg.hpp:37
Representing the Astarte individual property data.
Definition property.hpp:22
Represents a stored property on the device.
Definition stored_property.hpp:33
Astarte data class and its related methods.
Error types and handling for the Astarte device library.
Astarte message class and its related methods.
Umbrella namespace for the Astarte device library.
Definition data.hpp:29
Ownership
Possible Astarte ownership.
Definition ownership.hpp:23
std::variant< DataSerializationError, InternalError, FileOpenError, InvalidInputError, InterfaceValidationError, InvalidInterfaceVersionError, InvalidInterfaceTypeError, InvalidInterfaceOwnershipeError, InvalidInterfaceAggregationError, InvalidAstarteTypeError, InvalidReliabilityError, InvalidRetentionError, InvalidDatabaseRetentionPolicyError, OperationRefusedError, GrpcLibError, MsgHubError, mqtt::JsonParsingError, mqtt::DeviceRegistrationError, mqtt::PairingApiError, mqtt::MqttError, mqtt::InvalidUrlError, mqtt::RetrieveBrokerUrlError, mqtt::ReadCredentialError, mqtt::WriteCredentialError, mqtt::PairingConfigError, mqtt::CryptoError, mqtt::UuidError, mqtt::HttpError, mqtt::MqttConnectionError > Error
Variant type representing any error from the Astarte device library.
Definition errors.hpp:80
Global namespace for all Astarte related functionality.
Definition data.hpp:29
Astarte object class and its related methods.
Ownership definitions for communication with Astarte.
Astarte stored property class.