star tracker image upload

This commit is contained in:
Jakob Meier
2021-12-06 15:44:34 +01:00
parent d6f5d38f21
commit 7b01165ff9
6 changed files with 104 additions and 10 deletions

View File

@ -21,9 +21,17 @@ class StarTrackerActionIds:
REQ_TIME = 4
REQ_POWER = 11
REBOOT = 7
DOWNLOAD_IMAGE = 9
UPLOAD_IMAGE = 10
SUBSCRIBE_TO_TM = 18
REQ_SOLUTION = 24
REQ_TEMPERATURE = 25
LIMITS = 40
class ImagePathDefs:
uploadFile = "/mnt/sd0/startracker/gemma.bin"
jsonFile = "/mnt/sd0/startracker/full.json"
def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@ -83,3 +91,20 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_SOLUTION)
command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "10":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
command = object_id + struct.pack('!I', StarTrackerActionIds.UPLOAD_IMAGE) + \
bytearray(ImagePathDefs.uploadFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "11":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
command = object_id + struct.pack('!I', StarTrackerActionIds.DOWNLOAD_IMAGE)
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
command = object_id + struct.pack('!I', StarTrackerActionIds.LIMITS) + \
bytearray(ImagePathDefs.jsonFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())