Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87d21632 authored by Brian Delwiche's avatar Brian Delwiche
Browse files

Add handling for first-time mtu exchange value

Partner reports too-small DLE lengths on first connection.  Analysis
suggests that this is due to a recent refactor falling back to the
(small) default MTU on a first connection rather than using the payload
size, which was the previous behavior -- on subsequent connections the
minimum of payload size or stored value will be used.

Cover this case.

Bug: 287911569
Test: atest bluetooth_test_gd_unit, net_test_stack_gatt, manual
Change-Id: Icaad8cfbab64b87f818f7bd7d999b5fc5d7a15b7
parent e3481fe8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1127,6 +1127,8 @@ void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len,
    if (tcb.pending_user_mtu_exchange_value > tcb.max_user_mtu) {
      tcb.max_user_mtu =
          std::min(tcb.pending_user_mtu_exchange_value, tcb.payload_size);
    } else if (tcb.pending_user_mtu_exchange_value == 0) {
      tcb.max_user_mtu = tcb.payload_size;
    }
    tcb.pending_user_mtu_exchange_value = 0;