Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Lightweight M2M – Device Capability management Object (LwM2M Object – DevCapMgmt)

Hi Subhash,

my feeling is, that there are some misunderstandings.

LWM2M uses IDs in a specified way, see LWM2M TS, 6.2 identifiers.
And the object definitions are also done in a specific way 
(LWM2M TS, Appendix D. and the leshan json alos obeys the rules defined there).

So the first thing:
You may define the "structure of an object" in the json/xml, but not the instances of it.
The IDs in inside the object definition are "resource IDs" and they have a defined meaning
(e.g. as in section 6 of the document append by you). So Res ID 0 is "Property" and the attributes
are defined in the doc. 1 is "Group" and so on. That's as mentioned above just the template for 
instances. So you should just copy the content of section 7. (unedited!) to your file. Or you use the
.xml file (see other posts in this mailing list).

The instances are the created on the device and they are reported using the registration interface.
You device therefore creates a instance e.g /15/0 for Lum. Sensor, providing all meaningful or require
Attributes e.g.:

/15/0/0 := 0
/15/0/1 := 0
/15/0/2 := Indoor Light Sensor
/15/0/3 := true
/15/0/4 := true

/15/1/0 := 1
/15/1/1 := 0
/15/1/2 := Door Watcher
/15/1/3 := true
/15/1/4 := true 

...

The instances and resource values on the device are usually not read out of a file, they mostly
related to some HW-API, which allows to check, if such a Capability is available or not.

Mit freundlichen Grüßen / Best regards

Achim Kraus

Bosch Software Innovations GmbH
Communications (INST/ESY1)
Stuttgarter Straße 130
71332 Waiblingen
GERMANY
www.bosch-si.de
www.blog.bosch-si.com 

achim.kraus@xxxxxxxxxxxx

Registered office: Berlin, Register court: Amtsgericht Charlottenburg, HRB 148411 B
Executives: Dr.-Ing. Rainer Kallenbach; Michael Hahn


Von: leshan-dev-bounces@xxxxxxxxxxx [mailto:leshan-dev-bounces@xxxxxxxxxxx] Im Auftrag von Subhash Nair p
Gesendet: Samstag, 23. April 2016 12:42
An: leshan developer discussions
Betreff: [leshan-dev] Lightweight M2M – Device Capability management Object (LwM2M Object – DevCapMgmt)

Hi,

     I am trying to model object 15 into  oma-objects-spec.json  I am making Instance ID  0  as Sensor(15/0),Instance ID 1 as Control , Instance ID 2 as Connectivity so on.

   (Open Mobile Alliance
OMA-TS-LWM2M_DevCapMgmt-V1_0_1-20151123-A  is attached)

For example   different  kind of Sensors are modelled  as 15/0/0, 15/0/1  etc  as shown below.


   {
    "name": "Device Capability Management",
    "id": 15,
    "instancetype": "mutiple",
    "mandatory": true,
    "description": "DevCapability",
    "resourcedefs": [
      {
        "id": 0,
        "name": "Luminosity Sensor",
        "operations": "ED",
        "instancetype": "single",
        "mandatory": true,
        "type": "integer",
        "range": "",
        "units": "",
        "description": ""
      },
      {
        "id": 1,
        "name": "Presence",
        "operations": "ED",
        "instancetype": "multiple",
        "mandatory": true,
        "type": "integer",
        "range": "",
        "units": "",
        "description": ""
      },
      {
        "id": 2,
        "name": "Temperature",
        "operations": "ED",
        "instancetype": "single",
        "mandatory": false,
        "type": "integer",
        "range": "",
        "units": "",
        "description": ""
      },
      {
        "id": 3,
        "name": "Hygrometrie",
        "operations": "ED",
        "instancetype": "single",
        "mandatory": false,
        "type": "integer",
        "range": "",
        "units": "",
        "description": ""
      },
      {
        "id": 4,
        "name": "Pressure",
        "operations": "ED",
        "instancetype": "single",
        "mandatory": true,
        "type": "string",
        "range": "",
        "units": "",
        "description": ""
      },
	 
     
     
    ]
  },
  

   I have a doubt how to fit in Instance type 1  (15/1)   .  Which is the field  in ma-objects-spec.json  where we can specify the Instance number.

Back to the top