Astarte device API for C++ 0.8.1
Astarte device SDK for C++
Loading...
Searching...
No Matches
astarte::device Namespace Reference

Umbrella namespace for the Astarte device library. More...

Namespaces

namespace  grpc
 Namespace for Astarte device functionality using the gRPC transport layer.
 
namespace  mqtt
 Namespace for Astarte device functionality using the MQTT transport protocol.
 
namespace  utils
 Utility functions for formatting data.
 

Classes

class  Data
 Represents a single Astarte data value. More...
 
class  DataSerializationError
 Specific error for when a serialization operation failed. More...
 
class  DatastreamIndividual
 Represents the Astarte individual datastream data. More...
 
class  DatastreamObject
 Astarte object class, representing the Astarte object datastream data. More...
 
class  Device
 Interface for an Astarte device. More...
 
class  ErrorBase
 Base error class representing any possible error from the Astarte device library. More...
 
class  FileOpenError
 Specific error for when a file cannot be opened. More...
 
class  GrpcLibError
 Error reported by the gRPC transport library. More...
 
class  InterfaceValidationError
 Error during the Interface validation process. More...
 
class  InternalError
 Specific error for when an operation failed due to an internal error. More...
 
class  InvalidAstarteTypeError
 Error indicating that the provided Astarte type is incorrect. More...
 
class  InvalidDatabaseRetentionPolicyError
 Error indicating that the provided Astarte database retention policy is incorrect. More...
 
class  InvalidInputError
 Specific error for when an operation failed due to incompatible user input. More...
 
class  InvalidInterfaceAggregationError
 Error indicating that the provided interface aggregation is incorrect. More...
 
class  InvalidInterfaceOwnershipeError
 Error indicating that the provided interface ownership is incorrect. More...
 
class  InvalidInterfaceTypeError
 Error indicating that the provided interface type is incorrect. More...
 
class  InvalidInterfaceVersionError
 Error indicating that the minor or major version of an interface is incorrect. More...
 
class  InvalidReliabilityError
 Error indicating that the provided Astarte reliability is incorrect. More...
 
class  InvalidRetentionError
 Error indicating that the provided Astarte retention is incorrect. More...
 
class  Message
 Astarte message class, represents a full message for/from Astarte. More...
 
class  MsgHubError
 Error reported by the Astarte message hub library. More...
 
class  OperationRefusedError
 An operation which is not permitted according to the current device status was attempted. More...
 
class  PropertyIndividual
 Representing the Astarte individual property data. More...
 
class  StoredProperty
 Represents a stored property on the device. More...
 

Concepts

concept  DataAllowedType
 C++ concept to restrict the allowed types for instances of an Astarte data class.
 

Typedefs

using Error
 Variant type representing any error from the Astarte device library.
 

Enumerations

enum  Ownership : int8_t { kDevice , kServer }
 Possible Astarte ownership. More...
 
enum  Type : int8_t {
  kBinaryBlob , kBoolean , kDatetime , kDouble ,
  kInteger , kLongInteger , kString , kBinaryBlobArray ,
  kBooleanArray , kDatetimeArray , kDoubleArray , kIntegerArray ,
  kLongIntegerArray , kStringArray
}
 Enumeration of supported Astarte data types. More...
 

Functions

auto ownership_from_str (const std::string &ownership) -> astarte_tl::expected< Ownership, Error >
 Converts a string to an Ownership enum.
 
auto astarte_type_from_str (const std::string &type) -> astarte_tl::expected< Type, Error >
 Converts a string representation of a type to a Type enum.
 

Detailed Description

Umbrella namespace for the Astarte device library.

Typedef Documentation

◆ Error

Initial value:
Specific error for when a serialization operation failed.
Definition errors.hpp:166
Specific error for when a file cannot be opened.
Definition errors.hpp:206
Error reported by the gRPC transport library.
Definition errors.hpp:266
Error during the Interface validation process.
Definition errors.hpp:325
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:186
Error indicating that the provided Astarte type is incorrect.
Definition errors.hpp:425
Error indicating that the provided Astarte database retention policy is incorrect.
Definition errors.hpp:485
Specific error for when an operation failed due to incompatible user input.
Definition errors.hpp:226
Error indicating that the provided interface aggregation is incorrect.
Definition errors.hpp:405
Error indicating that the provided interface ownership is incorrect.
Definition errors.hpp:385
Error indicating that the provided interface type is incorrect.
Definition errors.hpp:365
Error indicating that the minor or major version of an interface is incorrect.
Definition errors.hpp:345
Error indicating that the provided Astarte reliability is incorrect.
Definition errors.hpp:445
Error indicating that the provided Astarte retention is incorrect.
Definition errors.hpp:465
Error reported by the Astarte message hub library.
Definition errors.hpp:301
An operation which is not permitted according to the current device status was attempted.
Definition errors.hpp:246
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:219
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:99
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:259
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:79
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:119
Specific MQTT connection error.
Definition errors.hpp:279
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:30
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:59
Specific error for when the configuration to connect the device to Astarte is invalid.
Definition errors.hpp:199
Specific error for when reading from a file.
Definition errors.hpp:159
Specific error for when an operation failed due to an internal error.
Definition errors.hpp:139
Specific error for when a UUID operation failed.
Definition errors.hpp:239
Specific error for when writing to a file.
Definition errors.hpp:179

Variant type representing any error from the Astarte device library.

Intended for use as the error type E in astarte_tl::expected<T, E>. This allows for efficient, stack-allocated error reporting across the SDK.

Enumeration Type Documentation

◆ Ownership

Possible Astarte ownership.

Enumerator
kDevice 

Ownership is retained by the device.

kServer 

Ownership is retained by the Astarte cloud server.

◆ Type

enum astarte::device::Type : int8_t

Enumeration of supported Astarte data types.

These types correspond to the data types defined in Astarte interfaces and are used to validate and tag data sent to or received from the platform.

Enumerator
kBinaryBlob 

Binary blob Astarte type.

kBoolean 

Boolean Astarte type.

kDatetime 

Date-time Astarte type.

kDouble 

Double Astarte type.

kInteger 

Integer Astarte type.

kLongInteger 

Long integer Astarte type.

kString 

String Astarte type.

kBinaryBlobArray 

Binary blob array Astarte type.

kBooleanArray 

Boolean array Astarte type.

kDatetimeArray 

Datetime array Astarte type.

kDoubleArray 

Double array Astarte type.

kIntegerArray 

Integer array Astarte type.

kLongIntegerArray 

Long integer array Astarte type.

kStringArray 

String array Astarte type.

Function Documentation

◆ astarte_type_from_str()

auto astarte::device::astarte_type_from_str ( const std::string & type) -> astarte_tl::expected<Type, Error>
inline

Converts a string representation of a type to a Type enum.

This function maps the string identifiers used in Astarte interface definitions (e.g., "binaryblob", "integer") to their corresponding C++ enum values.

Parameters
[in]typeThe string representation of the Astarte type.
Returns
An expected containing the Type on success or Error on failure.

◆ ownership_from_str()

auto astarte::device::ownership_from_str ( const std::string & ownership) -> astarte_tl::expected<Ownership, Error>
inline

Converts a string to an Ownership enum.

Parameters
[in]ownershipThe string representation of the interface ownership.
Returns
An expected containing the Ownership on success or Error on failure.