We are trying to send the response of MTU_REQ using MTU_RES from peripheral to client. How to do that ?

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

cross mob
Anonymous
Not applicable

We are trying to send the response of MTU_REQ using MTU_RES from peripheral to client. How to do that ?

We are getting GATTS_REQ_TYPE_MTU event from GATT but how we have to send back the response MTU packet to client ?

0 Likes
1 Solution
Anonymous
Not applicable

As btta​ rightly said, the stack takes care of sending the MTU response when we receive the MTU request. The GATTS_REQ_TYPE_MTU event is just an iformative event and you need not call any API to send the MTU response.

By default, the MTU size defined in the wiced_bt_cfg_settings_t.gatt_cfg.max_mtu_size is used. If you wish to change the MTU size, then use this API: wiced_bt_gatt_configure_mtu().

In your case, the issue might be the attribute length. In your attribute_t table, check the length of your attribute. It might be set to 20. Increase this size to let the iOS app write more than 20 bytes at a time.

View solution in original post

7 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Actually this is being done by the ble stack. Can you provide more details?

0 Likes
Anonymous
Not applicable

Thanks for the update but if we want to send response for MTU_REQ packet how to do that?

Please find below the details

We are using ble_wifi_introducer code and written one sample ios app to write characteristics. Characteristics value can be more than 20 Bytes when we are writing it from ios app.

But we are not able to write characteristic value more than 20 bytes from ios app. Here ios app works as central and introducer code as perpheral.

After connection established between ble_wifi_introducer and ios app we are getting GATTS_REQ_TYPE_MTU event in ble_wifi_introducer and mtu size is coming 185.

But we are not able to send the MTU_RES packet to ios app (I was not able to find any suitable API or interface for this).

We need to send MTU_RES with mtu size more than 20 bytes otherwise ios is thinking our capability as 20 bytes and writing characteristic value more than 20 bytes is not successful from ios. 

But when we are doing notify from introducer code to ios app we can send 182 bytes because we received mtu size as 185 in MTU_REQ.

Please provide some interface to use MTU_RES.

0 Likes

I am not familiar with the BCMUSI22 platform. Could this be a wifi combo module? If yes, please re-post your query to our sister forum "Wiced Studio wifi/combo forum".

0 Likes
Anonymous
Not applicable

Thanks for the update but if we want to send response for MTU_REQ packet how to do that?

Please find below the details

We are using ble_wifi_introducer code and written one sample ios app to write characteristics. Characteristics value can be more than 20 Bytes when we are writing it from ios app.

But we are not able to write characteristic value more than 20 bytes from ios app. Here ios app works as central and introducer code as perpheral.

After connection established between ble_wifi_introducer and ios app we are getting GATTS_REQ_TYPE_MTU event in ble_wifi_introducer and mtu size is coming 185.

But we are not able to send the MTU_RES packet to ios app (I was not able to find any suitable API or interface for this).

We need to send MTU_RES with mtu size more than 20 bytes otherwise ios is thinking our capability as 20 bytes and writing characteristic value more than 20 bytes is not successful from ios.  

But when we are doing notify from introducer code to ios app we can send 182 bytes because we received mtu size as 185 in MTU_REQ.

Please provide some interface to use MTU_RES.

0 Likes
Anonymous
Not applicable

As btta​ rightly said, the stack takes care of sending the MTU response when we receive the MTU request. The GATTS_REQ_TYPE_MTU event is just an iformative event and you need not call any API to send the MTU response.

By default, the MTU size defined in the wiced_bt_cfg_settings_t.gatt_cfg.max_mtu_size is used. If you wish to change the MTU size, then use this API: wiced_bt_gatt_configure_mtu().

In your case, the issue might be the attribute length. In your attribute_t table, check the length of your attribute. It might be set to 20. Increase this size to let the iOS app write more than 20 bytes at a time.

Anonymous
Not applicable

Thanks for your pointer about attribute_t, now we are able to write 182 bytes from central to peripheral.

But we are trying to use wiced_bt_gatt_configure_mtu() to increase mtu size it is giving error 0x80 (resources not available).

I have changed wiced_bt_cfg_buf_pool_t but that does not help. Please let us know if you have any information.

0 Likes
Anonymous
Not applicable

In the wiced_bt_cfg_settings_t structure, increase the client_max_links to a value greater than 0. That should help.

0 Likes