API Reference

DaaSAPI

Complete reference for the DaasAPI C++ class — the main entry point of the DaaS-IoT SDK.

Class DaasAPI
Version 0.21.3
45 methods
Source DAAS API Reference Manual, January 5, 2026
Notes

DaasAPI is the main class of the DaaS-IoT library. DIN = device identifier, SID = network/system identifier. ERROR_NONE indicates success. Some methods are marked 'not implemented yet' in this version.

Info & Build
#

getVersion

const char* getVersion()

Get the DaaS API library version.

No parameters

A string with the DaaS API library version.

Info & Build
#

getBuildInfo

const char* getBuildInfo()

Get build information of the DaaS API library.

No parameters

A string with build info (compiler version, build config).

Info & Build
#

listAvailableDrivers

const char* listAvailableDrivers()

List all available drivers in the DaaS stack for this node.

No parameters

A semicolon-separated string of available drivers.

Lifecycle
#

doEnd

daas_error_t doEnd()

Release resources and deactivate the node.

No parameters

ERROR_NONE on success, or an error code on failure.

Lifecycle
#

doReset

daas_error_t doReset()

Reset the local node, clear all resources and disconnect from the current network.

No parameters

ERROR_NONE on success, or an error code on failure.

Lifecycle
#

doInit

daas_error_t doInit(din_t sid, din_t din)

Initialize services and resources for the local node. Initialization is no longer strictly necessary: without din/sid the node can auto-generate them via discovery.

sid SID of the local node
din DIN of the local node

ERROR_NONE on success, or an error code on failure.

Lifecycle
#

doPerform

daas_error_t doPerform(performs_mode_t mode)

Execute the node's main processing loop (real-time or multi-threading). Must be called for the node to be operational. In threading mode call once; in real-time mode call cyclically.

mode PERFORM_CORE_THREAD for multi-threading mode, PERFORM_CORE_NO_THREAD for real-time mode

ERROR_NONE on success, or an error code on failure.

Network & Drivers
#

enableDriver

daas_error_t enableDriver(link_t driver_id, const char* local_uri)

Configure a driver for a network technology (link).

driver_id communication technology to enable: _LINK_INET4, _LINK_BLUETOOTH, and others in link_t
local_uri physical address of the local node. INET4: "IP:PORT" e.g. "192.168.1.2:4000". BLUETOOTH: a BT address e.g. "00:1A:7D:DA:71:13:CHANNEL"

ERROR_NONE on success, or an error code on failure.

Status & Stats
#

getStatus

nodestate_t getStatus()

Return the status of the local node.

No parameters

The status of the local node (hardware version, linked channels, sync status, security policy, etc.).

Configuration
#

setAcceptRequestsLevel

void setAcceptRequestsLevel(int policy_level)

Set which incoming requests the local node accepts.

policy_level 0: accept only from known DINs in the same network. 1: accept from known DINs across networks and same network. 2: accept from all DINs including unknown. Default 1; during discovery it's temporarily set to 2.

void

Configuration
#

storeConfiguration

bool storeConfiguration(IDepot* storage_interface)

Save the current configuration to a storage interface (IDepot).

storage_interface the interface to save the configuration to (filesystem, database, etc.)

true if the backup was successful, false otherwise.

Configuration
#

loadConfiguration

bool loadConfiguration(IDepot* storage_interface)

Load configuration from a storage interface (IDepot). Implement IDepot with open/close/save/load/trash/clearSpace/getSpaceInfo.

storage_interface the interface to load the configuration from (filesystem, database, etc.)

true if the configuration was loaded successfully, false otherwise.

Status & Stats
#

doStatisticsReset

bool doStatisticsReset()

Reset the system's statistics data.

No parameters

true if the reset was successful, false otherwise.

Status & Stats
#

getSystemStatistics

uint64_t getSystemStatistics(syscode_t label)

Return statistics of the local node for a specific system code.

label the system code to get statistics for (e.g. _cor_dme_sended)

The system statistics for the given label.

Mapping & Discovery
#

map

daas_error_t map(din_t din)
map(din_t din, link_t link, const char* suri)
map(din_t din, link_t link, const char* suri, const char* skey)

Map a remote node to the local instance to establish communication. Has 3 overloads. Supported links depend on build config; check listAvailableDrivers().

din DIN of the node to map
link communication technology: _LINK_INET4, _LINK_BLUETOOTH, etc. (optional)
suri physical address. INET4: "IP:PORT"; BLUETOOTH: BT address (optional)
skey security key for the node (currently not implemented) (optional)

ERROR_NONE on success, or an error code on failure.

Mapping & Discovery
#

remove

daas_error_t remove(din_t din)

Remove a node from the local instance and clean up associated resources.

din DIN of the node to remove

ERROR_NONE on success, or an error code on failure.

Mapping & Discovery
#

discovery

daas_error_t discovery()
discovery(link_t link)

Start a discovery process to locate nodes, broadcasting the enabled drivers' URI to auto-map this node to remote ones. Reception cannot be controlled, only disabled.

link the link to use for discovery; if omitted, all available links are used (optional)

ERROR_NONE on success, or an error code on failure.

Mapping & Discovery
#

setDiscoveryState

void setDiscoveryState(discovery_state_t mode)

Configure how the node interacts with network discovery (search, host, or stay invisible).

mode discovery_off (disabled), discovery_sender_only (search only), discovery_receiver_only (host only), discovery_full (bidirectional). Default after init is discovery_sender_only.

void

Mapping & Discovery
#

listNodes

dinlist_t listNodes()

Return map entries (known nodes) in the local instance.

No parameters

A list of known nodes (din_t) in the local instance.

Mapping & Discovery
#

locate

daas_error_t locate(din_t din, int timeout=1000)

Start a process to locate a node if it is not in the known table.

din DIN of the node to locate
timeout max time to wait in ms (default 1000)

ERROR_NONE if the node is known, or an error code if not.

Status & Stats
#

sendStatus

daas_error_t sendStatus(din_t din)

Send the local node's status to a remote node.

din DIN of the remote node to send the status to

ERROR_NONE on success, or an error code on failure.

Status & Stats
#

status

const nodestate_t& status(din_t din)

Fetch the status of a remote node.

din DIN of the remote node to fetch the status from

The nodestate_t of the remote node.

Status & Stats
#

fetch

const nodestate_t& fetch(din_t din, uint16_t opts)

Fetch the status of a remote node and update it in the local instance.

din DIN of the remote node to fetch the status from
opts options for fetching

The nodestate_t of the remote node after fetching.

Time Synchronization
#

getSyncedTimestamp

uint64_t getSyncedTimestamp()

Time with ATS correction, used to communicate inside the DaaS network. Only meaningful when connected and ATS in sync.

No parameters

The synced timestamp of the local node. Returns local system time without ATS correction if not synchronized.

Security Not implemented
#

unlock

const nodestate_t& unlock(din_t din, const char* skey)

Unlock a remote node by setting its security key.

din DIN of the remote node to unlock
skey the security key to set

The nodestate_t of the remote node after unlocking.

Security Not implemented
#

lock

const nodestate_t& lock(const char* skey, unsigned policy_)

Set SKEY and security policy for the local node.

skey the security key to set
policy_ the security policy to set

The nodestate_t of the local node after setting key and policy.

Time Synchronization Not implemented
#

syncNode

const nodestate_t& syncNode(din_t din, unsigned timezone)

Set local system time on a remote node and synchronize ATS.

din DIN of the remote node to synchronize
timezone timezone offset in seconds

The nodestate_t of the remote node after synchronization.

Time Synchronization Not implemented
#

syncNet

const nodestate_t& syncNet(din_t din, unsigned bubble_time)

Set local system time on a remote node and synchronize ATS.

din DIN of the remote node to synchronize
bubble_time max error allowed for synchronization in ms

The nodestate_t of the remote node after synchronization.

Time Synchronization
#

setATSMaxError

void setATSMaxError(int32_t error)

Set the maximum error allowed for ATS synchronization (acceptable time deviation between nodes).

error the maximum error in milliseconds (default 100ms)

void

Real-time Session Not implemented
#

use

bool use(din_t din)

Start a real-time session with a remote node.

din DIN of the remote node to start the session with

true if the RT session was successfully started, false otherwise. (OPEN CONNECTION!)

Real-time Session Not implemented
#

end

bool end(din_t din)

End a real-time session with a remote node.

din DIN of the remote node to end the session with

true if the RT session was successfully ended, false otherwise.

Real-time Session Not implemented
#

send

unsigned send(din_t din, unsigned char* outbound, unsigned size)

Send data to a remote node in a real-time session.

din DIN of the remote node to send data to
outbound pointer to the data to send
size size of the data to send

The size of data sent.

Real-time Session Not implemented
#

received

unsigned received(din_t din)

Check if there is data available from a remote node in a real-time session.

din DIN of the remote node to check for data

The size of data received.

Real-time Session Not implemented
#

receive

unsigned receive(din_t din, unsigned char& inbound, unsigned max_size)

Receive data from a remote node in a real-time session.

din DIN of the remote node to receive data from
inbound reference to a variable that will hold the received data
max_size maximum size of data to receive

The size of data received.

DDO
#

listTypesets

tsetlist_t& listTypesets()

Return a list of user-defined typesets.

No parameters

A reference to the list of user-defined typesets (Vector of typeset).

DDO
#

pull

daas_error_t pull(din_t din, DDO** inboundDDO)

Pull a DDO from a remote node.

din DIN of the remote node to pull data from
inboundDDO pointer to a DDO pointer that will hold the pulled DDO

ERROR_NONE on success, or an error code on failure.

DDO
#

push

daas_error_t push(din_t din, DDO* outboundDDO)

Push a DDO to a remote node.

din DIN of the remote node to send data to
outboundDDO pointer to the DDO to send

ERROR_NONE on success, or an error code on failure.

DDO
#

availablesPull

daas_error_t availablesPull(din_t din, uint32_t& count)

Check if there are available DDOs from a remote node. See also: pull.

din DIN of the remote node to check for available DDOs
count reference to a variable that will hold the number of available DDOs

ERROR_NONE on success, or an error code on failure.

DDO
#

addTypeset

daas_error_t addTypeset(const uint16_t typeset_code, const typeset_fun fun)

Map a user-defined typeset to a handler function; the handler is called when a DDO of that typeset is received. Note: a registered typeset does not trigger the received-DDO event.

typeset_code the code of the typeset to add
fun the function to handle received DDOs of this typeset

ERROR_NONE on success, or an error code on failure.

Frisbee
#

frisbee

daas_error_t frisbee(din_t din)

Ping a remote node to check its availability.

din DIN of the remote node to ping

ERROR_NONE on success, or an error code on failure.

Frisbee
#

frisbeeICMP

daas_error_t frisbeeICMP(din_t din, uint32_t timeout, uint32_t retry)

Ping a remote node with a specified timeout and retry count.

din DIN of the remote node to ping
timeout max time to wait for a reply in ms
retry number of retries if no reply is received

ERROR_NONE on success, or an error code on failure.

Frisbee
#

frisbeeDPERF

daas_error_t frisbeeDPERF(din_t din, uint32_t sender_pkt_total=10, uint32_t block_size=1024*1024, uint32_t sender_trip_period=0)

Measure the performance of data transfer to a remote node.

din DIN of the remote node to ping
sender_pkt_total total number of packets to send (default 10)
block_size size of each packet in bytes (default 1MB)
sender_trip_period time between packets in ms (default 0)

ERROR_NONE on success, or an error code on failure.

Frisbee
#

getFrisbeeResultDPERF

dperf_info_result getFrisbeeResultDPERF()

Return the result of a frisbee DPERF performance test.

No parameters

A dperf_info_result with: sender_first_timestamp, local_end_timestamp, remote_first_timestamp, remote_last_timestamp, remote_pkt_counter, remote_data_counter.

Configuration
#

setDDOPolicy

daas_error_t setDDOPolicy(ddo_policy_t policy)

Set the DDO policy for handling unsuccessful DDO sends. Retry policies may change send order.

policy ddo_policy_skip_on_failure (skip & delete on failure, default), ddo_policy_retry_on_failure (retry each doPerform cycle), ddo_policy_exponential_backoff_retry_on_failure (retry with exp backoff: 1min doubling up to 1h)

ERROR_NONE on success, or an error code on failure.

Network & Drivers
#

unbindNetwork

daas_error_t unbindNetwork()

Unbind the local node from the current network, closing all open channels. The mapping table is preserved for later rebinding.

No parameters

ERROR_NONE on success, or an error code on failure.