5#ifndef ASTARTE_DEVICE_SDK_DEVICE_GRPC_H
6#define ASTARTE_DEVICE_SDK_DEVICE_GRPC_H
23#include "astarte_device_sdk/errors.hpp"
27#include "astarte_device_sdk/property.hpp"
62 -> astarte_tl::expected<void, AstarteError>
override;
69 -> astarte_tl::expected<void, AstarteError>
override;
76 -> astarte_tl::expected<void, AstarteError>
override;
83 auto connect() -> astarte_tl::expected<void, AstarteError>
override;
105 const std::chrono::system_clock::time_point* timestamp)
115 auto
send_object(std::string_view interface_name, std::string_view path,
117 const std::chrono::system_clock::time_point* timestamp)
163 auto
get_property(std::string_view interface_name, std::string_view path)
167 struct AstarteDeviceGrpcImpl;
168 std::shared_ptr<AstarteDeviceGrpcImpl> astarte_device_impl_;
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 disconnect() -> astarte_tl::expected< void, AstarteError > override
Disconnect from Astarte.
auto set_property(std::string_view interface_name, std::string_view path, const AstarteData &data) -> astarte_tl::expected< void, AstarteError > override
Set a device property.
auto is_connected() const -> bool override
Check if the device is connected.
auto connect() -> astarte_tl::expected< void, AstarteError > override
Connect the device to Astarte.
auto get_properties(std::string_view interface_name) -> astarte_tl::expected< std::list< AstarteStoredProperty >, AstarteError >
Get stored properties matching the interface.
auto get_all_properties(const std::optional< AstarteOwnership > &ownership) -> astarte_tl::expected< std::list< AstarteStoredProperty >, AstarteError >
Get all stored properties matching the input filter.
AstarteDeviceGrpc(const std::string &server_addr, const std::string &node_uuid)
Constructor for the Astarte device class.
auto unset_property(std::string_view interface_name, std::string_view path) -> astarte_tl::expected< void, AstarteError > override
Unset a device property.
auto get_property(std::string_view interface_name, std::string_view path) -> astarte_tl::expected< AstartePropertyIndividual, AstarteError >
Get a single stored property matching the interface name and path.
~AstarteDeviceGrpc() override
Destructor for the Astarte device class.
AstarteDeviceGrpc(AstarteDeviceGrpc &other)=delete
Copy constructor for the Astarte device class.
auto add_interface_from_str(std::string_view json) -> astarte_tl::expected< void, AstarteError > override
Add an interface for the device from a JSON string view.
auto remove_interface(const std::string &interface_name) -> astarte_tl::expected< void, AstarteError > override
Remove an installed interface.
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 > override
Send object data to Astarte.
auto operator=(AstarteDeviceGrpc &&other) -> AstarteDeviceGrpc &=delete
Move assignment operator for the Astarte device class.
auto operator=(AstarteDeviceGrpc &other) -> AstarteDeviceGrpc &=delete
Copy assignment operator for the Astarte device class.
auto add_interface_from_file(const std::filesystem::path &json_file) -> astarte_tl::expected< void, AstarteError > override
Add an interface for the device from a JSON file.
AstarteDeviceGrpc(AstarteDeviceGrpc &&other)=delete
Move constructor for the Astarte device class.
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 > override
Send individual data to Astarte.
auto poll_incoming(const std::chrono::milliseconds &timeout) -> std::optional< AstarteMessage > override
Poll incoming messages.
AstarteDevice(const AstarteDevice &other)=delete
Copy constructor for the Astarte device class.
Astarte message class, represents a full message for/from Astarte.
Definition msg.hpp:25
Representing the Astarte individual datastream data.
Definition property.hpp:20
Representing data for a stored property.
Definition stored_property.hpp:23
Astarte data class and its related methods.
Abstract Astarte device object 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
AstarteOwnership
Possible Astarte ownership.
Definition ownership.hpp:19
Astarte object class and its related methods.
Ownership definitions for communication with Astarte.
Astarte stored property class and its related methods.