TR-0057 oneM2M Primitives
Primitives are service layer messages transmitted over the Mca/Mcc/Mcc’ reference points.
Originators send requests to Receivers via primitives. Originator and Receiver can be an AE or a CSE.
Each CRUD+N operation consists of one request and one response primitive.
General primitives flow
Primitives are binded to underlying transport layer protocols such as HTTP, CoAP , MQTT or WebSocket. Primitives are generic with respect to underlying network transport protocols. Each primitive is binded to zero or more messages in the transport layer.
A primitive consists of two parts; control and content.
- The control part: contains parameters required for the processing of the primitive itself (e.g. request or response parameters).
- The content part is optional based on the type of primitive and contains the representation of the resource consisting of all or a subset of the resource attributes.
Primitives are encoded and serialized based on the particular oneM2M protocol binding being used.
The originator and receiver of each primitive use the same binding, and thus use compatible forms of encoding/ decoding and serialization/de-serialization.
During transfer, the control part is encoded based on the protocol binding being used and the content portion is serialized using XML, JSON and CBOR.
Example of Control part binded to HTTP
The Content part of a primitive contains serialized representation of a resource. oneM2M supports XML, JSON or CBOR serializations of resources.
This is an example of a oneM2M <container> resource representation in JSON format.
This is an example of a oneM2M <container> resource representation in XML format.