mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted state manager in data type handler
This commit is contained in:
parent
0e1986b2da
commit
4f50b802ac
1 changed files with 9 additions and 0 deletions
|
@ -54,6 +54,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def dispatch(self, type_byte: int, data: bytearray):
|
def dispatch(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type and session_type in self.handlers and 'handle' in self.handlers[session_type]:
|
if session_type and session_type in self.handlers and 'handle' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['handle'](data)
|
return self.handlers[session_type]['handle'](data)
|
||||||
else:
|
else:
|
||||||
|
@ -61,6 +64,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def failed(self, type_byte: int, data: bytearray):
|
def failed(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type in self.handlers and 'failed' in self.handlers[session_type]:
|
if session_type in self.handlers and 'failed' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['failed'](data)
|
return self.handlers[session_type]['failed'](data)
|
||||||
else:
|
else:
|
||||||
|
@ -74,6 +80,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def transmitted(self, type_byte: int, data: bytearray):
|
def transmitted(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type in self.handlers and 'transmitted' in self.handlers[session_type]:
|
if session_type in self.handlers and 'transmitted' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['transmitted'](data)
|
return self.handlers[session_type]['transmitted'](data)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue