diff mbox series

[BlueZ,2/5] shared/mgmt: Add mgmt_tlv_add_fixed

Message ID 20201028215824.608794-2-luiz.dentz@gmail.com (mailing list archive)
State New, archived
Headers show
Series [BlueZ,1/5] mgmt: Add support of mgmt TLV API | expand

Commit Message

Luiz Augusto von Dentz Oct. 28, 2020, 9:58 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds mgmt_tlv_add_fixed macro which can be used to add fixed sized
value.
---
 src/shared/mgmt.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/mgmt.h b/src/shared/mgmt.h
index 74b8befd8..319beb62f 100644
--- a/src/shared/mgmt.h
+++ b/src/shared/mgmt.h
@@ -38,6 +38,9 @@  struct mgmt_tlv_list *mgmt_tlv_list_new(void);
 void mgmt_tlv_list_free(struct mgmt_tlv_list *tlv_list);
 bool mgmt_tlv_add(struct mgmt_tlv_list *tlv_list, uint16_t type, uint8_t length,
 								void *value);
+#define mgmt_tlv_add_fixed(_list, _type, _value) \
+	mgmt_tlv_add(_list, _type, sizeof(*(_value)), _value)
+
 unsigned int mgmt_send_tlv(struct mgmt *mgmt, uint16_t opcode, uint16_t index,
 				struct mgmt_tlv_list *tlv_list,
 				mgmt_request_func_t callback,