mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-05 05:40:14 +00:00
AX.25 interface updates
This commit is contained in:
parent
4e136eea03
commit
5d977e09fb
@ -27,6 +27,7 @@ class AX25():
|
|||||||
PID_NOLAYER3 = chr(0xF0)
|
PID_NOLAYER3 = chr(0xF0)
|
||||||
CTRL_UI = chr(0x03)
|
CTRL_UI = chr(0x03)
|
||||||
CRC_CORRECT = chr(0xF0)+chr(0xB8)
|
CRC_CORRECT = chr(0xF0)+chr(0xB8)
|
||||||
|
HEADER_SIZE = 16
|
||||||
|
|
||||||
|
|
||||||
class AX25KISSInterface(Interface):
|
class AX25KISSInterface(Interface):
|
||||||
@ -178,8 +179,8 @@ class AX25KISSInterface(Interface):
|
|||||||
|
|
||||||
|
|
||||||
def processIncoming(self, data):
|
def processIncoming(self, data):
|
||||||
if (len(data) > 16):
|
if (len(data) > AX25.HEADER_SIZE):
|
||||||
self.owner.inbound(data[16:], self)
|
self.owner.inbound(data[AX25.HEADER_SIZE:], self)
|
||||||
|
|
||||||
|
|
||||||
def processOutgoing(self,data):
|
def processOutgoing(self,data):
|
||||||
@ -252,10 +253,10 @@ class AX25KISSInterface(Interface):
|
|||||||
in_frame = True
|
in_frame = True
|
||||||
command = KISS.CMD_UNKNOWN
|
command = KISS.CMD_UNKNOWN
|
||||||
data_buffer = ""
|
data_buffer = ""
|
||||||
elif (in_frame and len(data_buffer) < RNS.Reticulum.MTU):
|
elif (in_frame and len(data_buffer) < RNS.Reticulum.MTU+AX25.OVERHEAD):
|
||||||
if (len(data_buffer) == 0 and command == KISS.CMD_UNKNOWN):
|
if (len(data_buffer) == 0 and command == KISS.CMD_UNKNOWN):
|
||||||
# We only support one HDLC port for now, so
|
# We only support one HDLC port for now, so
|
||||||
# strip off port nibble
|
# strip off the port nibble
|
||||||
byte = chr(ord(byte) & 0x0F)
|
byte = chr(ord(byte) & 0x0F)
|
||||||
command = byte
|
command = byte
|
||||||
elif (command == KISS.CMD_DATA):
|
elif (command == KISS.CMD_DATA):
|
||||||
|
@ -47,6 +47,8 @@ def loglevelname(level):
|
|||||||
return "Verbose"
|
return "Verbose"
|
||||||
if (level == LOG_DEBUG):
|
if (level == LOG_DEBUG):
|
||||||
return "Debug"
|
return "Debug"
|
||||||
|
if (level == LOG_EXTREME):
|
||||||
|
return "Extra"
|
||||||
|
|
||||||
return "Unknown"
|
return "Unknown"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user