adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
623 stars 497 forks source link

Changing MTU not possible #539

Closed pythonimus closed 4 years ago

pythonimus commented 4 years ago

Describe the bug When reading from a Characteristic only the first 20 bytes are read. When attampting to change the MTU to read larger Characteristics the MTU is not actually changed.

When I invoke the change MTU function just like in the example noting happens: Serial.println(conn->getMtu()); conn->requestPHY(); conn->requestDataLengthUpdate(); conn->requestMtuExchange(300); conn->requestConnectionParameter(6); delay(1000); Serial.println(conn->getMtu());

output of the console ist just: 23 23

The MTU is never changed.

Set up (mandatory)

To Reproduce Steps to reproduce the behavior:

  1. Get an app on Android which has Characteristics over 20 bytes and expects you to change the MTU.
  2. Change MTU and read from Characteristic
hathach commented 4 years ago

Can you try to have another feather running as peripheral, the Android app may not support and/or handle the MTU negotiation request. Also please provide the debug log with level = 2 as well.

hathach commented 4 years ago

closed due to lack of user response.

ProgrammingCube commented 4 years ago

I have found a solution! The default max length of MTU is 23. To change this, change line 64 in the file:

Arduino15/packages/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/softdevice/s140_nrf52_6.1.1_API/include/ble_gatt.h

or equivalent. You should see a define of 23.