This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About ATT_MTU

According to BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part G page 2248

Exchange MTU procedure is initiated by the Cilent, and only be initiated once.

But by looking at the data_length_update function in nrf_ble_gatt.c, Exchange MTU is initiated regardless of whether the device is a server or a client

According to the sniffer made with PCA10040, found both client and server initiated an Exchange MTU procedure, is this a violation of the rules?

My client is iphone6s, use APP is LightBlue, but I think APP is not the key.

  • Not sure exactly which softdevice you are using, but the SD supports both server and client role, so this could happen. Note that on page 2185, you can see that "It is permitted, (but not necessary - see 2.) to exchange MTU in both directions, but the MTUs shall be the same in each direction (see 1.)

  • Quick note: iOS has issues with breaking spec when it comes to MTU exchanges.As run_ar states below, it is allowed (but superfluous) to perform the procedure twice, since you HAVE TO use the same parameters. iOS devices will in some cases use different values, and then strange things happenes.

  • Thanks.Your idea is to suppose that softdevice supports both client and server, so that each of these initiating exchange MTUs is permissible? I have a hypothetical question, if the softdevice only supports server does not support the client, is not it can not initiate exchange MTU?

  • It depends: most likely there is no test case that make sure it does not initate the MTU exchange, so it should not be a problem if you do this. Note that you can modify the gatt module (nrf_ble_gatt.c) so it does not call the sd_ble_gattc_exchange_mtu_request. However, in most applications you would be interested in the GAP service of the peer, so I don't think there is many applications where you would not be a gatt client. But in case your stack did not support the gatt client profile, I doubt it would support initiating the att mtu exchange.

Related