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

Relationship between ATT_MTU and Gatt Attribute Max. Length

Hello all

 I've read various other threads concerning this topic, but I still can't wrap my head around it.

 What I think I understand of this topic:

  • ATT_MTU can be anything from 23 bytes and more. However is limited by the available RAM.
  • The ATT_MTU – 3 value defines the maximum data which can be sent via BLE in one application data packet
  • The ATT_MTU is negotiated during the pairing process, the smaller value of both devices is selected

My question now is: What is the GATT Attribute Max. Length for?

Consider the following scenario:

  1. I implement a new service and define a characteristic to use a length of 64 Bytes
  2. I set the ATT_MTU of my device to 128 Bytes (Just some random value greater than 64+3)
  3. I start the application and connect to another device
  4. An ATT_MTU of 23 Bytes is negotiated, because the other device has an ATT_MTU of 23
  • As far as I see it, I can’t use my characteristic with a length of 64 Bytes in this case. Is this correct?
  • If this is the case, why have the option to set a maximum length if it mainly depends on the dynamically set ATT_MTU size?

Parents Reply
  • Thanks for your answer so far.

    I have the following setup:

    • 1 Nordic DK in the server role (nRF52840, S140, SDK15.3)
    • 1 Smartphone App (Android or IOs) as client

    I have 1 service with 2 charateristics: 1 input characterisitc, the smartphone can write to and 1 output characterisitc where I output data via notifications. The smartphone can register to this output characterisitc to receive data from the server. The exchanged data between the devices can range from about 20 to 120 bytes.

    I'm only responsible for the server application and have no knowledge about the smartphone application.

    Q1: Can I assume that any smartphone which supports BLE 5.0 could be expected to provide an ATT_MTU of about 120bytes ?

    Q2: If the answer to Q1 is no, do I have to implement some business logic which handles a kind of data framgentation according to the currently negotiated ATT_MTU?

    Q3: Does this long-write also work for notifications?

    Q4 :Are long-write and queued write the same? Is there an example of long-writes?

Children
No Data
Related