attempt fixing ctest

This commit is contained in:
DJ2LS 2022-12-09 11:15:41 +01:00
parent 362cef9b08
commit 75c514f342

View file

@ -102,11 +102,12 @@ def t_create_session_close(session_id: bytes, dxcall: str) -> bytearray:
:return: Bytearray of the requested frame
:rtype: bytearray
"""
# return t_create_frame(223, mycall, dxcall)
dxcallsign_bytes = helpers.callsign_to_bytes(dxcall)
dxcallsign = helpers.bytes_to_callsign(dxcallsign_bytes)
dxcallsign_crc = helpers.get_crc_24(dxcallsign)
# return t_create_frame(223, mycall, dxcall)
frame = bytearray(14)
frame[:1] = bytes([223])
frame[1:2] = session_id
@ -188,7 +189,7 @@ def t_foreign_disconnect(mycall: str, dxcall: str):
wrong_session = np.random.bytes(1)
while wrong_session == open_session:
wrong_session = np.random.bytes(1)
close_frame = t_create_session_close(wrong_session, "ZZ0ZZ-0")
close_frame = t_create_session_close(wrong_session, dxcall)
print_frame(close_frame)
# assert (
@ -259,7 +260,10 @@ def t_valid_disconnect(mycall: str, dxcall: str):
# Create packet to be 'received' by this station.
# close_frame = t_create_session_close_old(mycall=dxcall, dxcall=mycall)
open_session = create_frame[1:2]
close_frame = t_create_session_close(open_session, "ZZ0ZZ-0")
print(dxcall)
print("#####################################################")
close_frame = t_create_session_close(open_session, mycall)
print(close_frame[2:5])
print_frame(close_frame)
tnc.received_session_close(close_frame)