Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MTU exchange procedure

When the macro NRF_SDH_BLE_GATT_MAX_MTU_SIZE is changed in the sdk_config.h file of any example from the ble_peripheral folder, the slave sends the message Exchange MTU Request (ATT_EXCHANGE_MTU_REQ) immediately after the connect event.
Is it correct?
As I understand, the ATT_EXCHANGE_MTU_REQ request shall only be sent once during a connection by the ATT client (the master).
Am I missing something?

nRF52840
nRF5_SDK_16.0.0_98a08e2
s140_nrf52_7.0.1_softdevice.hex

Parents
  • You did not answer my question.
    Your link "Data Length Update Procedure" is not related to the question at all (this is a procedure for LL PDU).
    The "GATTC ATT_MTU Exchange" link shows the correct procedure for the GATT Client, the "GATTS ATT_MTU Exchange" link - for the GATT Server.
    But the question was different: Why does the GATT Server (any peripheral example) send an ATT_EXCHANGE_MTU_REQ request at all?
    Bluetooth Core Specification indicates that "The ATT_EXCHANGE_MTU_REQ PDU is used by the client to inform the server of the client’s maximum receive MTU size and request the server to respond with its maximum receive MTU size".

  • Hi, 

    alemv said:
    Why does the GATT Server (any peripheral example) send an ATT_EXCHANGE_MTU_REQ request at all?

    As the central and peripheral are the GAP roles of the device, while the server and client are the GATT roles of the device. Better explained in this thread.

    -Amanda H. 

  • The topic you were referring to does inform nothing about ATT_EXCHANGE_MTU_REQ.

    It seems you do not understand my question. I will try to explain in steps:
    - select for example BLE Blinky Application (<InstallFolder>\examples\ble_peripheral\ble_app_blinky);
    - increase NRF_SDH_BLE_GATT_MAX_MTU_SIZE in sdk_config.h:
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 50;
    - build and run example;
    - establish BLE connection.

    The roles of the BLE Blinky Application in this connection are:
    - LL slave
    - GAP peripheral
    - GATT server

    So the question is the same: Why does the GATT server (BLE Blinky Application) send an ATT_EXCHANGE_MTU_REQ request at all?


    BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part F
    3.4.2 MTU exchange
    3.4.2.1 ATT_EXCHANGE_MTU_REQ
    The ATT_EXCHANGE_MTU_REQ PDU is used by the client to inform the server of the client’s maximum receive MTU size and request the server to respond with its maximum receive MTU size.

    Please do not redirect me to the threads not related to the question.

  • Hi, 

    alemv said:
    The ATT_EXCHANGE_MTU_REQ PDU is used by the client to inform the server of the client’s maximum receive MTU size and request the server to respond with its maximum receive MTU size.

    The spec. indicates that MTU exchange is only used by the Client, but the paragraph does not explicitly prohibit the server from doing the same. BT spec is usually not this vague in its description. Both Central and Peripheral devices can issue an MTU exchange request, regardless of the GATT role. Our SoftDevice will handle the request so as to be in accordance with BT spec.  Please see this similar question

    -Amanda H. 

  • In my opinion, your interpretation of the "The ATT_EXCHANGE_MTU_REQ PDU is used by the client to inform the server" as "the paragraph does not explicitly prohibit the server from doing the same" is very controversial.
    Because:
    1. The ATT_EXCHANGE_MTU_REQ PDU has "Client Rx MTU" parameter, not "Rx MTU" or "Server Rx MTU";
    2. If the GATT server sends the MTU request, it may cause problems:
    - with Windows 10, see this message
    - with Linux (Python + BluePY + Bluez), see this thread

    So, in my opinion, the modifying on_connected_evt() function in nrf_ble_gatt.c like in this message is not a good alternative. A preprocessor macro or other choice for a programmer would be better.

    Anyway, thank you for your time and clarification of your position.

Reply
  • In my opinion, your interpretation of the "The ATT_EXCHANGE_MTU_REQ PDU is used by the client to inform the server" as "the paragraph does not explicitly prohibit the server from doing the same" is very controversial.
    Because:
    1. The ATT_EXCHANGE_MTU_REQ PDU has "Client Rx MTU" parameter, not "Rx MTU" or "Server Rx MTU";
    2. If the GATT server sends the MTU request, it may cause problems:
    - with Windows 10, see this message
    - with Linux (Python + BluePY + Bluez), see this thread

    So, in my opinion, the modifying on_connected_evt() function in nrf_ble_gatt.c like in this message is not a good alternative. A preprocessor macro or other choice for a programmer would be better.

    Anyway, thank you for your time and clarification of your position.

Children
Related