joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

M2MTLVDeserializer Class Reference

M2MTLVDeserializer Class Reference

M2MTLVDeserializer TLV Deserialiser get the object instances and resources as binary data and builds the lwm2m representation from it. More...

#include <m2mtlvdeserializer.h>

Public Member Functions

 M2MTLVDeserializer ()
 Constructor.
virtual ~M2MTLVDeserializer ()
 Destructor.
bool is_object_instance (uint8_t *tlv)
 This method checks whether the given binary encodes an object instance or something else.
bool is_resource (uint8_t *tlv)
 This method checks whether the given binary encodes a resource or something else.
bool is_multiple_resource (uint8_t *tlv)
 This method checks whether the given binary encodes a multiple resource or something else.
bool is_resource_instance (uint8_t *tlv)
 This method checks whether the given binary encodes a resource instance or something else.
M2MTLVDeserializer::Error deserialise_object_instances (uint8_t *tlv, uint32_t tlv_size, M2MObject &object, M2MTLVDeserializer::Operation operation)
 Deserialises the given binary that must encode object instances.
M2MTLVDeserializer::Error deserialize_resources (uint8_t *tlv, uint32_t tlv_size, M2MObjectInstance &object_instance, M2MTLVDeserializer::Operation operation)
 Deserialises the given binary that must encode resources.
M2MTLVDeserializer::Error deserialize_resource_instances (uint8_t *tlv, uint32_t tlv_size, M2MResource &resource, M2MTLVDeserializer::Operation operation)
 Deserialises the given binary that must encode resource instances.
uint16_t instance_id (uint8_t *tlv)
 This method return object instance id or resource id.

Detailed Description

M2MTLVDeserializer TLV Deserialiser get the object instances and resources as binary data and builds the lwm2m representation from it.

See OMA-LWM2M specification, chapter 6.1 for the resource model and chapter 6.3.3 for the OMA-TLV specification.

Definition at line 28 of file m2mtlvdeserializer.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 25 of file m2mtlvdeserializer.cpp.

~M2MTLVDeserializer (  ) [virtual]

Destructor.

Definition at line 29 of file m2mtlvdeserializer.cpp.


Member Function Documentation

M2MTLVDeserializer::Error deserialise_object_instances ( uint8_t *  tlv,
uint32_t  tlv_size,
M2MObject object,
M2MTLVDeserializer::Operation  operation 
)

Deserialises the given binary that must encode object instances.

Binary array can be checked before invoking this method with

Definition at line 53 of file m2mtlvdeserializer.cpp.

M2MTLVDeserializer::Error deserialize_resource_instances ( uint8_t *  tlv,
uint32_t  tlv_size,
M2MResource resource,
M2MTLVDeserializer::Operation  operation 
)

Deserialises the given binary that must encode resource instances.

Binary array can be checked before invoking this method.

Definition at line 89 of file m2mtlvdeserializer.cpp.

M2MTLVDeserializer::Error deserialize_resources ( uint8_t *  tlv,
uint32_t  tlv_size,
M2MObjectInstance object_instance,
M2MTLVDeserializer::Operation  operation 
)

Deserialises the given binary that must encode resources.

Binary array can be checked before invoking this method.

Definition at line 72 of file m2mtlvdeserializer.cpp.

uint16_t instance_id ( uint8_t *  tlv )

This method return object instance id or resource id.

Parameters:
tlvBinary to be checked
Returns:
Object instance id or resource id.

Definition at line 351 of file m2mtlvdeserializer.cpp.

bool is_multiple_resource ( uint8_t *  tlv )

This method checks whether the given binary encodes a multiple resource or something else.

It returns true if bits 7-6 of the first byte is "10".

Parameters:
tlvBinary to be checked as LWM2M multiple resource.
Returns:
true or false.

Definition at line 43 of file m2mtlvdeserializer.cpp.

bool is_object_instance ( uint8_t *  tlv )

This method checks whether the given binary encodes an object instance or something else.

It returns true if bits 7-6 of the first byte is "00".

Parameters:
tlvBinary to be checked as LWM2M object instance
Returns:
true or false.

Definition at line 33 of file m2mtlvdeserializer.cpp.

bool is_resource ( uint8_t *  tlv )

This method checks whether the given binary encodes a resource or something else.

It returns true if bits 7-6 of the first byte is "11".

Parameters:
tlvBinary to be checked as LWM2M resource.
Returns:
true or false.

Definition at line 38 of file m2mtlvdeserializer.cpp.

bool is_resource_instance ( uint8_t *  tlv )

This method checks whether the given binary encodes a resource instance or something else.

It returns true if bits 7-6 of the first byte is "01".

Parameters:
tlvBinary to be checked as LWM2M resource instance.
Returns:
true or false.

Definition at line 48 of file m2mtlvdeserializer.cpp.