Link Search Menu Expand Document

Device Data Model

Libertas OS uses the same data model as Matter and Zigbee Cluster Library.

There are two types of device data accesses.

  • Command - A device sends commands to other devices. The command may or may NOT be a result of a user action. For example, a timer may turn a device on or off at timeout.
  • Attributes - Attributes are a dataset of a device’s state. A device may report current attributes to other devices. A device may also query attributes from other devices. For example, a wireless sensor may report the readings whenever the conditions are met.

An example is a dimmable light. Users may send a command to a light through a switch or a Smartphone.

Turn the light to full-on (level 255); light shall smoothly transition from the current to the target level in 2 seconds.

A light may voluntarily report its state to other devices. State information is a collection of attributes. Each attribute has a predefined attribute ID and a value of predefined type.

Light reports that its “Current Level” is 255, a predefined as an 8-bit unsigned integer.

A device (e.g., Libertas Hub) can also query the device for attributes.

Hub queries a light for “Current Level” and “On Transition Time.”

Cluster

A device supports one or more clusters. Cluster is another 16-bit unsigned integer value between 0 and 65535.

In Libertas-OS, a cluster is also called “capability.” For example, we have “On/off Cluster” and “Level Control Cluster” etc.

A cluster is conceptually equivalent to an “interface” in the programming language.

In Libertas-OS, commands and attributes must be coupled with a Cluster.

Data Structures

Command

A command comprises a “Command ID” and a set of extra parameters.

Command ID is an 8-bit unsigned integer ranging between 0 and 255.

Command data is an array. Each data item in the array may be of different types, depending on the definition.

Attribute

An attribute comprises an “Attribute ID” and “Attribute Value”. Attribute ID is an unsigned 16-bit integer ranging between 0 and 65535.