26
26
#include "randLIB.h"
27
27
#include "common_functions.h"
28
28
#include "mac_common_defines.h"
29
+ #include "sw_mac.h"
29
30
#include "NWK_INTERFACE/Include/protocol.h"
30
31
#include "6LoWPAN/Bootstraps/protocol_6lowpan.h"
31
32
#include "6LoWPAN/Bootstraps/protocol_6lowpan_interface.h"
@@ -137,8 +138,23 @@ static int8_t ws_bootsrap_event_trig(ws_bootsrap_event_type_e event_type, int8_t
137
138
return eventOS_event_send (& event );
138
139
}
139
140
141
+ static int8_t ws_enable_fhss (protocol_interface_info_entry_t * cur )
142
+ {
143
+ fhss_ws_configuration_t fhss_configuration ;
144
+ fhss_configuration .bsi = cur -> ws_info -> hopping_schdule .fhss_bsi ;
145
+ memcpy (fhss_configuration .channel_mask , cur -> ws_info -> hopping_schdule .channel_mask , sizeof (uint32_t ) * 8 );
146
+ fhss_configuration .fhss_bc_dwell_interval = cur -> ws_info -> hopping_schdule .fhss_bc_dwell_interval ;
147
+ fhss_configuration .fhss_broadcast_interval = cur -> ws_info -> hopping_schdule .fhss_broadcast_interval ;
148
+ fhss_configuration .fhss_uc_dwell_interval = cur -> ws_info -> hopping_schdule .fhss_uc_dwell_interval ;
149
+ fhss_configuration .ws_channel_function = cur -> ws_info -> hopping_schdule .channel_function ;
150
+ fhss_api_t * fhss_api = ns_fhss_ws_create (& fhss_configuration , cur -> ws_info -> fhss_timer_ptr );
151
+ if (fhss_api ) {
152
+ ns_sw_mac_fhss_register (cur -> mac_api , fhss_api );
153
+ }
154
+ return 0 ;
155
+ }
140
156
141
- static int8_t ws_bootstrap_up (protocol_interface_info_entry_t * cur )
157
+ static int8_t ws_bootstrap_up (protocol_interface_info_entry_t * cur )
142
158
{
143
159
int8_t ret_val = -1 ;
144
160
@@ -150,7 +166,7 @@ static int8_t ws_bootsrap_event_trig(ws_bootsrap_event_type_e event_type, int8_t
150
166
tr_debug ("Interface not yet fully configured" );
151
167
return -5 ;
152
168
}
153
-
169
+ ws_enable_fhss ( cur );
154
170
155
171
addr_interface_set_ll64 (cur , NULL );
156
172
cur -> nwk_nd_re_scan_count = 0 ;
@@ -921,7 +937,7 @@ static void ws_bootstrap_pan_advert_solicit(protocol_interface_info_entry_t *cur
921
937
for (int i = 0 ; i < 8 ; i ++ ) {
922
938
async_req .channel_list .channel_mask [i ] = cur -> ws_info -> hopping_schdule .channel_mask [i ];
923
939
}
924
- async_req .channel_list .channel_page = CHANNEL_PAGE_0 ;
940
+ async_req .channel_list .channel_page = CHANNEL_PAGE_10 ;
925
941
async_req .security .SecurityLevel = 0 ;
926
942
927
943
ws_llc_asynch_request (cur , & async_req );
@@ -939,7 +955,7 @@ static void ws_bootstrap_pan_config_solicit(protocol_interface_info_entry_t *cur
939
955
for (int i = 0 ; i < 8 ; i ++ ) {
940
956
async_req .channel_list .channel_mask [i ] = cur -> ws_info -> hopping_schdule .channel_mask [i ];
941
957
}
942
- async_req .channel_list .channel_page = CHANNEL_PAGE_0 ;
958
+ async_req .channel_list .channel_page = CHANNEL_PAGE_10 ;
943
959
async_req .security .SecurityLevel = 0 ;
944
960
945
961
ws_llc_asynch_request (cur , & async_req );
@@ -958,7 +974,7 @@ static void ws_bootstrap_pan_advert(protocol_interface_info_entry_t *cur)
958
974
for (int i = 0 ; i < 8 ; i ++ ) {
959
975
async_req .channel_list .channel_mask [i ] = cur -> ws_info -> hopping_schdule .channel_mask [i ];
960
976
}
961
- async_req .channel_list .channel_page = CHANNEL_PAGE_0 ;
977
+ async_req .channel_list .channel_page = CHANNEL_PAGE_10 ;
962
978
async_req .security .SecurityLevel = 0 ;
963
979
964
980
ws_llc_asynch_request (cur , & async_req );
@@ -980,7 +996,7 @@ static void ws_bootstrap_pan_config(protocol_interface_info_entry_t *cur)
980
996
for (int i = 0 ; i < 8 ; i ++ ) {
981
997
async_req .channel_list .channel_mask [i ] = cur -> ws_info -> hopping_schdule .channel_mask [i ];
982
998
}
983
- async_req .channel_list .channel_page = CHANNEL_PAGE_0 ;
999
+ async_req .channel_list .channel_page = CHANNEL_PAGE_10 ;
984
1000
async_req .security .SecurityLevel = mac_helper_default_security_level_get (cur );
985
1001
async_req .security .KeyIdMode = mac_helper_default_security_key_id_mode_get (cur );
986
1002
async_req .security .KeyIndex = mac_helper_default_key_index_get (cur );
0 commit comments