Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SRC OBDH TMTC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin Mueller
SRC OBDH TMTC
Commits
79745237
Commit
79745237
authored
4 years ago
by
Robin.Mueller
Browse files
Options
Downloads
Patches
Plain Diff
some srv20 stuff
parent
fe9099de
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tc/obsw_image_handler.py
+14
-1
14 additions, 1 deletion
tc/obsw_image_handler.py
tc/obsw_tc_service20.py
+43
-1
43 additions, 1 deletion
tc/obsw_tc_service20.py
with
57 additions
and
2 deletions
tc/obsw_image_handler.py
+
14
−
1
View file @
79745237
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTelecommand
,
Deque
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTelecommand
,
Deque
from
tc.obsw_tc_service8
import
make_action_id
from
tc.obsw_tc_service8
import
make_action_id
from
tc.obsw_tc_service20
import
pack_boolean_parameter_setting
from
tmtc_core.utility.obsw_logger
import
get_logger
from
tmtc_core.utility.obsw_logger
import
get_logger
from
config.obsw_config
import
SW_IMAGE_HANDLER_ID
from
config.obsw_config
import
SW_IMAGE_HANDLER_ID
...
@@ -22,6 +23,10 @@ def generate_copy_obsw_sdc_to_flash_packet(ssc: int, slot: int,
...
@@ -22,6 +23,10 @@ def generate_copy_obsw_sdc_to_flash_packet(ssc: int, slot: int,
app_data
.
append
(
slot
)
app_data
.
append
(
slot
)
return
PusTelecommand
(
service
=
8
,
subservice
=
128
,
ssc
=
ssc
,
app_data
=
app_data
)
return
PusTelecommand
(
service
=
8
,
subservice
=
128
,
ssc
=
ssc
,
app_data
=
app_data
)
def
generate_param_packet_hamming_from_sdcard
(
enable
:
bool
,
ssc
:
int
,
object_id
:
bytearray
=
SW_IMAGE_HANDLER_ID
):
return
pack_boolean_parameter_setting
(
object_id
=
object_id
,
domain_id
=
0
,
unique_id
=
0
,
parameter
=
enable
,
ssc
=
ssc
)
def
generate_img_handler_packet
(
service_queue
:
Deque
,
op_code
:
int
):
def
generate_img_handler_packet
(
service_queue
:
Deque
,
op_code
:
int
):
# Action ID 4 (Copy SDC to Flash, Software Update Image)
# Action ID 4 (Copy SDC to Flash, Software Update Image)
...
@@ -29,9 +34,17 @@ def generate_img_handler_packet(service_queue: Deque, op_code: int):
...
@@ -29,9 +34,17 @@ def generate_img_handler_packet(service_queue: Deque, op_code: int):
service_queue
.
appendleft
((
"
print
"
,
"
Generating command to copy SDC OBSW to flash.
"
))
service_queue
.
appendleft
((
"
print
"
,
"
Generating command to copy SDC OBSW to flash.
"
))
command
=
generate_copy_obsw_sdc_to_flash_packet
(
ssc
=
0
,
slot
=
2
)
command
=
generate_copy_obsw_sdc_to_flash_packet
(
ssc
=
0
,
slot
=
2
)
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
# Action ID 11 (Copy bootloader from SDC to flash
# Action ID 11 (Copy bootloader from SDC to flash
elif
op_code
==
"
A11S
"
:
elif
op_code
==
"
A11S
"
:
service_queue
.
appendleft
((
"
print
"
,
"
Generating command to copy SDC bootloader to flash.
"
))
service_queue
.
appendleft
((
"
print
"
,
"
Generating command to copy SDC bootloader to flash.
"
))
command
=
generate_copy_bl_sdc_to_flash_packet
(
0
)
command
=
generate_copy_bl_sdc_to_flash_packet
(
0
)
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
elif
op_code
==
"
P0
"
:
service_queue
.
appendleft
((
"
print
"
,
"
Configrung hamming code to be taken from SD card
"
))
command
=
generate_param_packet_hamming_from_sdcard
(
enable
=
True
,
ssc
=
0
)
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
elif
op_code
==
"
P1
"
:
service_queue
.
appendleft
((
"
print
"
,
"
Configrung hamming code to be taken from FRAM
"
))
command
=
generate_param_packet_hamming_from_sdcard
(
enable
=
False
,
ssc
=
0
)
service_queue
.
appendleft
(
command
.
pack_command_tuple
())
This diff is collapsed.
Click to expand it.
tc/obsw_tc_service20.py
+
43
−
1
View file @
79745237
...
@@ -9,9 +9,46 @@ import struct
...
@@ -9,9 +9,46 @@ import struct
from
typing
import
Deque
from
typing
import
Deque
import
config.obsw_config
as
g
import
config.obsw_config
as
g
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTelecommand
from
tmtc_core.tc.obsw_pus_tc_base
import
PusTelecommand
,
TcQueueT
from
tmtc_core.utility.obsw_logger
import
get_logger
from
tc.obsw_tc_service200
import
pack_mode_data
from
tc.obsw_tc_service200
import
pack_mode_data
LOGGER
=
get_logger
()
def
pack_boolean_parameter_setting
(
object_id
:
bytearray
,
domain_id
:
int
,
unique_id
:
int
,
parameter
:
bool
,
ssc
:
int
):
"""
Generic function to pack a telecommand to tweak a boolean parameter
@param object_id:
@param domain_id:
@param unique_id:
@param parameter:
@param ssc:
@return:
"""
parameter_id
=
bytearray
(
4
)
parameter_id
[
0
]
=
domain_id
if
unique_id
>
255
:
LOGGER
.
warning
(
"
Invalid unique ID, should be smaller than 255!
"
)
return
parameter_id
[
1
]
=
unique_id
parameter_id
[
2
]
=
0
parameter_id
[
3
]
=
0
data_to_pack
=
bytearray
(
object_id
)
data_to_pack
.
extend
(
parameter_id
)
# PTC and PFC for uint8_t according to CCSDS
ptc
=
3
pfc
=
4
rows
=
0
columns
=
0
data_to_pack
.
append
(
ptc
)
data_to_pack
.
append
(
pfc
)
data_to_pack
.
append
(
rows
)
data_to_pack
.
append
(
columns
)
data_to_pack
.
append
(
parameter
)
return
PusTelecommand
(
service
=
20
,
subservice
=
128
,
ssc
=
ssc
,
app_data
=
data_to_pack
)
def
pack_service20_test_into
(
tc_queue
:
Deque
,
called_externally
:
bool
=
False
)
->
Deque
:
def
pack_service20_test_into
(
tc_queue
:
Deque
,
called_externally
:
bool
=
False
)
->
Deque
:
# parameter IDs
# parameter IDs
...
@@ -75,6 +112,11 @@ def pack_service20_test_into(tc_queue: Deque, called_externally: bool = False) -
...
@@ -75,6 +112,11 @@ def pack_service20_test_into(tc_queue: Deque, called_externally: bool = False) -
return
tc_queue
return
tc_queue
def
pack_service23_commands_into
(
tc_queue
:
TcQueueT
,
op_code
:
int
):
if
op_code
==
0
:
pack_service20_test_into
(
tc_queue
=
tc_queue
)
"""
"""
#test checking Load for int32_t
#test checking Load for int32_t
tc_queue.appendleft((
"
print
"
,
"
Testing Service 20: Load int32_t
"
))
tc_queue.appendleft((
"
print
"
,
"
Testing Service 20: Load int32_t
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment