From aa5ffee872276eabb418c0cce9ea514e7ae3bd99 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Tue, 3 Dec 2024 21:37:29 +0100 Subject: [PATCH] digipeater: remove empty packet from current connection after burst --- impl/src/layer2/digipeater.c | 4 ++++ impl/test/layer2_over_udp/l2udptest_digipeater.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/impl/src/layer2/digipeater.c b/impl/src/layer2/digipeater.c index a5fca97..1635dd2 100644 --- a/impl/src/layer2/digipeater.c +++ b/impl/src/layer2/digipeater.c @@ -289,6 +289,10 @@ size_t digipeater_encode_next_packet(digipeater_ctx_t *ctx, uint8_t *buf, size_t if(connection_can_transmit(conn)) { packet_size = connection_encode_next_packet(conn, buf, buf_len, end_burst); + if(*end_burst) { + connection_tx_clean_empty_packet(conn); + } + ctx->state = DIGIPEATER_STATE_CONN; } } diff --git a/impl/test/layer2_over_udp/l2udptest_digipeater.c b/impl/test/layer2_over_udp/l2udptest_digipeater.c index 9ba8d02..9928c85 100644 --- a/impl/test/layer2_over_udp/l2udptest_digipeater.c +++ b/impl/test/layer2_over_udp/l2udptest_digipeater.c @@ -248,9 +248,6 @@ int main(int argc, char **argv) } } - // FIXME: where to put this in the digipeater? - //connection_tx_clean_empty_packet(&l2conn); - LOG(LVL_DEBUG, "Burst finished: %zd packets sent.", burst_len); }