Page 1 of 1

BLE: how to get mtu size?

Posted: Wed Dec 05, 2018 4:36 pm
by newsettler_AI
Is there way to get mtu size via some IDF functions?

I got in logs this number, so I suppose it should be stored somethere:
  1. BT_GATT: attribute value too long, to be truncated to 19[0m
  2.  
  3. ...
  4.  
  5. BT_GATT: attribute value too long, to be truncated to 22[0m

I supposed to see it at ESP_GATTS_MTU_EVT event in gatts_profile_event_handler, but this event doesnt calls at all

Re: BLE: how to get mtu size?

Posted: Fri Dec 07, 2018 12:51 pm
by newsettler_AI
Any ideas?

Re: BLE: how to get mtu size?

Posted: Fri Dec 07, 2018 2:55 pm
by PeterR
You get it on the event ESP_GATTS_MTU_EVT in p_data->mtu.mtu

Re: BLE: how to get mtu size?

Posted: Fri Dec 07, 2018 2:59 pm
by chegewara
Your central device needs to request MTU change. If you think you have it implemented in your app, you can test it with nRF connect for example. Connect to esp32 and there is option to change mtu, upper right corner. What is very strange its truncate to 19. Minimum mtu value is 23 and notify/indicate needs 3 bytes for OP code, so it should truncate to 20 bytes in worst case.