ploc tests

This commit is contained in:
Jakob Meier 2021-04-27 17:38:52 +02:00
parent e23bc11608
commit 06750809cb

View File

@ -41,15 +41,15 @@ def pack_ploc_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
if PlocTestProcedure.all or PlocTestProcedure.test_tc_mem_write:
tc_queue.appendleft((QueueCommands.PRINT, "PLOC: TC Mem Write Test"))
memory_address = int(input("Type memory address: 0x"), 16)
memory_data = int(input("Type memory data: 0x"), 16)
command = generateWriteMemCommand(object_id, struct.pack('!I', memory_address), memory_data)
memory_address = int(input("PLOC Tc Mem Write: Type memory address: 0x"), 16)
memory_data = int(input("PLOC Tc Mem Write: Type memory data: 0x"), 16)
command = generate_write_mem_command(object_id, struct.pack('!I', memory_address), memory_data)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PlocTestProcedure.all or PlocTestProcedure.test_tc_mem_read:
tc_queue.appendleft((QueueCommands.PRINT, "PLOC: TC Mem Read Test"))
memory_address = int(input("Type memory address: 0x"), 16)
memory_address = int(input("PLOC Tc Mem Read: Type memory address: 0x"), 16)
command = object_id + PlocActionIds.tc_mem_read + struct.pack('!I', memory_address)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@ -57,7 +57,7 @@ def pack_ploc_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
return tc_queue
def generateWriteMemCommand(object_id: bytearray, memory_address: bytearray, memory_data: int) -> bytearray:
def generate_write_mem_command(object_id: bytearray, memory_address: bytearray, memory_data: int) -> bytearray:
""" This function generates the command to write to a memory address within the PLOC
@param object_id The object id of the PlocHandler
@param memory_address The PLOC memory address where to write to.