DeviceTwin

LiveObjects DeviceTwin is a Twin representation of the real device:

  • which objects are supported

  • which objects are instantiated

  • which are the instantiated objects last reported attributes values

DeviceTwin overview
@startuml

' --- Flèches ---
skinparam ArrowColor #B22222
skinparam ArrowFontColor darkblue
skinparam ArrowFontStyle bold
skinparam ArrowFontSize 10

' --- Classes ---
skinparam ClassFontStyle bold
skinparam ClassFontSize 11
skinparam ClassAttributeFontSize 11

class TwinDevice #LightYellow {
    //String deviceId//
    //Set supportedObjects//
    //Set instantiatedObjects//
    //Set reportedValues//
}

class InstantiatedObject #LightYellow{
    //String path//
    //String objectDefinitionId//
}

class ReportedValue #LightYellow{
    //String path//
    //String value//
    //OffsetDateTime timestamp//
}

TwinDevice "1" *-- "*" InstantiatedObject : instantiatedObjects
TwinDevice "1" *-- "*" ReportedValue : reportedValues

@enduml

A DeviceTwin includes :

  • supportedObjects as a list of objectDefinitionId : list Object definitions supported by the device.

  • instantiatedObjects as a list of Object : list of Object implemented by the device.

  • reportedValues as a list of AttributeValue : list of Attributes values reported by the device

In addition, LiveObjects provides three ways to represents a given DeviceTwin :

RootObject

RootObject is represented by the following :

Field Value Comment

objectDefinitionId

urn:oma:lwm2m

Parent of the ObjectDefinition identifier.

path

/

Root path

children

[]

Children Object

Object

Object is represented by the following :

Field Value Comment

objectDefinitionId

urn:oma:lwm2m:5:1.1

ObjectDefinition identifier.

path

/5

Object path : object (OBJECT_MAP) 5

instances

[]

List of ObjectInstance

ObjectInstance

ObjectInstance is represented by the following :

Field Value Comment

objectDefinitionId

urn:oma:lwm2m:5:1.1

ObjectDefinition identifier.

path

/5/0

Object path : object (OBJECT_MAP) 5 instance 0

attributes

[]

List of Attribute

Attribute

Attribute is represented by the following :

Field Value Comment

path

/5/0/3

Attribute path : object 5 instance 0 attribute 3. A root Object has an empty path.

/1/4/25/0

Attribute path : object 1 instance 4 multi-instances attribute 25 instance 0.

content

AttributeValue

Single instance attribute

contents

List<AttributeValue>

Multi-instances attributes

When an attribute is a single-instance attribute, his value is reported as content, whereas a multi-instances attribute is reported as contents.