Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. BLE MTU Exchange
Qt 6.11 is out! See what's new in the release blog

BLE MTU Exchange

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 2.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TyChapin
    wrote on last edited by
    #1

    Hi,

    I have been trying to read over BLE a 64 byte message characteristic value. I know that my problem is the MTU exchange between devices. What I can not figure out is why Qt won't update my QLowEnergyController with the correct MTU.

    Upon connection, the MTU is set to the default value of 23. I read it off using m_control->mtu(); to see this. Then once I connect to a service, the MTU is 256 which is what the BLE device wants it to be at. When I go to read the characteristic value that has 64 bytes, only 24 bytes come over. I am unsure what I am doing incorrectly.

    I have tried using the m_control->requestConnectionUpdate(params); function to request the new MTU value to be set but I receive this error "qt.bluetooth.darwin: Connection update not implemented on your platform". I honestly do not understand what this means and can not find anything where it talks about this.

    Does anyone have any advice on how to exchange the MTU size properly?

    Paul ColbyP 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You can read the message literally: the underlying OS does not allow to change the MTU.

      This seems to be confirmed by this thread on Apple's developer forum.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • T TyChapin

        Hi,

        I have been trying to read over BLE a 64 byte message characteristic value. I know that my problem is the MTU exchange between devices. What I can not figure out is why Qt won't update my QLowEnergyController with the correct MTU.

        Upon connection, the MTU is set to the default value of 23. I read it off using m_control->mtu(); to see this. Then once I connect to a service, the MTU is 256 which is what the BLE device wants it to be at. When I go to read the characteristic value that has 64 bytes, only 24 bytes come over. I am unsure what I am doing incorrectly.

        I have tried using the m_control->requestConnectionUpdate(params); function to request the new MTU value to be set but I receive this error "qt.bluetooth.darwin: Connection update not implemented on your platform". I honestly do not understand what this means and can not find anything where it talks about this.

        Does anyone have any advice on how to exchange the MTU size properly?

        Paul ColbyP Offline
        Paul ColbyP Offline
        Paul Colby
        wrote on last edited by
        #3

        Hi @TyChapin,

        Upon connection, the MTU is set to the default value of 23.

        That's only a "we don't know yet" default, which is, frankly, pretty meaningless. As per the docs:

        Before the connection setup and MTU negotiation, the default value of 23 will be returned.

        @TyChapin said in BLE MTU Exchange:

        Then once I connect to a service, the MTU is 256 which is what the BLE device wants it to be at.

        Yep, that (256) would be the real, negotiated, MTU.

        @TyChapin said in BLE MTU Exchange:

        When I go to read the characteristic value that has 64 bytes, only 24 bytes come over.
        Does anyone have any advice on how to exchange the MTU size properly?

        I suspect the problem is not MTU related. In most cases, the MTU should not affect the characteristic data size (just performance), because the BLE stack will use as many MTU's as needed to transfer the characteristic's data.

        How are you checking the characteristic value's length? ie how do you know that the "value has 64 bytes", and "only 24 bytes come over"?

        (Also, if its a publicly documented characteristic, and you're able to share the UUID, that might help, but no worries if not).

        Cheers.

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved