Closed p30arena closed 2 years ago
Bluezero is built on top of the BlueZ D-Bus API which is documented at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc
If you know how BlueZ gets access to that information then I can tell you how to do it in Bluezero. If you don't know how to do it with BlueZ then I'll need to know a little bit more about what your are doing. GATT central? GATT peripheral? Read? Write? Notify? For example.
can I share with you a Qt code so you can better understand what I mean?
QLowEnergyController *leController = NULL;
...
leController->setProperty("MTU", 512);
...
If I don't set the MTU to 512, the iPhone selects 23 as preferred MTU and it is not negotiable after connection.
I think it is ATT MTU that should be changed, am a bit confused.
iOS will not allow that you request the MTU size, but will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)
So there must be a way to tell the iOS that our MTU is higher than the default. Qt is also using Bluez.
MTU values are set in the GATT api if it is a GATT Server (peripheral) you are creating.
sorry didn't mention it earlier! yes, it is GATT Server (peripheral).
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/gatt-api.txt#n297
so the MTU must be set on every characteristic?
Qt seems to be ignoring
https://code.qt.io/cgit/qt/qtconnectivity.git/tree/src/bluetooth/qlowenergycontroller_bluez.cpp#n797
case QBluezConst::AttCommand::ATT_OP_EXCHANGE_MTU_REQUEST:
handleExchangeMtuRequest(incomingPacket);
return;
https://code.qt.io/cgit/qt/qtconnectivity.git/tree/src/bluetooth/bluez
Qt is not using dbus to communicate with BlueZ.
@ukBaz can I add it here?
https://github.com/ukBaz/python-bluezero/blob/main/bluezero/localGATT.py#L243 'MTU': 512
I checked and saw that MTU is 182 so BlueZ does that automatically on a Bluetooth v5
iOS doesn't support "Request MTU" and negotiates MTU on the connection stage. how can I set the MTU to 512 in bluezero?