From 0d8157874b5427d33ec99b0ec332f2c6d34e8c00 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 23 Aug 2020 15:49:22 -0700 Subject: [PATCH] Group similar values L2CA_SetFlushTimeout Towards proper interfaces Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I658fb9b6270783615dfd1fea264f9aeb4bd96485 --- stack/l2cap/l2c_api.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/stack/l2cap/l2c_api.cc b/stack/l2cap/l2c_api.cc index c697d041b..e33a20557 100644 --- a/stack/l2cap/l2c_api.cc +++ b/stack/l2cap/l2c_api.cc @@ -1226,17 +1226,14 @@ bool L2CA_SetFlushTimeout(const RawAddress& bd_addr, if (flush_timeout_in_ms == 0x0000) { flush_timeout_in_slots = flush_timeout_in_ms; flush_timeout_in_ms = L2CAP_NO_AUTOMATIC_FLUSH; - } - /* no retransmission */ - else if (flush_timeout_in_ms == L2CAP_NO_RETRANSMISSION) { + } else if (flush_timeout_in_ms == L2CAP_NO_AUTOMATIC_FLUSH) { + flush_timeout_in_slots = 0x0000; + } else if (flush_timeout_in_ms == L2CAP_NO_RETRANSMISSION) { + /* no retransmission */ /* not mandatory range for controller */ /* Packet is flushed before getting any ACK/NACK */ /* To do this, flush timeout should be 1 baseband slot */ flush_timeout_in_slots = flush_timeout_in_ms; - } - /* no automatic flush (infinite timeout) */ - else if (flush_timeout_in_ms == L2CAP_NO_AUTOMATIC_FLUSH) { - flush_timeout_in_slots = 0x0000; } else { flush_timeout_in_slots = ConvertMillisecondsToBasebandSlots(flush_timeout_in_ms); -- 2.11.0