This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST

I am migrating a project from SDK 12 and SoftDevice S132 V3.0.0 to SDK 14 and SoftDevice S132 V5.0.0. Is the follow case still required in the ble_evt_handler?

#if (NRF_SD_BLE_API_VERSION >= 3)
        case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
        {
            errCode = sd_ble_gatts_exchange_mtu_reply(pBleEvt->evt.gatts_evt.conn_handle, BLE_GATT_ATT_MTU_DEFAULT);
            APP_ERROR_CHECK(errCode);
        } break; // BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST
#endif  //(NRF_SD_BLE_API_VERSION >= 3)

Or does this case now handle this?

#if defined(S132)
        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG("PHY update request.");
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            errCode = sd_ble_gap_phy_update(pBleEvt->evt.gap_evt.conn_handle, &phys);
            APP_ERROR_CHECK(errCode);
        } break;
#endif

Thanks, Darren

Parents
  • I'm not sure if your question is regarding the #if guards or the function calls inside them.

    Anyway, regarding the functions; the phy update and mtu exchange are still two different BLE procedures and the two functions are not related or covering for each other.

    Regarding the guards; SDK 12 is compatible with both nRF51's S130 v2 and nRF52's S132 v3. However, S130 does not support MTU exchange requests, so #if (NRF_SD_BLE_API_VERSION >= 3) acts as a guard against nRF51 incompatibilities.

    SDK 14 doesn't support nRF51, but the nRF52840's S140 does not support the BLE_GAP_EVT_PHY_UPDATE_REQUEST event either (yet). Hence, in this case the #if acts as a guard against S140 incompatibilities.

Reply
  • I'm not sure if your question is regarding the #if guards or the function calls inside them.

    Anyway, regarding the functions; the phy update and mtu exchange are still two different BLE procedures and the two functions are not related or covering for each other.

    Regarding the guards; SDK 12 is compatible with both nRF51's S130 v2 and nRF52's S132 v3. However, S130 does not support MTU exchange requests, so #if (NRF_SD_BLE_API_VERSION >= 3) acts as a guard against nRF51 incompatibilities.

    SDK 14 doesn't support nRF51, but the nRF52840's S140 does not support the BLE_GAP_EVT_PHY_UPDATE_REQUEST event either (yet). Hence, in this case the #if acts as a guard against S140 incompatibilities.

Children
No Data
Related