Skip to content

Commit

Permalink
bugfix: Don't throw PumpCriticalError for MTU already updated, which …
Browse files Browse the repository at this point in the history
…can be caused by ourselves and not just tconnect
  • Loading branch information
jwoglom committed May 3, 2023
1 parent b1883b1 commit a7e9bc0
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,10 @@ public void onMtuChanged(@NotNull BluetoothPeripheral peripheral, int mtu, @NotN
Timber.i("new MTU set: %d (%s)", mtu, status);
} else if (status == GattStatus.INVALID_PDU) {
// INVALID_PDU means that the MTU was attempted to be set more than once.

// If we are connecting on top of the native t:connect app, which has already
// set its MTU, then we want to ignore this error.
Timber.i("MTU was already updated, likely by the t:connect app (is %d), ignoring error %s", mtu, status);
if (!PumpState.tconnectAppConnectionSharing) {
tandemPump.onPumpCriticalError(peripheral,
TandemError.SHARING_CONNECTION_WITH_TCONNECT_APP
.withCause(TandemError.SET_MTU_FAILED)
.withExtra("mtu: " + mtu + " status: " + status));
}
Timber.i("MTU was already updated, either by us or the t:connect app (is %d), ignoring error %s", mtu, status);
} else {
Timber.e("MTU could not be updated (is %d), received %s. Ignoring error.", mtu, status);

Expand Down

0 comments on commit a7e9bc0

Please sign in to comment.