Wirepas SDK
poslib_tlv.h
Go to the documentation of this file.
1 
7 #ifndef _POSLIB_TLV_H_
8 #define _POSLIB_TLV_H_
9 
10 #include <stdint.h>
11 
15 typedef enum
16 {
21 
22 
26 typedef struct
27 {
28  uint16_t type;
29  uint8_t * value;
30  uint8_t length;
32 
37 typedef struct
38 {
39  uint8_t * buffer;
40  uint8_t length;
41  uint8_t index;
43 
52 void PosLibTlv_init(poslib_tlv_record * rcd, uint8_t * buffer, uint8_t length);
53 
62  poslib_tlv_item_t * item);
63 
64 
72  poslib_tlv_item_t * item);
73 
74 
75 #endif /* _POSLIB_TLV_H_ */
poslib_tlv_res_e
poslib_tlv_res_e
List of return codes.
Definition: poslib_tlv.h:15
PosLibTlv_Decode_getNextItem
poslib_tlv_res_e PosLibTlv_Decode_getNextItem(poslib_tlv_record *rcd, poslib_tlv_item_t *item)
Decode the next tlv_item in the tlv_record passed in parameter.
poslib_tlv_item_t::value
uint8_t * value
Definition: poslib_tlv.h:29
POSLIB_TLV_RES_ERROR
@ POSLIB_TLV_RES_ERROR
Definition: poslib_tlv.h:18
poslib_tlv_item_t
Structure describing a Type Length Value item.
Definition: poslib_tlv.h:26
POSLIB_TLV_RES_END
@ POSLIB_TLV_RES_END
Definition: poslib_tlv.h:19
PosLibTlv_Encode_addItem
poslib_tlv_res_e PosLibTlv_Encode_addItem(poslib_tlv_record *rcd, poslib_tlv_item_t *item)
Encode tlv_item in the tlv_record passed as parameter.
poslib_tlv_item_t::type
uint16_t type
Definition: poslib_tlv.h:28
POSLIB_TLV_RES_OK
@ POSLIB_TLV_RES_OK
Definition: poslib_tlv.h:17
poslib_tlv_record::buffer
uint8_t * buffer
Definition: poslib_tlv.h:39
poslib_tlv_record
This structure holds the buffer containing TLV items and data to manage it, max. buffer size and curr...
Definition: poslib_tlv.h:37
PosLibTlv_init
void PosLibTlv_init(poslib_tlv_record *rcd, uint8_t *buffer, uint8_t length)
Initialize a TLV record.
poslib_tlv_item_t::length
uint8_t length
Definition: poslib_tlv.h:30
poslib_tlv_record::index
uint8_t index
Definition: poslib_tlv.h:41