@@ -182,7 +182,10 @@ static fhss_ws_neighbor_timing_info_t *ws_get_neighbor_info(const fhss_api_t *ap
182
182
static void ws_bootstrap_llc_hopping_update (struct protocol_interface_info_entry * cur , const fhss_ws_configuration_t * fhss_configuration )
183
183
{
184
184
memcpy (cur -> ws_info -> hopping_schdule .channel_mask , fhss_configuration -> channel_mask , sizeof (uint32_t ) * 8 );
185
- cur -> ws_info -> hopping_schdule .channel_function = fhss_configuration -> ws_uc_channel_function ;
185
+ cur -> ws_info -> hopping_schdule .uc_fixed_channel = fhss_configuration -> unicast_fixed_channel ;
186
+ cur -> ws_info -> hopping_schdule .bc_fixed_channel = fhss_configuration -> broadcast_fixed_channel ;
187
+ cur -> ws_info -> hopping_schdule .uc_channel_function = fhss_configuration -> ws_uc_channel_function ;
188
+ cur -> ws_info -> hopping_schdule .bc_channel_function = fhss_configuration -> ws_bc_channel_function ;
186
189
cur -> ws_info -> hopping_schdule .fhss_bc_dwell_interval = fhss_configuration -> fhss_bc_dwell_interval ;
187
190
cur -> ws_info -> hopping_schdule .fhss_broadcast_interval = fhss_configuration -> fhss_broadcast_interval ;
188
191
cur -> ws_info -> hopping_schdule .fhss_uc_dwell_interval = fhss_configuration -> fhss_uc_dwell_interval ;
@@ -205,7 +208,8 @@ static int8_t ws_fhss_initialize(protocol_interface_info_entry_t *cur)
205
208
}
206
209
207
210
fhss_configuration .fhss_uc_dwell_interval = cur -> ws_info -> fhss_uc_dwell_interval ;
208
- fhss_configuration .ws_uc_channel_function = cur -> ws_info -> fhss_channel_function ;
211
+ fhss_configuration .ws_uc_channel_function = cur -> ws_info -> fhss_uc_channel_function ;
212
+ fhss_configuration .ws_bc_channel_function = cur -> ws_info -> fhss_bc_channel_function ;
209
213
fhss_configuration .fhss_bc_dwell_interval = cur -> ws_info -> fhss_bc_dwell_interval ;
210
214
fhss_configuration .fhss_broadcast_interval = cur -> ws_info -> fhss_bc_interval ;
211
215
@@ -223,7 +227,8 @@ static int8_t ws_fhss_initialize(protocol_interface_info_entry_t *cur)
223
227
return 0 ;
224
228
}
225
229
memcpy (cur -> ws_info -> fhss_channel_mask , fhss_configuration -> channel_mask , sizeof (uint32_t ) * 8 );
226
- cur -> ws_info -> fhss_channel_function = fhss_configuration -> ws_uc_channel_function ;
230
+ cur -> ws_info -> fhss_uc_channel_function = fhss_configuration -> ws_uc_channel_function ;
231
+ cur -> ws_info -> fhss_bc_channel_function = fhss_configuration -> ws_bc_channel_function ;
227
232
cur -> ws_info -> fhss_bc_dwell_interval = fhss_configuration -> fhss_bc_dwell_interval ;
228
233
cur -> ws_info -> fhss_bc_interval = fhss_configuration -> fhss_broadcast_interval ;
229
234
cur -> ws_info -> fhss_uc_dwell_interval = fhss_configuration -> fhss_uc_dwell_interval ;
@@ -233,11 +238,12 @@ static int8_t ws_fhss_initialize(protocol_interface_info_entry_t *cur)
233
238
static int8_t ws_fhss_set_defaults (protocol_interface_info_entry_t * cur , fhss_ws_configuration_t * fhss_configuration )
234
239
{
235
240
fhss_configuration -> fhss_uc_dwell_interval = cur -> ws_info -> fhss_uc_dwell_interval ;
236
- fhss_configuration -> ws_uc_channel_function = cur -> ws_info -> fhss_channel_function ;
237
- // TODO: Just temporarily using hard coded broadcast channel function
238
- fhss_configuration -> ws_bc_channel_function = WS_DH1CF ;
241
+ fhss_configuration -> ws_uc_channel_function = cur -> ws_info -> fhss_uc_channel_function ;
242
+ fhss_configuration -> ws_bc_channel_function = cur -> ws_info -> fhss_bc_channel_function ;
239
243
fhss_configuration -> fhss_bc_dwell_interval = cur -> ws_info -> fhss_bc_dwell_interval ;
240
244
fhss_configuration -> fhss_broadcast_interval = cur -> ws_info -> fhss_bc_interval ;
245
+ fhss_configuration -> unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
246
+ fhss_configuration -> broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
241
247
ws_generate_channel_list (fhss_configuration -> channel_mask , cur -> ws_info -> hopping_schdule .number_of_channels , cur -> ws_info -> hopping_schdule .regulatory_domain );
242
248
243
249
// using bitwise AND operation for user set channel mask to remove channels not allowed in this device
@@ -270,12 +276,15 @@ static int8_t ws_fhss_discovery_configure(protocol_interface_info_entry_t *cur)
270
276
271
277
fhss_configuration .fhss_uc_dwell_interval = 0 ;
272
278
fhss_configuration .ws_uc_channel_function = WS_FIXED_CHANNEL ;
279
+ fhss_configuration .ws_bc_channel_function = WS_FIXED_CHANNEL ;
273
280
fhss_configuration .fhss_bc_dwell_interval = 0 ;
274
281
fhss_configuration .fhss_broadcast_interval = 0 ;
275
- cur -> ws_info -> hopping_schdule .fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
282
+ cur -> ws_info -> fhss_uc_fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
283
+ cur -> ws_info -> fhss_bc_fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
276
284
memset (fhss_configuration .channel_mask , 0 , sizeof (uint32_t ) * 8 );
277
- channel_list_set_channel (fhss_configuration .channel_mask , cur -> ws_info -> hopping_schdule .fixed_channel , true);
278
-
285
+ channel_list_set_channel (fhss_configuration .channel_mask , cur -> ws_info -> fhss_uc_fixed_channel , true);
286
+ fhss_configuration .unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
287
+ fhss_configuration .broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
279
288
ns_fhss_ws_configuration_set (cur -> ws_info -> fhss_api ,& fhss_configuration );
280
289
ws_bootstrap_llc_hopping_update (cur ,& fhss_configuration );
281
290
@@ -313,17 +322,16 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
313
322
314
323
ws_fhss_set_defaults (cur , & fhss_configuration );
315
324
316
- // Learning unicast network configuration
317
- fhss_configuration .ws_uc_channel_function = neighbor_info -> ws_neighbor -> fhss_data .uc_timing_info . unicast_channel_function ;
318
- if (fhss_configuration .ws_uc_channel_function == WS_FIXED_CHANNEL ) {
319
- cur -> ws_info -> hopping_schdule .fixed_channel = neighbor_info -> ws_neighbor -> fhss_data .uc_timing_info .fixed_channel ;
325
+ // Learning broadcast network configuration
326
+ fhss_configuration .ws_bc_channel_function = neighbor_info -> ws_neighbor -> fhss_data .bc_timing_info . broadcast_channel_function ;
327
+ if (fhss_configuration .ws_bc_channel_function == WS_FIXED_CHANNEL ) {
328
+ cur -> ws_info -> hopping_schdule .bc_fixed_channel = neighbor_info -> ws_neighbor -> fhss_data .bc_timing_info .fixed_channel ;
320
329
}
321
- /* Learning different unicast is not working currently at fhss network follows border router
322
- */
323
- // Learn broadcast information from selected parent
324
330
fhss_configuration .bsi = neighbor_info -> ws_neighbor -> fhss_data .bc_timing_info .broadcast_schedule_id ;
325
331
fhss_configuration .fhss_bc_dwell_interval = neighbor_info -> ws_neighbor -> fhss_data .bc_timing_info .broadcast_dwell_interval ;
326
332
fhss_configuration .fhss_broadcast_interval = neighbor_info -> ws_neighbor -> fhss_data .bc_timing_info .broadcast_interval ;
333
+ fhss_configuration .unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
334
+ fhss_configuration .broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
327
335
ns_fhss_ws_configuration_set (cur -> ws_info -> fhss_api , & fhss_configuration );
328
336
329
337
if (fhss_configuration .fhss_bc_dwell_interval && fhss_configuration .fhss_broadcast_interval ) {
@@ -1152,7 +1160,7 @@ static void ws_bootstrap_fhss_activate(protocol_interface_info_entry_t *cur)
1152
1160
tr_debug ("MAC init" );
1153
1161
mac_helper_pib_boolean_set (cur , macRxOnWhenIdle , true);
1154
1162
cur -> lowpan_info &= ~INTERFACE_NWK_CONF_MAC_RX_OFF_IDLE ;
1155
- ws_bootstrap_mac_activate (cur , cur -> ws_info -> hopping_schdule . fixed_channel , cur -> ws_info -> network_pan_id , true);
1163
+ ws_bootstrap_mac_activate (cur , cur -> ws_info -> fhss_uc_fixed_channel , cur -> ws_info -> network_pan_id , true);
1156
1164
return ;
1157
1165
}
1158
1166
@@ -1555,7 +1563,8 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
1555
1563
if (cur -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER ) {
1556
1564
tr_debug ("Border router start network" );
1557
1565
// Randomize fixed channel. Only used if channel plan is fixed
1558
- cur -> ws_info -> hopping_schdule .fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
1566
+ cur -> ws_info -> fhss_uc_fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
1567
+ cur -> ws_info -> fhss_bc_fixed_channel = randLIB_get_random_in_range (0 ,cur -> ws_info -> hopping_schdule .number_of_channels - 1 );
1559
1568
cur -> ws_info -> network_pan_id = randLIB_get_random_in_range (0 ,0xfffd );
1560
1569
cur -> ws_info -> pan_information .pan_size = 0 ;
1561
1570
cur -> ws_info -> pan_information .pan_version = randLIB_get_random_in_range (0 ,0xffff );
0 commit comments