|
|
|
@@ -20,6 +20,7 @@ class StarTrackerActionIds:
|
|
|
|
|
REQ_VERSION = 2
|
|
|
|
|
REQ_INTERFACE = 3
|
|
|
|
|
REQ_TIME = 4
|
|
|
|
|
UNLOCK = 6
|
|
|
|
|
SWITCH_TO_BOOTLOADER_PROGRAM = 7
|
|
|
|
|
REQ_POWER = 11
|
|
|
|
|
TAKE_IMAGE = 15
|
|
|
|
@@ -58,13 +59,16 @@ class StarTrackerActionIds:
|
|
|
|
|
CHANGE_FPGA_DOWNLOAD_FILE = 64
|
|
|
|
|
UPLOAD_FPGA_IMAGE = 65
|
|
|
|
|
FPGA_ACTION = 66
|
|
|
|
|
REQ_CAMERA_PARAMS = 67
|
|
|
|
|
REQ_LIMITS = 68
|
|
|
|
|
REQ_BLOB_PARAMS = 69
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ImagePathDefs:
|
|
|
|
|
uploadFile = "/mnt/sd0/startracker/gemma.bin"
|
|
|
|
|
downloadFile = "test_image.bin"
|
|
|
|
|
downloadPath = "/mnt/sd0/startracker"
|
|
|
|
|
jsonFile = "/mnt/sd0/startracker/test.json"
|
|
|
|
|
jsonFile = "/mnt/sd0/startracker/full.json"
|
|
|
|
|
flashFile = "/mnt/sd0/startracker/flash.bin"
|
|
|
|
|
flashReadPath = "/mnt/sd0/startracker"
|
|
|
|
|
uploadCentroidJson = "/mnt/sd0/startracker/upload-centroid.json"
|
|
|
|
@@ -339,15 +343,15 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "43":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download FPGA Image"))
|
|
|
|
|
position = 0
|
|
|
|
|
length = 4100
|
|
|
|
|
position = int(input("Start position: "))
|
|
|
|
|
length = int(input("Size to download: "))
|
|
|
|
|
command = object_id + struct.pack('!I', StarTrackerActionIds.DOWNLOAD_FPGA_IMAGE) + \
|
|
|
|
|
struct.pack('!I', position) + struct.pack('!I', length) + bytearray(
|
|
|
|
|
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"))
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Change 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)
|
|
|
|
@@ -364,6 +368,26 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
|
|
|
|
|
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())
|
|
|
|
|
if op_code == "47":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Unlock"))
|
|
|
|
|
command = object_id + struct.pack('!I', StarTrackerActionIds.UNLOCK)
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "48":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request camera parameters"))
|
|
|
|
|
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_CAMERA_PARAMS)
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "49":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request limits"))
|
|
|
|
|
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LIMITS)
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "50":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request blob parameters"))
|
|
|
|
|
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_BLOB_PARAMS)
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=73, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pack_write_command(object_id: bytearray) -> bytearray:
|
|
|
|
|