5#ifndef ASTARTE_DEVICE_SDK_DEVICE_H
6#define ASTARTE_DEVICE_SDK_DEVICE_H
20#include "astarte_device_sdk/errors.hpp"
60 -> astarte_tl::expected<void, AstarteError> = 0;
67 -> astarte_tl::expected<void, AstarteError> = 0;
74 -> astarte_tl::expected<void, AstarteError> = 0;
81 virtual auto connect() -> astarte_tl::expected<void, AstarteError> = 0;
102 const std::chrono::system_clock::time_point* timestamp)
112 virtual auto
send_object(std::string_view interface_name, std::string_view path,
114 const std::chrono::system_clock::time_point* timestamp)
123 virtual auto
set_property(std::string_view interface_name, std::string_view path,
132 virtual auto
unset_property(std::string_view interface_name, std::string_view path)
Astarte data class, representing the basic Astarte types.
Definition data.hpp:40
Astarte object class, representing the Astarte object datastream data.
Definition object.hpp:22
auto operator=(AstarteDevice &&other) -> AstarteDevice &=default
Move assignment operator for the Astarte device class.
AstarteDevice(AstarteDevice &&other)=default
Move constructor for the Astarte device class.
virtual auto add_interface_from_str(std::string_view json) -> astarte_tl::expected< void, AstarteError >=0
Add an interface for the device from a JSON string view.
virtual auto add_interface_from_file(const std::filesystem::path &json_file) -> astarte_tl::expected< void, AstarteError >=0
Add an interface for the device from a JSON file.
virtual auto connect() -> astarte_tl::expected< void, AstarteError >=0
Connect the device to Astarte.
AstarteDevice(const AstarteDevice &other)=delete
Copy constructor for the Astarte device class.
virtual auto poll_incoming(const std::chrono::milliseconds &timeout) -> std::optional< AstarteMessage >=0
Poll for incoming messages from Astarte.
virtual auto disconnect() -> astarte_tl::expected< void, AstarteError >=0
Disconnect the device from Astarte.
virtual auto set_property(std::string_view interface_name, std::string_view path, const AstarteData &data) -> astarte_tl::expected< void, AstarteError >=0
Set a device property on Astarte.
virtual auto unset_property(std::string_view interface_name, std::string_view path) -> astarte_tl::expected< void, AstarteError >=0
Unset a device property on Astarte.
virtual auto send_individual(std::string_view interface_name, std::string_view path, const AstarteData &data, const std::chrono::system_clock::time_point *timestamp) -> astarte_tl::expected< void, AstarteError >=0
Send an individual data payload to Astarte.
virtual auto remove_interface(const std::string &interface_name) -> astarte_tl::expected< void, AstarteError >=0
Remove an installed interface.
virtual ~AstarteDevice()=default
Virtual destructor.
virtual auto is_connected() const -> bool=0
Check if the device is connected to the Astarte message hub.
virtual auto send_object(std::string_view interface_name, std::string_view path, const AstarteDatastreamObject &object, const std::chrono::system_clock::time_point *timestamp) -> astarte_tl::expected< void, AstarteError >=0
Send an aggregate object data payload to Astarte.
auto operator=(const AstarteDevice &other) -> AstarteDevice &=delete
Copy assignment operator for the Astarte device class.
Astarte message class, represents a full message for/from Astarte.
Definition msg.hpp:25
Astarte data class and its related methods.
Astarte message class and its related methods.
Umbrella namespace for the Astarte device SDK.
Definition data.hpp:23
std::variant< AstarteInternalError, AstarteFileOpenError, AstarteInvalidInputError, AstarteOperationRefusedError, AstarteGrpcLibError, AstarteMsgHubError > AstarteError
A variant type representing any possible error from the Astarte device library.
Definition errors.hpp:41
Astarte object class and its related methods.