mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 07:20:18 +00:00
packet: Fix header_type matching according to IFAC
Ever since IFAC/Interface Access Codes were introduced, the header type is one bit long and not two.
This commit is contained in:
parent
0f023cc533
commit
6ecae615de
@ -58,9 +58,7 @@ class Packet:
|
|||||||
# Header types
|
# Header types
|
||||||
HEADER_1 = 0x00 # Normal header format
|
HEADER_1 = 0x00 # Normal header format
|
||||||
HEADER_2 = 0x01 # Header format used for packets in transport
|
HEADER_2 = 0x01 # Header format used for packets in transport
|
||||||
HEADER_3 = 0x02 # Reserved
|
header_types = [HEADER_1, HEADER_2]
|
||||||
HEADER_4 = 0x03 # Reserved
|
|
||||||
header_types = [HEADER_1, HEADER_2, HEADER_3, HEADER_4]
|
|
||||||
|
|
||||||
# Packet context types
|
# Packet context types
|
||||||
NONE = 0x00 # Generic data packet
|
NONE = 0x00 # Generic data packet
|
||||||
@ -215,7 +213,7 @@ class Packet:
|
|||||||
self.flags = self.raw[0]
|
self.flags = self.raw[0]
|
||||||
self.hops = self.raw[1]
|
self.hops = self.raw[1]
|
||||||
|
|
||||||
self.header_type = (self.flags & 0b11000000) >> 6
|
self.header_type = (self.flags & 0b01000000) >> 6
|
||||||
self.transport_type = (self.flags & 0b00110000) >> 4
|
self.transport_type = (self.flags & 0b00110000) >> 4
|
||||||
self.destination_type = (self.flags & 0b00001100) >> 2
|
self.destination_type = (self.flags & 0b00001100) >> 2
|
||||||
self.packet_type = (self.flags & 0b00000011)
|
self.packet_type = (self.flags & 0b00000011)
|
||||||
|
Loading…
Reference in New Issue
Block a user