diff --git a/src/shared/util.c b/src/shared/util.c
index c0c2c4a..74d4367 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
- * Copyright 2023 NXP
+ * Copyright 2023-2024 NXP
*
*
*/
return true;
}
+/* Helper to add l,t,v data in an iovec struct */
+void util_ltv_push(struct iovec *output, uint8_t l, uint8_t t, void *v)
+{
+ output->iov_base = realloc(output->iov_base, output->iov_len + l + 2);
+ util_iov_push_u8(output, l + 1);
+ util_iov_push_u8(output, t);
+ util_iov_push_mem(output, l, v);
+}
+
/* Helper to print debug information of LTV entries */
bool util_debug_ltv(const uint8_t *data, uint8_t len,
const struct util_ltv_debugger *debugger, size_t num,
diff --git a/src/shared/util.h b/src/shared/util.h
index 6322b13..accacc7 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
- * Copyright 2023 NXP
+ * Copyright 2023-2024 NXP
*
*
*/
util_debug_func_t func, void *user_data);
};
+void util_ltv_push(struct iovec *output, uint8_t l, uint8_t t, void *v);
+
bool util_debug_ltv(const uint8_t *data, uint8_t len,
const struct util_ltv_debugger *debugger, size_t num,
util_debug_func_t function, void *user_data);