star tracker fpga upload command

This commit is contained in:
Jakob Meier 2021-12-30 12:55:24 +01:00
parent e3950bbbcc
commit 418ecb815b
2 changed files with 26 additions and 0 deletions

View File

@ -327,6 +327,9 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"41": ("Star Tracker: Download DB Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"42": ("Star Tracker: Download Blob Pixel", {OpCodeDictKeys.TIMEOUT: 2.0}),
"43": ("Star Tracker: Download FPGA Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"44": ("Star Tracker: Change download FPGA image name", {OpCodeDictKeys.TIMEOUT: 2.0}),
"45": ("Star Tracker: Upload FPGA image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"46": ("Star Tracker: FPGA action", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)

View File

@ -55,6 +55,9 @@ class StarTrackerActionIds:
DOWNLOAD_DBIMAGE = 61
DOWNLOAD_BLOBPIXEL = 62
DOWNLOAD_FPGA_IMAGE = 63
CHANGE_FPGA_DOWNLOAD_FILE = 64
UPLOAD_FPGA_IMAGE = 65
FPGA_ACTION = 66
class ImagePathDefs:
@ -66,6 +69,8 @@ class ImagePathDefs:
flashReadPath = "/mnt/sd0/startracker"
uploadCentroidJson = "/mnt/sd0/startracker/upload-centroid.json"
downloadFpgaImagePath = "/mnt/sd0/startracker"
downloadFpgaImageName = "testname"
uploadFpgaImageName = "/mnt/sd0/startracker/fpga-image.bin"
class Region:
@ -341,6 +346,24 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
ImagePathDefs.downloadFpgaImagePath, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=66, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "44":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Chnage donwload FPGA image file name"))
command = object_id + struct.pack('!I', StarTrackerActionIds.CHANGE_FPGA_DOWNLOAD_FILE) + \
bytearray(ImagePathDefs.downloadFpgaImageName, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=67, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "45":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload FPGA image"))
command = object_id + struct.pack('!I', StarTrackerActionIds.UPLOAD_FPGA_IMAGE) + \
bytearray(ImagePathDefs.uploadFpgaImageName, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=68, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "46":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: FPGA action"))
id = 3
command = object_id + struct.pack('!I', StarTrackerActionIds.FPGA_ACTION) + struct.pack('!B', id)
command = PusTelecommand(service=8, subservice=128, ssc=69, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
def pack_write_command(object_id: bytearray) -> bytearray: