nRF5 IoT SDK  v0.9.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
OMA LWM2M object TLV encoder and decoder API

OMA LWM2M object TLV encoder and decoder API. More...

Functions

uint32_t lwm2m_tlv_server_decode (lwm2m_server_t *p_server, uint8_t *p_buffer, uint32_t buffer_len)
 Decode a LWM2M server object from a TLV byte buffer. More...
 
uint32_t lwm2m_tlv_server_encode (uint8_t *p_buffer, uint32_t *p_buffer_len, lwm2m_server_t *p_server)
 Encode a LWM2M server object to a TLV byte buffer. More...
 
uint32_t lwm2m_tlv_security_decode (lwm2m_security_t *p_security, uint8_t *p_buffer, uint32_t buffer_len)
 Decode a LWM2M security object from a TLV byte buffer. More...
 
uint32_t lwm2m_tlv_security_encode (uint8_t *p_buffer, uint32_t *p_buffer_len, lwm2m_security_t *p_security)
 Encode a LWM2M security object to a TLV byte buffer. More...
 

Detailed Description

OMA LWM2M object TLV encoder and decoder API.

Function Documentation

uint32_t lwm2m_tlv_security_decode ( lwm2m_security_t p_security,
uint8_t *  p_buffer,
uint32_t  buffer_len 
)

Decode a LWM2M security object from a TLV byte buffer.

Note
Resource values NOT found in the tlv will not be altered.
Warning
lwm2m_string_t and lwm2m_opaque_t values will point to the byte buffer and needs to be copied by the application before the byte buffer is freed.
Parameters
[out]p_securityPointer to a LWM2M server object to be filled by the decoded TLVs.
[in]p_bufferPointer to the TLV byte buffer to be decoded.
[in]buffer_lenSize of the buffer to be decoded.
Return values
NRF_SUCCESSIf decoding was successfull.
uint32_t lwm2m_tlv_security_encode ( uint8_t *  p_buffer,
uint32_t *  p_buffer_len,
lwm2m_security_t p_security 
)

Encode a LWM2M security object to a TLV byte buffer.

Parameters
[out]p_bufferPointer to a byte buffer to be used to fill the encoded TLVs.
[in,out]p_buffer_lenValue by reference inicating the size of the buffer provided. Will return the number of used bytes on return.
[in]p_securityPointer to the LWM2M security object to be encoded into TLVs.
Return values
NRF_SUCCESSIf the encoded was successfull.
uint32_t lwm2m_tlv_server_decode ( lwm2m_server_t p_server,
uint8_t *  p_buffer,
uint32_t  buffer_len 
)

Decode a LWM2M server object from a TLV byte buffer.

Note
Resource values NOT found in the tlv will not be altered.
Warning
lwm2m_string_t and lwm2m_opaque_t values will point to the byte buffer and needs to be copied by the application before the byte buffer is freed.
Parameters
[out]p_serverPointer to a LWM2M server object to be filled by the decoded TLVs.
[in]p_bufferPointer to the TLV byte buffer to be decoded.
[in]buffer_lenSize of the buffer to be decoded.
Return values
NRF_SUCCESSIf decoding was successfull.
uint32_t lwm2m_tlv_server_encode ( uint8_t *  p_buffer,
uint32_t *  p_buffer_len,
lwm2m_server_t p_server 
)

Encode a LWM2M server object to a TLV byte buffer.

Parameters
[out]p_bufferPointer to a byte buffer to be used to fill the encoded TLVs.
[in,out]p_buffer_lenValue by reference indicating the size of the buffer provided. Will return the number of used bytes on return.
[in]p_serverPointer to the LWM2M server object to be encoded into TLVs.
Return values
NRF_SUCCESSIf the encoded was successfull.