I have configured the server with max mtu size of 512 and changed the start location of the app to allow for a larger SoftDevice. I have done this both for an mtu of 512 and 247 and 24.
From the Android I request 512 bytes and the negotiation from the server returns the correct value 512 or 247 or 24 depending upon the pre-set max MTU size.
Now its time to do a notification. I am trying to send 85 bytes. With an MTU of 23 I had to split it and send several notifications until all was sent. That worked. Now I expect I should be able to send the 85-byte packet in one try for the 512 and 247 case. However, I get an error 0x000C on the sd_ble_gatts_hvx() call in all cases which translates to 'incorrect data size'. This is followed by the server disconnecting, There is no documentation that explains what might cause this. In spite of everything LOOKING like I should work with the new MTU size, SoftDevice is still acting like it's set to an MTU of 23.
I have asked in another post what the maximum MTU size is per platform and per SoftDevice; information which should be easy to find but nothing is easy to find with the search engine provided by the documentation web app.
What could be causing that error? I assume it must be due to the MTU size since MTU = 23 works.
Does it have something to do with NRF_SDH_BLE_GAP_DATA_LENGTH? How do NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE on the peripheral relate? Can the peripheral request an MTU change?