mbed client lightswitch demo

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of mbed-client-classic-example-lwip by Austin Blackstone

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>

Public Member Functions

 M2MTLVSerializer ()
 Constructor.
virtual ~M2MTLVSerializer ()
 Destructor.
uint8_t * serialize (M2MObjectInstanceList object_instance_list, uint32_t &size)
 Serialises given objects instances that contain resources or multiple resources.
uint8_t * serialize (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 28 of file m2mtlvserializer.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 20 of file m2mtlvserializer.cpp.

~M2MTLVSerializer (  ) [virtual]

Destructor.

Definition at line 24 of file m2mtlvserializer.cpp.


Member Function Documentation

uint8_t * serialize ( M2MObjectInstanceList  object_instance_list,
uint32_t &  size 
)

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 ( M2MResourceList  resource_list,
uint32_t &  size 
)

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.