mirror of
https://github.com/espressif/openthread.git
synced 2026-08-29 13:29:54 +00:00
Fix hop limit handling in the Mesh Header in the Python framework. (#1186)
This commit is contained in:
committed by
Jonathan Hui
parent
50db58ddce
commit
0d6866e013
@@ -849,7 +849,11 @@ class LowpanMeshHeaderFactory:
|
||||
is_short_originator_address = bool(data_byte & 0x20)
|
||||
is_short_final_destination_address = bool(data_byte & 0x10)
|
||||
|
||||
hops_left = (data_byte & 0x0f)
|
||||
if (data_byte & 0x0f) != 0x0f:
|
||||
hops_left = (data_byte & 0x0f)
|
||||
else:
|
||||
hops_left = ord(data.read(1))
|
||||
|
||||
originator_address = self._parse_address(data, is_short_originator_address)
|
||||
final_destination_address = self._parse_address(data, is_short_final_destination_address)
|
||||
|
||||
@@ -1091,3 +1095,7 @@ class LowpanParser(object):
|
||||
|
||||
elif self._is_iphc(first_byte):
|
||||
return self._handle_iphc_header(data, message_info)
|
||||
|
||||
else:
|
||||
raise RuntimeError("Unsupported header type: 0x{:02x}".format(first_byte))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user