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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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 --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,
-- 
2.26.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux