Skip to content

Commit 0a36af3

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
WS IE library update and LLC data confirmation update
Added support to read RSL and enabled that to LLC layer LLC Data confirmation ack payload check enabled. UTT and RSL are now parsed from ACK payload. Change-Id: Id94972950a3914cc494b8dc3cdc2e72e69f3d49a
1 parent 4352709 commit 0a36af3

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

source/6LoWPAN/ws/ws_ie_lib.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,18 @@ bool ws_wh_bt_read(uint8_t *data, uint16_t length, struct ws_bt_ie * bt_ie)
273273
return true;
274274
}
275275

276+
bool ws_wh_rsl_read(uint8_t *data, uint16_t length, int8_t *rsl)
277+
{
278+
mac_header_IE_t rsl_ie_data;
279+
rsl_ie_data.id = MAC_HEADER_ASSIGNED_EXTERNAL_ORG_IE_ID;
280+
if (1 != mac_ie_header_sub_id_discover(data, length, &rsl_ie_data, WH_IE_RSL_TYPE)) {
281+
return false;
282+
}
283+
*rsl = *rsl_ie_data.content_ptr;
284+
285+
return true;
286+
}
287+
276288
static uint8_t *ws_channel_plan_zero_read(uint8_t *ptr, ws_channel_plan_zero_t *plan)
277289
{
278290
plan->regulator_domain = *ptr++;

source/6LoWPAN/ws/ws_ie_lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ uint8_t *ws_wh_vh_write(uint8_t *ptr, uint8_t *vendor_header, uint8_t vendor_hea
4141

4242
bool ws_wh_utt_read(uint8_t *data, uint16_t length, struct ws_utt_ie *utt_ie);
4343
bool ws_wh_bt_read(uint8_t *data, uint16_t length, struct ws_bt_ie * bt_ie);
44+
bool ws_wh_rsl_read(uint8_t *data, uint16_t length, int8_t *rsl);
4445

4546
/* WS_WP_NESTED PAYLOD IE */
4647
uint8_t *ws_wp_base_write(uint8_t *ptr, uint16_t length);

source/6LoWPAN/ws/ws_llc_data_service.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,17 @@ static void ws_llc_mac_confirm_cb(const mac_api_t* api, const mcps_data_conf_t *
390390
if (message->dst_address_type == MAC_ADDR_MODE_64_BIT && base->ws_neighbor_info_request_cb(interface, message->dst_address, &neighbor_info, false) ) {
391391
etx_transm_attempts_update(interface->id, 1 + data->tx_retries , success, neighbor_info.neighbor->index);
392392
//TODO discover RSL from Enchanced ACK Header IE elements
393+
ws_utt_ie_t ws_utt;
394+
if (ws_wh_utt_read(conf_data->headerIeList, conf_data->headerIeListLength, &ws_utt)) {
395+
//UTT header
396+
mac_neighbor_table_neighbor_refresh(interface->mac_parameters->mac_neighbor_table, neighbor_info.neighbor, neighbor_info.neighbor->link_lifetime);
397+
ws_neighbor_class_neighbor_unicast_time_info_update(neighbor_info.ws_neighbor, &ws_utt, data->timestamp);
398+
}
399+
400+
int8_t rsl;
401+
if (ws_wh_rsl_read(conf_data->headerIeList, conf_data->headerIeListLength, &rsl)) {
402+
ws_neighbor_class_rsl_out_calculate(neighbor_info.ws_neighbor, rsl);
403+
}
393404
}
394405

395406
break;

test/nanostack/unittest/stub/ws_ie_lib_stub.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ uint8_t *ws_wh_bt_write(uint8_t *ptr)
5757
return ptr;
5858
}
5959

60+
bool ws_wh_rsl_read(uint8_t *data, uint16_t length, int8_t *rsl)
61+
{
62+
return false;
63+
}
64+
6065

6166
uint8_t *ws_wh_fc_write(uint8_t *ptr, uint8_t flow_ctrl)
6267
{

0 commit comments

Comments
 (0)