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

gnrc_sixlowpan: move garbage collect msg type to reassembly buffer

This commit is contained in:
Martine Lenders 2019-10-18 08:43:21 +02:00 committed by Martine S. Lenders
parent 750fd30bb4
commit 796d6a3167
5 changed files with 9 additions and 8 deletions

View File

@ -51,11 +51,6 @@ extern "C" {
* @brief Message type for passing one 6LoWPAN fragment down the network stack
*/
#define GNRC_SIXLOWPAN_MSG_FRAG_SND (0x0225)
/**
* @brief Message type for triggering garbage collection reassembly buffer
*/
#define GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF (0x0226)
/** @} */
/**

View File

@ -31,6 +31,10 @@
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Message type for triggering garbage collection reassembly buffer
*/
#define GNRC_SIXLOWPAN_FRAG_RB_GC_MSG (0x0226)
/**
* @brief Fragment intervals to identify limits of fragments and duplicates.

View File

@ -55,7 +55,7 @@ static gnrc_sixlowpan_frag_rb_t rbuf[GNRC_SIXLOWPAN_FRAG_RBUF_SIZE];
static char l2addr_str[3 * IEEE802154_LONG_ADDRESS_LEN];
static xtimer_t _gc_timer;
static msg_t _gc_timer_msg = { .type = GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF };
static msg_t _gc_timer_msg = { .type = GNRC_SIXLOWPAN_FRAG_RB_GC_MSG };
/* ------------------------------------
* internal function definitions

View File

@ -348,7 +348,9 @@ static void *_event_loop(void *args)
DEBUG("6lo: send fragmented event received\n");
gnrc_sixlowpan_frag_send(NULL, msg.content.ptr, 0);
break;
case GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF:
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_RB
case GNRC_SIXLOWPAN_FRAG_RB_GC_MSG:
DEBUG("6lo: garbage collect reassembly buffer event received\n");
gnrc_sixlowpan_frag_rb_gc();
break;

View File

@ -594,7 +594,7 @@ static void test_rbuf_gc__timed(void)
xtimer_msg_receive_timeout(&msg, TEST_GC_TIMEOUT) >= 0,
"Waiting for GC timer timed out"
);
TEST_ASSERT_EQUAL_INT(GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF, msg.type);
TEST_ASSERT_EQUAL_INT(GNRC_SIXLOWPAN_FRAG_RB_GC_MSG, msg.type);
gnrc_sixlowpan_frag_rb_gc();
/* reassembly buffer is now empty */
TEST_ASSERT_NULL(_first_non_empty_rbuf());