MTU exchange procedure question

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

cross mob
user_1669321
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,

Me and a coworker were working on the MTU exchange procedure using a CYBLE-222014-01 and CySmart on Windows.

In the stack event handler, at the event CYBLE_EVT_GATTS_XCNHG_MTU_REQ, we proceed as follows:

switch (event) {

/* ... */

    case CYBLE_EVT_GATTS_XCNHG_MTU_REQ:

        connHandle = ((CYBLE_GATT_XCHG_MTU_PARAM_T*)eventParam)->connHandle;

        CyBle_GattGetMtuSize(&mtu);

        CyBle_GattsExchangeMtuRsp(connHandle, mtu);

        break;

/* ... */

}

But we found that we don't necessarily need to use CyBle_GattsExchangeMtuRsp in the MTU exchange process.

In CySmart, we set the MTU to 512, and in the PRoC's BLE component, we set the MTU to 124. We commented the CyBle_GattsExchangeMtuRsp function, and found in CySmart that the negociated MTU after a connection was of 124­.

So even though we didn't send back our MTU, the BLE connection resulted in a negociated MTU size of 124. My question is: is the MTU exchange process done in background with the Cypress BLE stack? Do we need the case CYBLE_EVT_GATTS_XCNHG_MTU_REQ at all?

Thanks,

Frederic

0 Likes
1 Solution
Anonymous
Not applicable

The BLE component has functions that run on events from the BLE stack internal to the component; Probably, it is running the MTU response automatically based on your PRoC BLE component setting, thus negating the need for you to explicitly call the value. It would be more useful to use this case/event if you want multiple MTU values in the same application imo.

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

The BLE component has functions that run on events from the BLE stack internal to the component; Probably, it is running the MTU response automatically based on your PRoC BLE component setting, thus negating the need for you to explicitly call the value. It would be more useful to use this case/event if you want multiple MTU values in the same application imo.

0 Likes

Thank you!

0 Likes