BLE: how to get mtu size?

newsettler_AI
Posts: 121
Joined: Wed Apr 05, 2017 12:49 pm

BLE: how to get mtu size?

Postby newsettler_AI » Wed Dec 05, 2018 4:36 pm

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

newsettler_AI
Posts: 121
Joined: Wed Apr 05, 2017 12:49 pm

Re: BLE: how to get mtu size?

Postby newsettler_AI » Fri Dec 07, 2018 12:51 pm

Any ideas?

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: BLE: how to get mtu size?

Postby PeterR » Fri Dec 07, 2018 2:55 pm

You get it on the event ESP_GATTS_MTU_EVT in p_data->mtu.mtu
& I also believe that IDF CAN should be fixed.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: BLE: how to get mtu size?

Postby chegewara » Fri Dec 07, 2018 2:59 pm

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.

Who is online

Users browsing this forum: akasaka_spk and 102 guests