diff --git a/source/6LoWPAN/ws/ws_bootstrap.c b/source/6LoWPAN/ws/ws_bootstrap.c index ce34a0dddf3..93c1e21ff49 100644 --- a/source/6LoWPAN/ws/ws_bootstrap.c +++ b/source/6LoWPAN/ws/ws_bootstrap.c @@ -42,6 +42,7 @@ #include "6LoWPAN/ws/ws_common_defines.h" #include "6LoWPAN/ws/ws_llc.h" #include "6LoWPAN/lowpan_adaptation_interface.h" +#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h" #include "net_rpl.h" #include "mac_api.h" @@ -443,6 +444,23 @@ static void ws_bootstrap_asynch_confirm(struct protocol_interface_info_entry *in (void)asynch_message; } + +static void ws_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data) +{ + //TODO Remove from MAC helper remove, ETX, WS Table entry + (void) entry_ptr; + (void) user_data; +} + + +static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data) +{ + //TODO generate NS NUD + (void) entry_ptr; + (void) user_data; + return true; +} + int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode) { (void) bootstrap_mode; @@ -481,6 +499,13 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode) //Disable allways by default lowpan_adaptation_interface_mpx_register(interface_id, NULL, 0); + mac_neighbor_table_delete(cur->mac_parameters->mac_neighbor_table); + cur->mac_parameters->mac_neighbor_table = mac_neighbor_table_create(buffer.device_decription_table_size, ws_neighbor_entry_remove_notify + , ws_neighbor_entry_nud_notify, cur, WS_NEIGHBOR_NUD_TIMEOUT); + if (!cur->mac_parameters->mac_neighbor_table) { + return -4; + } + ws_llc_create(cur, &ws_bootstrap_asynch_ind, &ws_bootstrap_asynch_confirm); mpx_api_t *mpx_api = ws_llc_mpx_api_get(cur); diff --git a/source/6LoWPAN/ws/ws_common_defines.h b/source/6LoWPAN/ws/ws_common_defines.h index 40d65809205..ba0c6846bb6 100644 --- a/source/6LoWPAN/ws/ws_common_defines.h +++ b/source/6LoWPAN/ws/ws_common_defines.h @@ -91,5 +91,8 @@ typedef struct ws_hoopping_schedule_s { #define WS_FAN_VERSION_1_0 1 +#define WS_NEIGHBOR_LINK_TIMEOUT 240 +#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2 + #endif /* WS_COMMON_DEFINES_H_ */