nimble/ll: Fix data fragmentation with maxTxTime<maxTxOctets

We did not properly adjust payload length for 2nd and subsequent packet
fragments so in case effectiveMaxTxTime is less than time required to
send payload of effectiveMaxTxOctets, we send too many data in all
packets except 1st one.

X-Original-Commit: 28a6757071fef72b2b6171fdf2c2fede48d524df
This commit is contained in:
Andrzej Kaczmarek
2018-02-05 15:30:14 +01:00
parent 869b5a89c3
commit 99e04f775a
+3 -5
View File
@@ -3788,11 +3788,9 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
/* XXX: TODO need to check with phy update procedure.
* There are limitations if we have started update */
rem_bytes = OS_MBUF_PKTLEN(txpdu) - txhdr->txinfo.offset;
if (rem_bytes > connsm->eff_max_tx_octets) {
txhdr->txinfo.pyld_len = connsm->eff_max_tx_octets;
} else {
txhdr->txinfo.pyld_len = rem_bytes;
}
/* Adjust payload for max TX time and octets */
rem_bytes = ble_ll_conn_adjust_pyld_len(connsm, rem_bytes);
txhdr->txinfo.pyld_len = rem_bytes;
}
}
}