MTU size configuration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
anhnhancao
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

Dear all,

I have a CYW920721B2 Evaluation Board and want to run the Audio_Headset_and_Speaker Example on ModusToolbox IDE,

The point is that i want to extend the MTU size of BLE connection to 247 (Default is 23 byte). I've read some answers on Cypress forum and they recommend to edit "gatt_cfg.max_mtu_size" and also call wiced_bt_gatt_configure_mtu() API when the BLE connection is established to reconfig the MTU size.

I changed gatt_cfg.max_mtu_size to 247 and call wiced_bt_gatt_configure_mtu(p_status->conn_id, 247) inside hci_control_le_connection_up() but it always return 0x80 (WICED_BT_GATT_NO_RESOURCES).

I really appreciate if any one could help me to config the MTU size correctly.

 
0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
10 questions asked 5 comments on KBA First comment on KBA

Hello @anhnhancao ,

Sorry I am late. Not sure if you already fixed this. Let me explain the usage 

- On your Peripheral , you can set the MTU size by modifying config file as you already know. For example, 

.gatt_cfg = /* GATT configuration */
{
.appearance = APPEARANCE_GENERIC_TAG, /**< GATT appearance (see gatt_appearance_e) */
.client_max_links = 2, /**< Client config: maximum number of servers that local client can connect to */
.server_max_links = 1, /**< Server config: maximum number of remote clients connections allowed by the local */
.max_attr_len = 244, 
.max_mtu_size = 247 
},

 

- By default a BLE connection will use MTU size of 23. If you have to use a higher value their either of the two devices should send MTU exchange request. Then the negotiated MTU value (smallest among both) will be used for further communication. 

- In your application if Central device is capable of sending a mtu exchange request, then that is good enough.  You need not have to call  wiced_bt_gatt_configure_mtu API again in Cypress Peripheral BT device. 

In the other case , if you want to initiate this from cypress BT side, then use the API wiced_bt_gatt_configure_mtu. Inorder to use this API , in config file you should have entered a non zero value for .client_max_links under .gatt_cfg 

Please try this method and let us know if you face any issues.

Regards,

Anjana

View solution in original post

0 Likes
3 Replies