Device Data Hub C API
Device Data Hub

Device Data Hub is a data-centric publish–subscribe data distribution system that acts as the central data hub for Axis devices.

The communication model is designed around topics, and they are used for exchanging data between decoupled components (consumer/producer). Producers write new data samples to topics. Consumers subscribe to the topic of interest and receive new samples when available.

Topics are named logical channels for categorizing and routing data between producers and consumers.

Each topic can have a subset of data groups called instances. Instances are identified by the topic name and combination of selected instance keys. If there are no keys selected the topic has no instances. In this case all samples belong directly to the topic. Data produced for topics are called samples.

Topics need to be created in the system before the clients can utilize them. They are created with a definition that describes the payload format, instance keys, QoS, etc.

A topic definition looks like this:

{
"topic_name": "com.axis.ptz.optical-zoom-state.v1",
"maturity": "released",
"reach": "public",
"description": "Optical zoom state",
"exposure": "external",
"dataSchema": "http://schemas.axis.com/vapix/schemas/ptz/PtzOpticalZoomState-v1.json",
"keys": [
{
"name": "videoChannel",
"type": "integer"
}
],
"qos": {
"durability": "volatile",
"max_instances": 0,
"max_samples": null
}
}
Property Description
topic_name Unique topic name.
Format: {reverse-domain}.topic_seg1...topic_segN_v{Major Version}
Example: com.acme.example.v1
maturity Topic lifecycle stage. Available options are: alpha, beta, released, deprecated.
reach Intended audience/scope for the topic. Available options are: internal, selected, public.
exposure Exposure level for the topic interface. Available options are: internal, external.
dataSchema URI to the payload schema.
keys Topic instance keys.
qos.durability The durability of the topic. Specifies how the data is preserved. Available options are:
- volatile: Topic data will be delivered to existing subscribers and deleted afterwards.
- transient: Topic data will be kept until manually deleted or expired.
Default value is volatile.
qos.max_instances Maximum number of instances that can exist for the topic. If the value is 0 the topic will have no instances and all samples belong directly to the topic. Default value is 0. Maximum value is 512.
qos.max_samples Specifies the maximum number of samples that will be kept per instance. If durability is volatile, max_samples is not relevant and the only allowed value is null. If durability is transient, the default value is 1. Minimum value is 1. Maximum value is 128.
qos.ordering Specifies the timestamp to use for ordering samples. Available options are:
- RECEPTION_TS: Samples are ordered by the time they were received.
- SOURCE_TS: Samples are ordered by the timestamp provided by the producer.
If durability is volatile, ordering is not relevant and the only allowed value is null. If durability is transient, the default value is RECEPTION_TS.