Skip to content

Commit 38978f3

Browse files
author
Juha Heiskanen
committed
wi-sun ETX update:
Fixed missing ETX LQI / DBM init etx calculation. ETX cached enabled feature calc also first real one now. Change-Id: I6aa38c8004b990cde6a72ea2ffb9dc06e320c91f
1 parent 4a71b04 commit 38978f3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

source/6LoWPAN/ws/ws_llc_data_service.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,14 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
569569
}
570570
}
571571

572-
//Refresh Neighbor ETX if unicast
573-
if (ws_utt.message_type == WS_FT_DATA && data->DstAddrMode == ADDR_802_15_4_LONG) {
574-
neighbor_info.ws_neighbor->unicast_data_rx = true;
575-
etx_lqi_dbm_update(interface->id, data->mpduLinkQuality, data->signal_dbm, neighbor_info.neighbor->index);
576-
}
577572
if (ws_utt.message_type == WS_FT_DATA) {
573+
574+
if (data->DstAddrMode == ADDR_802_15_4_LONG) {
575+
neighbor_info.ws_neighbor->unicast_data_rx = true;
576+
}
577+
578+
//Refresh ETX dbm
579+
etx_lqi_dbm_update(interface->id, data->mpduLinkQuality, data->signal_dbm, neighbor_info.neighbor->index);
578580
// Calculate RSL for all UDATA packages heard
579581
ws_neighbor_class_rsl_in_calculate(neighbor_info.ws_neighbor, data->signal_dbm);
580582

source/Service_Libs/etx/etx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ void etx_transm_attempts_update(int8_t interface_id, uint8_t attempts, bool succ
201201
entry->etx_samples++;
202202
}
203203

204-
if (etx_info.cache_sample_requested && !entry->tmp_etx) {
204+
if (etx_info.cache_sample_requested) {
205205

206206
etx_sample_storage_t *storage = etx_cache_sample_update(attribute_index, attempts, success);
207207
entry->accumulated_failures = 0;
208-
if (!etx_update_possible(storage, entry, 0)) {
208+
209+
if (!entry->etx || (entry->etx_samples > 1 && !etx_update_possible(storage, entry, 0))) {
209210
return;
210211
}
211212

0 commit comments

Comments
 (0)