简体   繁体   English

如何使用dbus / bluez在python中获取当前的MTU

[英]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? 有没有办法使用dbus bluez在python中获得当前客户端连接的MTU?

if I watch btmon I can see the value (503) after connection: 如果我观看btmon ,则在连接后可以看到值(503):

# 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 但是在dbus.bluez api中似乎没有此值的句柄

Any ideas? 有任何想法吗?

Bluez does not expose MTU size on dbus api. Bluez不在dbus api上公开MTU大小。 However this information is given in the Read, Write, etc callbacks in the options parameter. 但是,此信息在options参数的Read,Write等回调中给出。

        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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM