pstanton
pstanton

Reputation: 36669

how to get the current MTU in python using dbus/bluez

Is there a way to attain the current client connection's MTU in python using dbus bluez?

if I watch btmon I can see the value (503) after connection:

# btmon | grep MTU
  ATT: Exchange MTU Request (0x02) len 2
    Client RX MTU: 517
  ATT: Exchange MTU Response (0x03) len 2
    Server RX MTU: 517
  ATT: Exchange MTU Request (0x02) len 2
    Client RX MTU: 503
  ATT: Exchange MTU Response (0x03) len 2
    Server RX MTU: 517

however there seems to be no handle to this value within the dbus.bluez api

Any ideas?

Upvotes: 1

Views: 2367

Answers (1)

Rohit Pai
Rohit Pai

Reputation: 109

Bluez does not expose MTU size on dbus api. However this information is given in the Read, Write, etc callbacks in the options parameter.

        Methods     array{byte} ReadValue(dict options)

        Issues a request to read the value of the
        characteristic and returns the value if the
        operation was successful.

        Possible options: "offset": uint16 offset
                  "mtu": Exchanged MTU (Server only)
                  "device": Object Device (Server only)

Upvotes: 1

Related Questions