Conflicting answers for maximum and minimum MTU sizes?

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

cross mob
Anonymous
Not applicable

I have read in many places that 23 is the minimum MTU size for BLE, and that devices may negotiate up to 512 depending on the MTU size of the central and peripheral. However in working with the PRoC CYBLE 02201 it seems that 23 is the maximum and that any number less than that is supported. This is demonstrated by this code:

   

case CYBLE_EVT_GATTS_XCNHG_MTU_REQ:
            {
                uint16 cyBle_mtuSize;
                if(CYBLE_GATT_MTU > ((CYBLE_GATT_XCHG_MTU_PARAM_T *)eventParam)->mtu)
                {
                    cyBle_mtuSize = ((CYBLE_GATT_XCHG_MTU_PARAM_T *)eventParam)->mtu;
                }
                else
                {
                    cyBle_mtuSize = CYBLE_GATT_MTU;
                }
                (void)CyBle_GattsExchangeMtuRsp(((CYBLE_GATT_XCHG_MTU_PARAM_T *)eventParam)->connHandle, cyBle_mtuSize);
            }
            break;

   

Then when observing the declaration of CyBle_GattsExchangeMtuRsp it says explicitly that the maximum is 23. So for this module my MTU can only ever be 23 to fall within spec? 

   

 

   

I have a few other questions about the implications of this. 

   

First, can this be increased by adjusting the L2CAP Settings when configuring BLE? It has an option for MTU size which is currently set to 23.

   

 

   

Second, if 23 is the maximum does that mean I am hard limited to 23 bytes of data per connection interval?

   

 

   

Third, if I am limited to 23 bytes of data per connection interval would that preclude using any characteristics with a data size of more than 23? For example if my characteristic were of size 25 would the L2CAP layer still be able to split that into two transmissions or would data be lost?

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

Hello Nate Roth,

   

The maximum MTU size can go upto 512 for any CyBLE device. In the BLE component setting you can set it as per your requirement.

   

However , the MTU taken for the BLE communication will be effectively = Minimum (MTU size of Central, MTU size of peripheral). By default it will be 23. If you want to use more than 23 means, client should send an MTU exchange request to the server.

   

For some Clients like mobile phone MTU size may limited to some particular value. However if your client and server is CyBLE device, then it can use upto 512 bytes.

   

If your MTU size is 23 , and you want to send data >23, you can do it by Writelong /read long properties. Your data will  not be lost.

   

Thanks,
Anjana

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Characteristics of size larger than the MTU size will automatically be split into multiple packets.

   

No idea what the answer for your first two questions are however 😕

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

Hello Nate Roth,

   

The maximum MTU size can go upto 512 for any CyBLE device. In the BLE component setting you can set it as per your requirement.

   

However , the MTU taken for the BLE communication will be effectively = Minimum (MTU size of Central, MTU size of peripheral). By default it will be 23. If you want to use more than 23 means, client should send an MTU exchange request to the server.

   

For some Clients like mobile phone MTU size may limited to some particular value. However if your client and server is CyBLE device, then it can use upto 512 bytes.

   

If your MTU size is 23 , and you want to send data >23, you can do it by Writelong /read long properties. Your data will  not be lost.

   

Thanks,
Anjana

0 Likes