diff --git a/android/gatt.c b/android/gatt.c
index f754f30..49fff6f 100644
--- a/android/gatt.c
+++ b/android/gatt.c
/* Send exchange mtu request as we assume being client and server */
/* TODO: Dont exchange mtu if no client apps */
- send_exchange_mtu_request(dev);
+
+ /* MTU exchange shall not be used on BR/EDR - Vol 3. Part G. 4.3.1 */
+ if (cid == ATT_CID)
+ send_exchange_mtu_request(dev);
/*
* Service Changed Characteristic and CCC Descriptor handles
static uint8_t mtu_att_handle(const uint8_t *cmd, uint16_t cmd_len,
struct gatt_device *dev)
{
- uint16_t mtu, imtu, omtu;
+ uint16_t mtu, imtu, omtu, cid;
size_t length;
GIOChannel *io;
GError *gerr = NULL;
io = g_attrib_get_channel(dev->attrib);
bt_io_get(io, &gerr,
+ BT_IO_OPT_CID, &cid,
BT_IO_OPT_IMTU, &imtu,
BT_IO_OPT_OMTU, &omtu,
BT_IO_OPT_INVALID);
return ATT_ECODE_UNLIKELY;
}
+ /* MTU exchange shall not be used on BR/EDR - Vol 3. Part G. 4.3.1 */
+ if (cid != ATT_CID)
+ return ATT_ECODE_UNLIKELY;
+
rsp = g_attrib_get_buffer(dev->attrib, &length);
/* Respond with our IMTU */