Compare commits
23 Commits
6f24d6a839
...
8da50e2c3f
Author | SHA1 | Date | |
---|---|---|---|
8da50e2c3f | |||
d9c71fa4b1 | |||
![]() |
2e326da175 | ||
![]() |
7698e92a94 | ||
![]() |
c50ef12729 | ||
eb8e61c7c7 | |||
![]() |
b06211d086 | ||
![]() |
3a045ec4b4 | ||
![]() |
c315c5a10f | ||
3b7d122e3d | |||
d07d1b4b98 | |||
87f84fec4d | |||
f335b05182 | |||
0a164942c8 | |||
e710390f53 | |||
50128b7304 | |||
![]() |
e77d30a017 | ||
![]() |
57398383ae | ||
![]() |
598635ee4f | ||
![]() |
9ac5df0f02 | ||
![]() |
580ac8b2d7 | ||
![]() |
672f2339d7 | ||
![]() |
6270d90f98 |
2
.idea/runConfigurations/ccsds_handler.xml
generated
2
.idea/runConfigurations/ccsds_handler.xml
generated
@@ -12,7 +12,7 @@
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
||||
<option name="PARAMETERS" value="-s ccsds_handler -l -t 8 --hk" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
|
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
@@ -12,7 +12,7 @@
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
||||
<option name="PARAMETERS" value="-s 17 -o 0 -t 3 -l" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
|
202
LICENSE
Normal file
202
LICENSE
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
13
NOTICE
Normal file
13
NOTICE
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright 2021 Institute of Space Systems (IRS), University of Stuttgart
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@@ -149,22 +149,49 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
service_tuple = ("TMP1075 2", op_code_dict)
|
||||
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
|
||||
|
||||
op_code_dict_srv_p60 = {
|
||||
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
P60OpCodes.STACK_3V3_ON.value: (
|
||||
"P60 Dock: Turn stack 3V3 on",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
P60OpCodes.STACK_3V3_OFF.value: (
|
||||
"P60 Dock: Turn stack 3V3 off",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
GomspaceOpCodes.PRINT_SWITCH_V_I.value: (
|
||||
"P60 Dock: Print Switches, Voltages, Currents",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys="0",
|
||||
info="P60 Tests",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_ON.value,
|
||||
info="P60 Dock: Turn stack 3V3 on",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_OFF.value,
|
||||
info="P60 Dock: Turn stack 3V3 off",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_ON.value,
|
||||
info="P60 Dock: Turn stack 5V on",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_OFF.value,
|
||||
info="P60 Dock: Turn stack 5V off",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
|
||||
info="P60 Dock: Print Switches, Voltages, Currents",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=service_op_code_dict,
|
||||
name=CustomServiceList.P60DOCK.value,
|
||||
info="P60 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
op_code_dict_srv_pdu1 = {
|
||||
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
@@ -208,6 +235,14 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
"PDU1: Turn Syrlinks off",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
Pdu1OpCodes.MGT_ON.value: (
|
||||
"PDU1: Turn MGT on",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
Pdu1OpCodes.MGT_OFF.value: (
|
||||
"PDU1: Turn MGT off",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
GomspaceOpCodes.PRINT_SWITCH_V_I.value: (
|
||||
"PDU1: Print Switches, Voltages, Currents",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
@@ -486,7 +521,7 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
"37": ("Star Tracker: Set time", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"38": ("Star Tracker: Download centroid", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"39": (
|
||||
"Star Tracker: Upload centroid (not implemented by arcsec?)",
|
||||
"Star Tracker: Upload centroid (not implemented?)",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"40": ("Star Tracker: Download matched star", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
@@ -499,6 +534,11 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
),
|
||||
"45": ("Star Tracker: Upload FPGA image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"46": ("Star Tracker: FPGA action", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"47": ("Star Tracker: Unlock", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"48": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"50": ("Star Tracker: Request blob parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
|
||||
|
||||
@@ -507,6 +547,11 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("CCSDS Handler: Enable tx clock manipulator", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("CCSDS Handler: Disable tx clock manipulator", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": ("CCSDS Handler: Update tx data on rising edge", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": ("CCSDS Handler: Update tx data on falling edge", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
|
||||
|
||||
@@ -536,7 +581,6 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_syrlinks_handler,
|
||||
)
|
||||
|
||||
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
|
||||
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
|
||||
# service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
|
||||
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
|
||||
|
@@ -5,6 +5,8 @@
|
||||
@author J. Meier
|
||||
@date 20.11.2021
|
||||
"""
|
||||
import struct
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
@@ -12,13 +14,22 @@ from spacepackets.ecss.tc import PusTelecommand
|
||||
|
||||
class CommandIds:
|
||||
# Configures input rate of syrlinks to 400 Khz (results in downlink rate of 200 kbps)
|
||||
SET_LOW_RATE = bytearray([0x0, 0x0, 0x0, 0x0])
|
||||
SET_LOW_RATE = 0
|
||||
# Configures input rate of syrlinks to 2000 Khz (results in downlink rate of 1000 kbps)
|
||||
SET_HIGH_RATE = bytearray([0x0, 0x0, 0x0, 0x1])
|
||||
SET_HIGH_RATE = 1
|
||||
# Enables the syrlinks transmitter (by using RS485 enables lines)
|
||||
EN_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x2])
|
||||
EN_TRANSMITTER = 2
|
||||
# Disables the syrlinks transmitter (by using RS485 enables lines)
|
||||
DIS_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x3])
|
||||
DIS_TRANSMITTER = 3
|
||||
# Sets an arbitrary bitrate. Normally only set low and set high rate commands should be
|
||||
# required
|
||||
ARBITRARY_BITRATE = 4
|
||||
ENABLE_TX_CLK_MANIPULATOR = 5
|
||||
DISABLE_TX_CLK_MANIPULATOR = 6
|
||||
# Tx data will be updated on rising edge of tx clock
|
||||
UPDATE_ON_RISING_EDGE = 7
|
||||
# Tx data will be updated on falling edge of tx clock
|
||||
UPDATE_ON_FALLING_EDGE = 8
|
||||
|
||||
|
||||
def pack_ccsds_handler_test(
|
||||
@@ -27,36 +38,56 @@ def pack_ccsds_handler_test(
|
||||
tc_queue.appendleft(
|
||||
(
|
||||
QueueCommands.PRINT,
|
||||
"Testing ccsds handler with object id: 0x" + object_id.hex(),
|
||||
"Testing CCSDS handler with object id: 0x" + object_id.hex(),
|
||||
)
|
||||
)
|
||||
|
||||
if op_code == "0":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate"))
|
||||
command = object_id + CommandIds.SET_LOW_RATE
|
||||
command = object_id + struct.pack('!I', CommandIds.SET_LOW_RATE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "1":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set high rate"))
|
||||
command = object_id + CommandIds.SET_HIGH_RATE
|
||||
command = object_id + struct.pack('!I', CommandIds.SET_HIGH_RATE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "2":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter")
|
||||
)
|
||||
command = object_id + CommandIds.EN_TRANSMITTER
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter"))
|
||||
command = object_id + struct.pack('!I', CommandIds.EN_TRANSMITTER)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "3":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter"))
|
||||
command = object_id + struct.pack('!I', CommandIds.DIS_TRANSMITTER)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "4":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter")
|
||||
(QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate")
|
||||
)
|
||||
command = object_id + CommandIds.DIS_TRANSMITTER
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
||||
bitrate = int(input("Specify bit rate (bps): "))
|
||||
command = object_id + struct.pack('!I', CommandIds.ARBITRARY_BITRATE) + struct.pack('!I', bitrate)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "5":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Enable tx clock manipulator"))
|
||||
command = object_id + struct.pack('!I', CommandIds.ENABLE_TX_CLK_MANIPULATOR)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "6":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Disable tx clock manipulator"))
|
||||
command = object_id + struct.pack('!I', CommandIds.DISABLE_TX_CLK_MANIPULATOR)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "7":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Update tx data on rising edge of tx clock"))
|
||||
command = object_id + struct.pack('!I', CommandIds.UPDATE_ON_RISING_EDGE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "8":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Update tx data on falling edge of tx clock"))
|
||||
command = object_id + struct.pack('!I', CommandIds.UPDATE_ON_FALLING_EDGE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
return tc_queue
|
||||
|
@@ -14,6 +14,8 @@ class P60OpCodes(enum.Enum):
|
||||
TEST = "0"
|
||||
STACK_3V3_ON = "1"
|
||||
STACK_3V3_OFF = "2"
|
||||
STACK_5V_ON = "3"
|
||||
STACK_5V_OFF = "4"
|
||||
|
||||
|
||||
class P60DockTestProcedure:
|
||||
@@ -29,7 +31,7 @@ class P60DockTestProcedure:
|
||||
gnd_wdt_reset = False
|
||||
ping = False
|
||||
channel_3_off = False # pdu2
|
||||
read_temperature1 = True
|
||||
read_temperature1 = False
|
||||
read_channel_3_state = False # pdu2
|
||||
read_cur_lu_lim_0 = False
|
||||
channel_3_on = False # pdu2
|
||||
@@ -81,7 +83,6 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
Channel.on,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
return
|
||||
if op_code == P60OpCodes.STACK_3V3_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
|
||||
command = pack_set_param_command(
|
||||
@@ -91,7 +92,24 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
return
|
||||
if op_code == P60OpCodes.STACK_5V_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 5V on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
P60DockConfigTable.out_en_10.parameter_address,
|
||||
P60DockConfigTable.out_en_10.parameter_size,
|
||||
Channel.on,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == P60OpCodes.STACK_5V_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 5V off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
P60DockConfigTable.out_en_10.parameter_address,
|
||||
P60DockConfigTable.out_en_10.parameter_size,
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
|
||||
@@ -146,7 +164,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
|
||||
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
|
@@ -25,6 +25,8 @@ class Pdu1OpCodes(enum.Enum):
|
||||
ACS_A_SIDE_OFF = "8"
|
||||
SYRLINKS_ON = "9"
|
||||
SYRLINKS_OFF = "10"
|
||||
MGT_ON = "11"
|
||||
MGT_OFF = "12"
|
||||
|
||||
|
||||
class PDU1TestProcedure:
|
||||
@@ -154,7 +156,24 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == Pdu1OpCodes.MGT_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.on,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == Pdu1OpCodes.MGT_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
|
||||
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
|
||||
|
@@ -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
|
||||
@@ -28,6 +29,7 @@ class StarTrackerActionIds:
|
||||
DOWNLOAD_CENTROID = 16
|
||||
UPLOAD_CENTROID = 17
|
||||
SUBSCRIBE_TO_TM = 18
|
||||
IMAGE_PROCESSOR = 19
|
||||
REQ_SOLUTION = 24
|
||||
REQ_TEMPERATURE = 25
|
||||
REQ_HISTOGRAM = 28
|
||||
@@ -58,13 +60,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"
|
||||
@@ -430,8 +435,8 @@ def pack_star_tracker_commands(
|
||||
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)
|
||||
@@ -443,7 +448,7 @@ def pack_star_tracker_commands(
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "44":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Star tracker: Chnage donwload FPGA image file name")
|
||||
(QueueCommands.PRINT, "Star tracker: Change donwload FPGA image file name")
|
||||
)
|
||||
command = (
|
||||
object_id
|
||||
@@ -471,6 +476,36 @@ def pack_star_tracker_commands(
|
||||
)
|
||||
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())
|
||||
if op_code == "51":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set image processor parameters"))
|
||||
command = object_id + struct.pack('!I', StarTrackerActionIds.IMAGE_PROCESSOR) + \
|
||||
bytearray(ImagePathDefs.jsonFile, 'utf-8')
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
|
||||
def pack_write_command(object_id: bytearray) -> bytearray:
|
||||
|
@@ -1 +1 @@
|
||||
tmtccmd>=1.10.1
|
||||
tmtccmd>=1.10.2
|
||||
|
Submodule spacepackets updated: ee22cea621...3265de6971
Reference in New Issue
Block a user