1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc/tcp : Move GNRC_TCP_RTO_B_DIV to 'CONFIG_'

This commit is contained in:
Akshai M 2020-05-14 17:20:38 +05:30
parent f704a1e5c9
commit e42cc62edc
2 changed files with 4 additions and 6 deletions

View File

@ -142,8 +142,8 @@ extern "C" {
/**
* @brief Beta value for RTO calculation, default is 1/4
*/
#ifndef GNRC_TCP_RTO_B_DIV
#define GNRC_TCP_RTO_B_DIV (4U)
#ifndef CONFIG_GNRC_TCP_RTO_B_DIV
#define CONFIG_GNRC_TCP_RTO_B_DIV (4U)
#endif
/**

View File

@ -454,10 +454,8 @@ int _pkt_acknowledge(gnrc_tcp_tcb_t *tcb, const uint32_t ack)
}
/* If this is a subsequent sample */
else {
tcb->rtt_var = (tcb->rtt_var / GNRC_TCP_RTO_B_DIV) * \
(GNRC_TCP_RTO_B_DIV-1);
tcb->rtt_var += abs(tcb->srtt - rtt) / \
GNRC_TCP_RTO_B_DIV;
tcb->rtt_var = (tcb->rtt_var / CONFIG_GNRC_TCP_RTO_B_DIV) * (CONFIG_GNRC_TCP_RTO_B_DIV-1);
tcb->rtt_var += abs(tcb->srtt - rtt) / CONFIG_GNRC_TCP_RTO_B_DIV;
tcb->srtt = (tcb->srtt / CONFIG_GNRC_TCP_RTO_A_DIV) * (CONFIG_GNRC_TCP_RTO_A_DIV-1);
tcb->srtt += rtt / CONFIG_GNRC_TCP_RTO_A_DIV;
}