Code Monkey home page Code Monkey logo

Comments (2)

dnav avatar dnav commented on June 18, 2024

Hi,

We also spotted the ambiguity and in the next release of the LwM2M TS, the related text is updated to:

According to the ABNF syntax above, the values are encoded in a CBOR map (Major type 5). The key of the data items is the ID of the underlying Object, Object Instance, Resource, or Resource Instance. Except when used for a Write or Create operation, The IDs inside the top-level payload MUST start with the Object ID.

In the LwM2M CBOR payload of the "Create" operation, MAX_ID 65535 MAY be used to indicate there is no reference to an Object Instance.

We also added this example payloads:

Create Operation Example

A Create operation to the LwM2M ACL Object (Create /2) of the LwM2M example client could contain the following LwM2M CBOR payload. This example has a size of 17 bytes.

A1             # map(1)
   82          # array(2)
      02       # unsigned(2)
      05       # unsigned(5)
   A4          # map(4)
      00       # unsigned(0)
      05       # unsigned(5)
      01       # unsigned(1)
      00       # unsigned(0)
      82       # array(2)
         02    # unsigned(2)
         18 66 # unsigned(102)
      00       # unsigned(0)
      03       # unsigned(3)
      18 65    # unsigned(101)

The same example using the CBOR diagnostic notation is shown below.

{[2, 5]: {0: 5,
          1: 0,
          [2, 102]: 0,
          3: 101}}

In the example above, the LwM2M Server requests the creation of a new Object Instance with ID: 5. To let the LwM2M Client assign the ID of the created Object Instance, the LwM2M CBOR payload could be the following:

A1             # map(1)
   82          # array(2)
      02       # unsigned(2)
      19 FFFF  # unsigned(65535)
   A4          # map(4)
      00       # unsigned(0)
      05       # unsigned(5)
      01       # unsigned(1)
      00       # unsigned(0)
      82       # array(2)
         02    # unsigned(2)
         18 66 # unsigned(102)
      00       # unsigned(0)
      03       # unsigned(3)
      18 65    # unsigned(101)

The same example using the CBOR diagnostic notation is shown below.

{[2, 65535]: {0: 5,
              1: 0,
              [2, 102]: 0,
              3: 101}}

Regards,

from oma_lwm2m_for_developers.

hannestschofenig avatar hannestschofenig commented on June 18, 2024

The bugfix release of the LwM2M v1.2 specification will be published in Q4 2022, according to the plans of the OMA DMSE/IPSO working group and it will contain this fix.

from oma_lwm2m_for_developers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.