Skip to content

Summary

Members Descriptions
namespacedaas::api

namespace daas::api

Summary

Members Descriptions
classdaas::api::DaasWrapper Wrapper class that encapsulates the usage logic of the libdaas.a library.
structdaas::api::DriverConfig Represents the configuration of a DaaS driver.
structdaas::api::InterfaceInfo Describes a system interface and its status.

class daas::api::DaasWrapper

Wrapper class that encapsulates the usage logic of the libdaas.a library.

Internally uses DaasAPI to expose high-level methods for initialization, driver configuration, and message transmission/reception.

Summary

Members Descriptions
publicDaasWrapper(const char * config,IDaasApiEvent * eventHandler) Constructor.
public~DaasWrapper()
public std::vector< std::string >getActiveInterfaces() Returns the list of currently active network interfaces on the system.
public std::vector<InterfaceInfo>listSystemInterfaces() Returns detailed information about all detected system interfaces.
public daas_error_tdoInit(din_t sid,din_t din) Initializes the DaaS node with SID and DIN.
public daas_error_tdoPerform(performs_mode_t mode) Starts the internal execution of the node.
public daas_error_tdoEnd() Terminates the node activities.
public daas_error_tdoReset() Resets the node state.
public const char *getVersion() Returns the version of the libdaas.a library.
public const char *listAvailableDrivers() Returns the list of available drivers.
public nodestate_tgetStatus() Returns the current status of the local node.
public const nodestate_t &status(din_t din) Returns the status of a given DIN.
public const nodestate_t &fetch(din_t din,uint16_t opts) Fetches a node's status with optional flags.
public dinlist_tlistNodes() Returns the list of known nodes.
public boolstoreConfiguration(IDepot * storage_interface) Saves the current configuration using an IDepot interface.
public boolloadConfiguration(IDepot * storage_interface) Loads the configuration using an IDepot interface.
public daas_error_tenableDriver(link_t link,const char * driver) Enables a driver on a specific link.
public daas_error_tmap(din_t din) Maps a node with known DIN (basic form)
public daas_error_tmap(din_t din,link_t link,const char * uri) Maps a node specifying link and URI.
public daas_error_tmap(din_t din,link_t link,const char * uri,const char * securityKey) Maps a node using a security key.
public daas_error_tremove(din_t din) Removes a previously mapped node.
public daas_error_tlocate(din_t din) Locates a node on the network.
public daas_error_tavailablesPull(din_t din,uint32_t & count) Returns the number of packets available for reception.
public daas_error_tpull(din_t din,DDO ** inboundDDO) Receives a DDO packet from a remote node.
public daas_error_tpush(din_t din,DDO * outboundDDO) Sends a DDO packet to a remote node.
public daas_error_tfrisbee(din_t din) Executes a quick fire-and-forget send.
public voidsetEventHandler(IDaasApiEvent * event) Sets a new event handler.
public const char *getInfos() Returns a string with internal information.
public daas_error_tsetupNode(din_t sid,din_t din,link_t link,const char * uri) Quickly configures the node using inline parameters.
public daas_error_tsetupNode(din_t sid,din_t din,link_t link,const char * localUri,din_t remoteDin,const char * remoteUri,const char * securityKey) Complete setup of a local node with driver and remote mapping.
public daas_error_tsetupNode(const char * setupFilePath) Loads and configures a node from a JSON file.

Members

publicDaasWrapper(const char * config,IDaasApiEvent * eventHandler)

Constructor.

Parameters

  • config Optional path to configuration file

  • eventHandler Custom handler for DaaS events

public~DaasWrapper()

public std::vector< std::string >getActiveInterfaces()

Returns the list of currently active network interfaces on the system.

This method scans the system's network interfaces and returns the names of those that are marked as "up" (IFF_UP). Duplicate names are removed.

Returns

Vector of interface names that are active.

public std::vector<InterfaceInfo>listSystemInterfaces()

Returns detailed information about all detected system interfaces.

This method inspects all available interfaces using getifaddrs() and /sys/class/net/<iface> to extract their name, type (Ethernet, WiFi, etc.), and operational status ("UP"/"DOWN"). It also attempts to detect Bluetooth interfaces under /sys/class/bluetooth, marking them as "Bluetooth (HCI)" with "UNKNOWN" status.

Returns

Vector of InterfaceInfo objects with name, type, and status.

public daas_error_tdoInit(din_t sid,din_t din)

Initializes the DaaS node with SID and DIN.

Parameters

  • sid System Identifier (e.g., network ID)

  • din DaaS Identifier (node ID)

Returns

Error code daas_error_t

public daas_error_tdoPerform(performs_mode_t mode)

Starts the internal execution of the node.

Parameters

  • mode Execution mode (e.g., PERFORM_CORE_THREAD)

Returns

Error code daas_error_t

public daas_error_tdoEnd()

Terminates the node activities.

Returns

Error code daas_error_t

public daas_error_tdoReset()

Resets the node state.

Returns

Error code daas_error_t

public const char *getVersion()

Returns the version of the libdaas.a library.

Returns

Version string (e.g., "0.20.1")

public const char *listAvailableDrivers()

Returns the list of available drivers.

Returns

Driver list string: 2.INET4;3.UART

public nodestate_tgetStatus()

Returns the current status of the local node.

Returns

Node status as nodestate_t

public const nodestate_t &status(din_t din)

Returns the status of a given DIN.

Parameters

  • din DaaS Identifier

Returns

Node status

public const nodestate_t &fetch(din_t din,uint16_t opts)

Fetches a node's status with optional flags.

Parameters

  • din DaaS Identifier

  • opts Fetch options

Returns

Node status

public dinlist_tlistNodes()

Returns the list of known nodes.

Returns

DIN list

public boolstoreConfiguration(IDepot * storage_interface)

Saves the current configuration using an IDepot interface.

Parameters

  • storage_interface Pointer to IDepot object

Returns

true if the save was successful

public boolloadConfiguration(IDepot * storage_interface)

Loads the configuration using an IDepot interface.

Parameters

  • storage_interface Pointer to IDepot object

Returns

true if the load was successful

Enables a driver on a specific link.

Parameters

  • link Interface type (e.g., LINK_INET4)

  • driver URI to use (e.g., "127.0.0.1:3000")

Returns

Error code daas_error_t

public daas_error_tmap(din_t din)

Maps a node with known DIN (basic form)

Parameters

  • din Remote node DIN

Returns

Error code

Maps a node specifying link and URI.

Parameters

  • din Remote node DIN

  • link Interface type

  • uri Remote interface/address

Returns

Error code

Maps a node using a security key.

Parameters

  • din Remote DIN

  • link Interface type

  • uri Remote address

  • securityKey Security key (e.g., AES)

Returns

Error code

public daas_error_tremove(din_t din)

Removes a previously mapped node.

Parameters

  • din Remote node DIN to remove

Returns

Error code

public daas_error_tlocate(din_t din)

Locates a node on the network.

Parameters

  • din Remote DIN to locate

Returns

Error code

public daas_error_tavailablesPull(din_t din,uint32_t & count)

Returns the number of packets available for reception.

Parameters

  • din Node DIN to query

  • count Number of pending packets

Returns

Error code

public daas_error_tpull(din_t din,DDO ** inboundDDO)

Receives a DDO packet from a remote node.

Parameters

  • din Sender DIN

  • inboundDDO Pointer to the received DDO

Returns

Error code

public daas_error_tpush(din_t din,DDO * outboundDDO)

Sends a DDO packet to a remote node.

Parameters

  • din Destination DIN

  • outboundDDO Pointer to the DDO to send

Returns

Error code

public daas_error_tfrisbee(din_t din)

Executes a quick fire-and-forget send.

Parameters

  • din Destination DIN

Returns

Error code

public voidsetEventHandler(IDaasApiEvent * event)

Sets a new event handler.

Parameters

  • event New handler to use

public const char *getInfos()

Returns a string with internal information.

Returns

Info string

Quickly configures the node using inline parameters.

Parameters

  • sid System ID

  • din Node ID

  • link Interface type

  • uri URI for the driver

Returns

Error code

Complete setup of a local node with driver and remote mapping.

This overload encapsulates the typical initialization sequence:

  • Initializes the local node (doInit)

  • Enables the selected driver (enableDriver)

  • Maps a remote node (map)

It reduces boilerplate for newcomers and allows a node to be ready in a single call. Returns the first error encountered, or ERROR_NONE if all steps succeed.

Parameters

  • sid System ID of the local node.

  • din Node ID of the local node.

  • link Communication link technology (e.g., _LINK_INET4).

  • localUri Local URI for the driver (e.g., "192.168.1.10:2020").

  • remoteDin DIN of the remote node to map.

  • remoteUri URI of the remote node (e.g., "192.168.1.20:2020").

  • securityKey Optional security key to use during mapping; if nullptr, mapping is performed without key.

Returns

daas_error_t Error code or ERROR_NONE if successful.

public daas_error_tsetupNode(const char * setupFilePath)

Loads and configures a node from a JSON file.

Parameters

  • setupFilePath Path to the JSON file

Returns

Error code daas_error_t

struct daas::api::DriverConfig

Represents the configuration of a DaaS driver.

Summary

Members Descriptions
public link_tlink
public std::stringuri

Members

public std::stringuri

struct daas::api::InterfaceInfo

Describes a system interface and its status.

Summary

Members Descriptions
public std::stringname
public std::stringtype
public std::stringstatus

Members

public std::stringname

public std::stringtype

public std::stringstatus

Generated by Moxygen