Skip to content

Commit 71c8bde

Browse files
author
Mika
committed
Modified Wi-SUN etx to wait for Probes
Return 0xffff ETX when no probing ready if Child direction is not probed return 1.0 to allow downward source routing. after enough measures are made actual ETX used
1 parent b720fbd commit 71c8bde

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ static void ws_bootstrap_ll_address_validate(struct protocol_interface_info_entr
834834
*/
835835
uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr_type, const uint8_t *addr_ptr)
836836
{
837+
uint16_t etx;
837838

838839
if (!addr_ptr || !interface) {
839840
return 0;
@@ -853,7 +854,16 @@ uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr
853854
return 0xffff;
854855
}
855856

856-
return etx_local_etx_read(interface->id, attribute_index);
857+
etx = etx_local_etx_read(interface->id, attribute_index);
858+
859+
// If we dont have valid ETX for children we assume good ETX.
860+
// After enough packets is sent to children real calculated ETX is given.
861+
// This might result in ICMP source route errors returned to Border router causing secondary route uses
862+
if (etx == 0xffff && ipv6_neighbour_has_registered_by_eui64(&interface->ipv6_neighbour_cache, mac_neighbor->mac64)) {
863+
return 0x100;
864+
}
865+
866+
return etx;
857867
}
858868
bool ws_bootstrap_nd_ns_transmit(protocol_interface_info_entry_t *cur, ipv6_neighbour_t *entry, bool unicast, uint8_t seq)
859869
{

source/Service_Libs/etx/etx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ uint16_t etx_local_etx_read(int8_t interface_id, uint8_t attribute_index)
445445
return etx_info.max_etx;
446446
}
447447
//Not ready yet
448-
return 0;
448+
return 0xffff;
449449
}
450450

451451
return etx_current_calc(entry->etx, entry->accumulated_failures) >> 4;

0 commit comments

Comments
 (0)