bug fix

Dependencies:   HTS221

Embed: (wiki syntax)

« Back to documentation index

M2MTLVSerializer Class Reference

M2MTLVSerializer Class Reference

M2MTLVSerializer TLV Serialiser constructs the binary representation of object instances, resources and resource instances (see OMA-LWM2M specification, chapter 6.1 for resource model) as OMA-TLV according described in chapter 6.3.3. More...

#include <m2mtlvserializer.h>

Static Public Member Functions

static uint8_t * serialize (const M2MObjectInstanceList &object_instance_list, uint32_t &size)
 Serialises given objects instances that contain resources or multiple resources.
static uint8_t * serialize (const M2MResourceList &resource_list, uint32_t &size)
 Serialises given resources with no information about the parent object instance.

Detailed Description

M2MTLVSerializer TLV Serialiser constructs the binary representation of object instances, resources and resource instances (see OMA-LWM2M specification, chapter 6.1 for resource model) as OMA-TLV according described in chapter 6.3.3.

Definition at line 30 of file m2mtlvserializer.h.


Member Function Documentation

uint8_t * serialize ( const M2MObjectInstanceList &  object_instance_list,
uint32_t &  size 
) [static]

Serialises given objects instances that contain resources or multiple resources.

Object instance IDs are also encoded. This method must be used when an operation targets an object with (potential) multiple instances like "GET /1". In that case the generated TLV will contain the following data:

  • ./0
  • ./0/0
  • ./0/1
  • ...
  • ./1
  • ./1/0
  • ./1/1
  • ...
Parameters:
objectsList of object instances.
Returns:
Object instances encoded binary as OMA-TLV
See also:
serializeObjectInstances(List)

Definition at line 28 of file m2mtlvserializer.cpp.

uint8_t * serialize ( const M2MResourceList &  resource_list,
uint32_t &  size 
) [static]

Serialises given resources with no information about the parent object instance.

This method must be used when an operation targets an object instance like "GET /1/0" or a single-instance object like "GET /3//". Resources may have single or multiple instances. The generated TLV will contain the following data as response to "GET /3//":

  • ./0
  • ./1
  • ./2
  • ./6/0 (1st instance of a multiple resource)
  • ./6/1 (2nd instance of a multiple resource)
  • ...
Parameters:
resourcesArray of resources and resource instances.
Returns:
Resources encoded binary as OMA-TLV
See also:
serializeResources(List)

Definition at line 33 of file m2mtlvserializer.cpp.