mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			fix nrf52 mtu
							parent
							
								
									193092f6d9
								
							
						
					
					
						commit
						cdd5c9f3b0
					
				| 
						 | 
				
			
			@ -400,10 +400,12 @@ void btle_handler(const ble_evt_t *p_ble_evt)
 | 
			
		|||
                    p_ble_evt->evt.gatts_evt.params.exchange_mtu_request;
 | 
			
		||||
 | 
			
		||||
                nRF5xGattServer &gatt_server = (nRF5xGattServer&) ble.getGattServer();
 | 
			
		||||
                gatt_server.getEventHandler()->onAttMtuChange(
 | 
			
		||||
                    connection,
 | 
			
		||||
                    std::min(NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int)(update.client_rx_mtu))
 | 
			
		||||
                );
 | 
			
		||||
                if (gatt_server.getEventHandler()) {
 | 
			
		||||
                    gatt_server.getEventHandler()->onAttMtuChange(
 | 
			
		||||
                        connection,
 | 
			
		||||
                        std::min(NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int)(update.client_rx_mtu))
 | 
			
		||||
                    );
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -415,11 +417,13 @@ void btle_handler(const ble_evt_t *p_ble_evt)
 | 
			
		|||
                const ble_gattc_evt_exchange_mtu_rsp_t &update =
 | 
			
		||||
                    p_ble_evt->evt.gattc_evt.params.exchange_mtu_rsp;
 | 
			
		||||
 | 
			
		||||
                nRF5xGattServer &gatt_client = (nRF5xGattClient&) ble.getGattClient();
 | 
			
		||||
                gatt_client.getEventHandler()->onAttMtuChange(
 | 
			
		||||
                    connection,
 | 
			
		||||
                    std::min(NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int)(update.server_rx_mtu))
 | 
			
		||||
                );
 | 
			
		||||
                nRF5xGattClient &gatt_client = (nRF5xGattClient&) ble.getGattClient();
 | 
			
		||||
                if (gatt_client.get_event_handler()) {
 | 
			
		||||
                    gatt_client.get_event_handler()->on_att_mtu_change(
 | 
			
		||||
                        connection,
 | 
			
		||||
                        std::min(NRF_SDH_BLE_GATT_MAX_MTU_SIZE, (int)(update.server_rx_mtu))
 | 
			
		||||
                    );
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue