From 6da4e6eebfc5e22e7a9df7fda95aa4d793577285 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 20 Jun 2012 14:27:52 -0300 Subject: [PATCH] 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. --- src/attrib-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attrib-server.c b/src/attrib-server.c index 5adbf92ac..9064d15c8 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[ATT_MAX_MTU]; uint16_t length, start, end, mtu, offset; bt_uuid_t uuid; uint8_t status = 0; -- 2.47.3