Skip to content

Commit 7729e20

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Mac neighbor table integrate to interface structure
Added new mac neighbor table to part of mac parameters Added timeout update calls. Added neighbor table list clean to nwk_6lowpan_down()
1 parent 2c6f30a commit 7729e20

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "6LoWPAN/Bootstraps/protocol_6lowpan_bootstrap.h"
3838
#include "Service_Libs/blacklist/blacklist.h"
3939
#include "6LoWPAN/MAC/mac_helper.h"
40+
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"
4041
#include "mac_api.h"
4142

4243
#ifdef HAVE_RPL
@@ -169,6 +170,9 @@ int8_t nwk_6lowpan_up(protocol_interface_info_entry_t *cur)
169170
int8_t nwk_6lowpan_down(protocol_interface_info_entry_t *cur)
170171
{
171172
int8_t ret_val;
173+
if (cur->mac_parameters) {
174+
mac_neighbor_table_neighbor_list_clean(cur->mac_parameters->mac_neighbor_table);
175+
}
172176
neighbor_cache_flush(&cur->neigh_cache);
173177
ret_val = set_6lowpan_nwk_down(cur);
174178
protocol_core_interface_info_reset(cur);

source/NWK_INTERFACE/Include/protocol.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "Service_Libs/Neighbor_cache/neighbor_table_definition.h"
4646
#include "Service_Libs/Trickle/trickle.h"
4747
#include "Service_Libs/pan_blacklist/pan_blacklist_api.h"
48+
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"
4849
#include "net_polling_api.h"
4950
#include "ipv6_stack/ipv6_routing_table.h"
5051

@@ -246,6 +247,7 @@ typedef struct arm_15_4_mac_parameters_t {
246247
beacon_compare_rx_cb *beacon_compare_rx_cb_ptr;
247248
beacon_join_priority_tx_cb *beacon_join_priority_tx_cb_ptr;
248249
uint8_t (*beacon_ind)(uint8_t *ptr, uint8_t len, protocol_interface_info_entry_t *cur);
250+
mac_neighbor_table_t *mac_neighbor_table;
249251
}arm_15_4_mac_parameters_t;
250252

251253
typedef void mac_poll_fail_cb(int8_t nwk_interface_id);

source/NWK_INTERFACE/protocol_core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ void core_timer_event_handle(uint16_t ticksUpdate)
250250
beacon_join_priority_update(cur->id);
251251
}
252252

253+
if (cur->mac_parameters) {
254+
mac_neighbor_table_neighbor_timeout_update(cur->mac_parameters->mac_neighbor_table, seconds);
255+
}
256+
253257
if (cur->nwk_wpan_nvm_api) {
254258
cur->nwk_wpan_nvm_api->nvm_params_update_cb(cur->nwk_wpan_nvm_api, false);
255259
}

0 commit comments

Comments
 (0)