continued update to new API

This commit is contained in:
2022-07-04 17:59:09 +02:00
parent 27edcbd71d
commit 2b285417a0
19 changed files with 727 additions and 1012 deletions

View File

@ -10,10 +10,9 @@
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import QueueHelper
from tmtccmd.utility import ObjectId
class Commands:
@ -25,24 +24,15 @@ class ImagePathDefs:
uploadFile = "/mnt/sd0/startracker/gemma.bin"
def pack_str_img_helper_command(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing star tracker image helper object id: 0x" + object_id.hex(),
)
def pack_str_img_helper_command(object_id: ObjectId, q: QueueHelper, op_code: str):
q.add_log_cmd(
f"Testing star tracker image helper object id: {object_id.as_hex_string}"
)
if op_code == "0":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker image helper: Upload image")
)
q.add_log_cmd("Star tracker image helper: Upload image")
command = (
object_id
object_id.as_bytes
+ struct.pack("!I", Commands.UPLOAD_IMAGE)
+ bytearray(ImagePathDefs.uploadFile, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))