File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_SOFTDEVICE/TARGET_NRF52/source/btle Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -400,10 +400,12 @@ void btle_handler(const ble_evt_t *p_ble_evt)
400
400
p_ble_evt->evt .gatts_evt .params .exchange_mtu_request ;
401
401
402
402
nRF5xGattServer &gatt_server = (nRF5xGattServer&) ble.getGattServer ();
403
- gatt_server.getEventHandler ()->onAttMtuChange (
404
- connection,
405
- std::min (NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int )(update.client_rx_mtu ))
406
- );
403
+ if (gatt_server.getEventHandler ()) {
404
+ gatt_server.getEventHandler ()->onAttMtuChange (
405
+ connection,
406
+ std::min (NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int )(update.client_rx_mtu ))
407
+ );
408
+ }
407
409
}
408
410
break ;
409
411
}
@@ -415,11 +417,13 @@ void btle_handler(const ble_evt_t *p_ble_evt)
415
417
const ble_gattc_evt_exchange_mtu_rsp_t &update =
416
418
p_ble_evt->evt .gattc_evt .params .exchange_mtu_rsp ;
417
419
418
- nRF5xGattServer &gatt_client = (nRF5xGattClient&) ble.getGattClient ();
419
- gatt_client.getEventHandler ()->onAttMtuChange (
420
- connection,
421
- std::min (NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int )(update.server_rx_mtu ))
422
- );
420
+ nRF5xGattClient &gatt_client = (nRF5xGattClient&) ble.getGattClient ();
421
+ if (gatt_client.get_event_handler ()) {
422
+ gatt_client.get_event_handler ()->on_att_mtu_change (
423
+ connection,
424
+ std::min (NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int )(update.server_rx_mtu ))
425
+ );
426
+ }
423
427
}
424
428
break ;
425
429
}
You can’t perform that action at this time.
0 commit comments