Defining device object and resource names and value types in your account
Device Management's Device resource model is consistent with the Open Mobile Alliance (OMA) LightweightM2M (LwM2M) Object and Resource Registry and enables compliance with the LwM2M protocol.
The LwM2M device handling logic, is based on a hierarchical data structure of device objects and resources:
-
An object is collection of resources on the device. For example, it might represent an "interface" with a temperature sensor.
-
An object can have multiple instances.
-
Any piece of information from a device is a resource. A resource has either a static value (a value that never changes) or a dynamic value (a value that changes during the device's operation). A resource can also be an array with multiple values.
-
If a resource has array of values, these values are called resource instances.
You can read, write to or execute a resource's information.
Here is an example data structure, following the definition of the Open Mobile Alliance:
In this example:
- The device has two objects: a temperature sensor and a humidity sensor.
- The temperature sensor object has five resources. You can read their values, reset their minimum and maximum values and change the unit value.
- The device has three instances of a temperature sensor.
Objects and resources have IDs, some of which are reserved for a particular use. For example:
3
is a device object.5
is a firmware object.5700
is the current measured value from the resource's sensor.
Devices report data to Device Management through the resources you define in your device application.
Uploading device object and resource definitions to Device Management Portal
For most standard resources from the LwM2M registry and for resources that Device Management uses, Devices Management Portal presents the resource's path, name and reported value in the expected format or unit of measurement.
For example:
When a device reports a resource than is not known to Device Management, the Portal presents the resource's path and reported value.
To enable Device Management to present meaningful resource names and values in the correct format for new resources, admin users can upload XMLs with custom object and resource definitions to Device Management Portal.
Note: If the XML you upload contains an object or resource path that already exists in Device Management, the new definition you upload will overwrite the existing definition related to the object or resource path.
To define new device objects and resources in your account:
-
Create an XML file with the definition of your objects and resources consistent with the LwM2M v1.0 XML schema and the Open Mobile Alliance (OMA) LwM2M guidelines.
Note: If the device reports a resource in CBOR format, you must set
content type
toopaque
and include the termCBOR
in the resource description for Device Management Portal to present the decoded resource value. -
Log in to Device Management Portal for your region:
-
Select Device directory > Device objects.
This opens the Device objects screen.
-
Click the Add object button.
This opens the Add object screen.
-
Click Choose file and navigate to the XML file with your object and resource definitions.
-
Click Add object.
This open an Authentication required popup.
-
Enter your Device Management Portal password.
If an object with the same resource path already exists, a message informs you that this operation will overwrite the existing object details in the Device Management Portal.
Click OK to continue.
-
The new resource appears on the Custom tab of the Device objects screen.