[PATCH BlueZ v2 06/13] shared/att: Add BT_ATT_DEFAULT_LE_MTU macro.

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

 



Moved the ATT_DEFAULT_LE_MTU to att-types.h to make it public.
---
 src/shared/att-types.h | 2 ++
 src/shared/att.c       | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/shared/att-types.h b/src/shared/att-types.h
index 1637f6f..b85c969 100644
--- a/src/shared/att-types.h
+++ b/src/shared/att-types.h
@@ -23,6 +23,8 @@
 
 #include <stdint.h>
 
+#define BT_ATT_DEFAULT_LE_MTU 23
+
 /* ATT protocol opcodes */
 #define BT_ATT_OP_ERROR_RSP	      		0x01
 #define BT_ATT_OP_MTU_REQ			0x02
diff --git a/src/shared/att.c b/src/shared/att.c
index 73f5552..a5cab45 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -35,8 +35,8 @@
 #include "src/shared/timeout.h"
 #include "lib/uuid.h"
 #include "src/shared/att.h"
+#include "src/shared/att-types.h"
 
-#define ATT_DEFAULT_LE_MTU		23
 #define ATT_MIN_PDU_LEN			1  /* At least 1 byte for the opcode. */
 #define ATT_OP_CMD_MASK			0x40
 #define ATT_OP_SIGNED_MASK		0x80
@@ -698,7 +698,7 @@ struct bt_att *bt_att_new(int fd)
 
 	att->fd = fd;
 
-	att->mtu = ATT_DEFAULT_LE_MTU;
+	att->mtu = BT_ATT_DEFAULT_LE_MTU;
 	att->buf = malloc(att->mtu);
 	if (!att->buf)
 		goto fail;
@@ -833,7 +833,7 @@ bool bt_att_set_mtu(struct bt_att *att, uint16_t mtu)
 	if (!att)
 		return false;
 
-	if (mtu < ATT_DEFAULT_LE_MTU)
+	if (mtu < BT_ATT_DEFAULT_LE_MTU)
 		return false;
 
 	buf = malloc(mtu);
-- 
2.1.0.rc2.206.gedb03e5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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