Skip to content

Commit 76089cb

Browse files
author
Juha Heiskanen
committed
Fixed ASYNCH message send for fixed channel setup.
Change-Id: Ib175898ce2fb9f31a5c9bd3f94249cdb5791012a
1 parent 0c94982 commit 76089cb

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,6 +2393,19 @@ void ws_bootstrap_configuration_trickle_reset(protocol_interface_info_entry_t *c
23932393
trickle_inconsistent_heard(&cur->ws_info->trickle_pan_config, &cur->ws_info->trickle_params_pan_discovery);
23942394
}
23952395

2396+
static void ws_set_asynch_channel_list(protocol_interface_info_entry_t *cur, asynch_request_t *async_req)
2397+
{
2398+
memset(&async_req->channel_list, 0, sizeof(channel_list_s));
2399+
if (cur->ws_info->fhss_uc_channel_function == WS_FIXED_CHANNEL) {
2400+
//SET 1 Channel only
2401+
uint16_t channel_number = cur->ws_info->fhss_uc_fixed_channel;
2402+
async_req->channel_list.channel_mask[0 + (channel_number / 32)] = (1 << (channel_number % 32));
2403+
} else {
2404+
ws_generate_channel_list(async_req->channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
2405+
}
2406+
2407+
async_req->channel_list.channel_page = CHANNEL_PAGE_10;
2408+
}
23962409

23972410
static void ws_bootstrap_pan_advert_solicit(protocol_interface_info_entry_t *cur)
23982411
{
@@ -2404,9 +2417,9 @@ static void ws_bootstrap_pan_advert_solicit(protocol_interface_info_entry_t *cur
24042417
async_req.wp_requested_nested_ie_list.us_ie = true;
24052418
async_req.wp_requested_nested_ie_list.net_name_ie = true;
24062419

2407-
ws_generate_channel_list(async_req.channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
2420+
ws_set_asynch_channel_list(cur, &async_req);
2421+
24082422

2409-
async_req.channel_list.channel_page = CHANNEL_PAGE_10;
24102423
async_req.security.SecurityLevel = 0;
24112424

24122425
ws_llc_asynch_request(cur, &async_req);
@@ -2422,9 +2435,7 @@ static void ws_bootstrap_pan_config_solicit(protocol_interface_info_entry_t *cur
24222435
async_req.wp_requested_nested_ie_list.us_ie = true;
24232436
async_req.wp_requested_nested_ie_list.net_name_ie = true;
24242437

2425-
ws_generate_channel_list(async_req.channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
2426-
2427-
async_req.channel_list.channel_page = CHANNEL_PAGE_10;
2438+
ws_set_asynch_channel_list(cur, &async_req);
24282439
async_req.security.SecurityLevel = 0;
24292440

24302441
ws_llc_asynch_request(cur, &async_req);
@@ -2501,9 +2512,7 @@ static void ws_bootstrap_pan_advert(protocol_interface_info_entry_t *cur)
25012512
async_req.wp_requested_nested_ie_list.pan_ie = true;
25022513
async_req.wp_requested_nested_ie_list.net_name_ie = true;
25032514

2504-
ws_generate_channel_list(async_req.channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
2505-
2506-
async_req.channel_list.channel_page = CHANNEL_PAGE_10;
2515+
ws_set_asynch_channel_list(cur, &async_req);
25072516
async_req.security.SecurityLevel = 0;
25082517

25092518
if (cur->bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
@@ -2534,9 +2543,8 @@ static void ws_bootstrap_pan_config(protocol_interface_info_entry_t *cur)
25342543
async_req.wp_requested_nested_ie_list.gtkhash_ie = true;
25352544
async_req.wp_requested_nested_ie_list.vp_ie = true;
25362545

2537-
ws_generate_channel_list(async_req.channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
2546+
ws_set_asynch_channel_list(cur, &async_req);
25382547

2539-
async_req.channel_list.channel_page = CHANNEL_PAGE_10;
25402548
async_req.security.SecurityLevel = mac_helper_default_security_level_get(cur);
25412549
async_req.security.KeyIdMode = mac_helper_default_security_key_id_mode_get(cur);
25422550
async_req.security.KeyIndex = mac_helper_default_key_index_get(cur);

0 commit comments

Comments
 (0)