Wirepas SDK
tlv.h
Go to the documentation of this file.
1
6#ifndef TLV_H_
7#define TLV_H_
8
9#include <stdint.h>
10
20
21
25typedef struct
26{
27 uint8_t * value;
28 uint16_t type;
29 uint8_t length;
31
36typedef struct
37{
38 uint8_t * buffer;
39 uint8_t length;
40 uint8_t index;
42
51void Tlv_init(tlv_record * rcd, uint8_t * buffer, uint8_t length);
52
61
70
78
79#endif /* TLV_H_ */
void Tlv_init(tlv_record *rcd, uint8_t *buffer, uint8_t length)
Initialize a TLV record.
uint8_t * buffer
Definition tlv.h:38
tlv_res_e Tlv_Decode_getNextItem(tlv_record *rcd, tlv_item_t *item)
Decode the next tlv_item in the tlv_record passed in parameter.
tlv_res_e
List of return codes.
Definition tlv.h:15
@ TLV_RES_OK
Definition tlv.h:16
@ TLV_RES_ERROR
Definition tlv.h:17
@ TLV_RES_END
Definition tlv.h:18
tlv_res_e Tlv_Encode_addItem(tlv_record *rcd, tlv_item_t *item)
Add a TLV item to the buffer contained in the TLV record.
uint8_t * value
Definition tlv.h:27
uint8_t index
Definition tlv.h:40
uint8_t length
Definition tlv.h:29
uint16_t type
Definition tlv.h:28
int Tlv_Encode_getBufferSize(tlv_record *rcd)
Returns the size of the generated buffer by successive calls to Tlv_Encode_addItem.
Structure describing a Type Length Value item.
Definition tlv.h:26
This structure holds the buffer containing TLV items and data to manage it, max. buffer size and curr...
Definition tlv.h:37