Trident IoT SDK
 
Loading...
Searching...
No Matches
tr_tlv_parser.h
Go to the documentation of this file.
1
10
11#ifndef TR_TLV_PARSER_H
12#define TR_TLV_PARSER_H
13
14#include <stdint.h>
15#include <stddef.h>
16#include <stdbool.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
36bool find_tlv_by_tag(const uint8_t *buffer,
37 size_t buffer_len,
38 uint8_t tag,
39 uint8_t *out_value,
40 uint8_t *out_value_len);
41
53bool update_tlv_tag(uint8_t *buffer,
54 size_t buffer_size,
55 uint8_t tag,
56 const uint8_t *value,
57 uint8_t length);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif // TR_TLV_PARSER_H
bool find_tlv_by_tag(const uint8_t *buffer, size_t buffer_len, uint8_t tag, uint8_t *out_value, uint8_t *out_value_len)
Search for a TLV entry by tag and validate its length.
bool update_tlv_tag(uint8_t *buffer, size_t buffer_size, uint8_t tag, const uint8_t *value, uint8_t length)
Update an existing TLV entry if found, or append a new one. Assumes unused buffer space is filled wit...