aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-06-06 15:35:19 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-19 14:18:17 -0300
commit52bcf407876b0d9c45eba44a297592b1f7594337 (patch)
tree1f60d628114985e85161552f1888671c5b59889c
parentf917a038ec3fb5b91625e9119f6e98cefd6190e5 (diff)
downloadbluez-52bcf407876b0d9c45eba44a297592b1f7594337.tar.gz
bluez-52bcf407876b0d9c45eba44a297592b1f7594337.tar.xz
bluez-52bcf407876b0d9c45eba44a297592b1f7594337.zip
attrib-server: Fix MTU for GATT
This patch changes the size of the input and output buffers to the same size of the channel MTU. The channel MTU, in turn, is the L2CAP MTU for BR/EDR channels, and the ATT MTU for LE channels. This value can change between calls to channel_handler if a GATT MTU exchange procedure is performed, which is only supported by LE channels.
-rw-r--r--src/attrib-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 5adbf92a..02abd9e0 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -910,7 +910,7 @@ static void channel_handler(const uint8_t *ipdu, uint16_t len,
gpointer user_data)
{
struct gatt_channel *channel = user_data;
- uint8_t opdu[ATT_MAX_MTU], value[ATT_MAX_MTU];
+ uint8_t opdu[channel->mtu], value[channel->mtu];
uint16_t length, start, end, mtu, offset;
bt_uuid_t uuid;
uint8_t status = 0;