Device Data Hub C API
Overview

Welcome to the Device Data Hub C API documentation.

This library provides a C interface for interacting with Device Data Hub. Applications using this library can manage topics, produce data, and consume data.

Getting Started

Device Data Hub Core is the central data hub on Axis devices. Platform applications or ACAPs can produce data to and consume data from Device Data Hub Core.

For more information about Device Data Hub, see Device Data Hub documentation.

The library has the following main components to interact with Device Data Hub:

Available topics can be found at Topic List page.

Examples of how to use Device Data Hub C Client library can be found at acap-native-sdk-examples.

JSON Data Format

Device Data Hub C API uses JSON format for topic data. The API will accept and provide JSON strings through the DHTopicData type. Applications can use the provided functions:

Applications can work with JSON strings directly or use 3rd party C libraries (Jansson, cJSON, json-c, etc.) to create easy conversion from/to C data structures.

Error Handling

The C API uses a consistent error handling pattern:

Callback Threading

All callbacks (connection state updates, data reception, consumer match notifications) are executed on internal library threads. Applications should:

  • Keep callback processing lightweight and fast
  • Ensure callback implementations are thread-safe
  • Avoid blocking operations in callbacks
  • Copy data if needed for later processing outside the callback