Merge branch 'main' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc
This commit is contained in:
@ -12,11 +12,11 @@ from typing import Union
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_8_fsfw_funccmd import create_fsfw_action_cmd
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||
|
||||
|
||||
class GomspaceDeviceActionIds(enum.IntEnum):
|
||||
class GomspaceDeviceActionId(enum.IntEnum):
|
||||
PING = 1
|
||||
REBOOT = 4
|
||||
PARAM_GET = 0
|
||||
@ -63,8 +63,8 @@ class Channel:
|
||||
|
||||
|
||||
def pack_request_config_command(object_id: bytes) -> PusTelecommand:
|
||||
return create_fsfw_action_cmd(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.REQUEST_CONFIG_TABLE
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionId.REQUEST_CONFIG_TABLE
|
||||
)
|
||||
|
||||
|
||||
@ -88,9 +88,9 @@ def pack_get_param_command(
|
||||
else:
|
||||
app_data += memory_address
|
||||
app_data += struct.pack("!B", parameter_size)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id,
|
||||
action_id=GomspaceDeviceActionIds.PARAM_GET,
|
||||
action_id=GomspaceDeviceActionId.PARAM_GET,
|
||||
user_data=app_data,
|
||||
)
|
||||
|
||||
@ -98,12 +98,12 @@ def pack_get_param_command(
|
||||
def pack_set_float_param_command(
|
||||
object_id: bytes, memory_address: bytes, parameter: float
|
||||
) -> PusTelecommand:
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(4)
|
||||
app_data += struct.pack("!f", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
@ -111,12 +111,12 @@ def pack_set_float_param_command(
|
||||
def pack_set_u8_param_command(
|
||||
object_id: bytes, memory_address: bytes, parameter: int
|
||||
) -> PusTelecommand:
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(1)
|
||||
app_data.append(parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
@ -124,12 +124,12 @@ def pack_set_u8_param_command(
|
||||
def pack_set_i8_param_command(
|
||||
object_id: bytes, memory_address: bytes, parameter: int
|
||||
) -> PusTelecommand:
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(1)
|
||||
app_data += struct.pack("!b", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
@ -137,12 +137,12 @@ def pack_set_i8_param_command(
|
||||
def pack_set_u16_param_command(
|
||||
object_id: bytes, memory_address: bytes, parameter: int
|
||||
) -> PusTelecommand:
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(2)
|
||||
app_data += struct.pack("!H", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
@ -150,34 +150,34 @@ def pack_set_u16_param_command(
|
||||
def pack_set_i16_param_command(
|
||||
object_id: bytes, memory_address: bytes, parameter: int
|
||||
) -> PusTelecommand:
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(2)
|
||||
app_data += struct.pack("!h", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
|
||||
def pack_set_u32_param_command(object_id: bytes, memory_address: bytes, parameter: int):
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(4)
|
||||
app_data += struct.pack("!I", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
|
||||
def pack_set_i32_param_command(object_id: bytes, memory_address: bytes, parameter: int):
|
||||
action_id = GomspaceDeviceActionIds.PARAM_SET
|
||||
action_id = GomspaceDeviceActionId.PARAM_SET
|
||||
app_data = bytearray()
|
||||
app_data += memory_address
|
||||
app_data.append(4)
|
||||
app_data += struct.pack("!i", parameter)
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id, action_id=action_id, user_data=app_data
|
||||
)
|
||||
|
||||
@ -224,9 +224,9 @@ def pack_ping_command(object_id: ObjectIdU32, data: bytearray) -> PusTelecommand
|
||||
@note The ping request sends the specified data to a gompsace device. These
|
||||
data are simply copied by the device and then sent back.
|
||||
"""
|
||||
return create_fsfw_action_cmd(
|
||||
return create_action_cmd(
|
||||
object_id=object_id.as_bytes,
|
||||
action_id=GomspaceDeviceActionIds.PING,
|
||||
action_id=GomspaceDeviceActionId.PING,
|
||||
user_data=data,
|
||||
)
|
||||
|
||||
@ -235,8 +235,8 @@ def pack_gnd_wdt_reset_command(object_id: ObjectIdBase) -> PusTelecommand:
|
||||
""" " Function to generate the command to reset the watchdog of a gomspace device.
|
||||
@param object_id Object Id of the gomspace device handler.
|
||||
"""
|
||||
return create_fsfw_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.WDT_RESET
|
||||
return create_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionId.WDT_RESET
|
||||
)
|
||||
|
||||
|
||||
@ -244,8 +244,8 @@ def pack_reboot_command(object_id: ObjectIdU32) -> PusTelecommand:
|
||||
"""Function to generate the command which triggers a reboot of a gomspace device
|
||||
@param object_id The object id of the gomspace device handler.
|
||||
"""
|
||||
return create_fsfw_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REBOOT
|
||||
return create_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionId.REBOOT
|
||||
)
|
||||
|
||||
|
||||
@ -254,6 +254,6 @@ def pack_request_full_hk_table_command(object_id: ObjectIdU32) -> PusTelecommand
|
||||
device.
|
||||
@param object_id The object id of the gomspace device handler.
|
||||
"""
|
||||
return create_fsfw_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE
|
||||
return create_action_cmd(
|
||||
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionId.REQUEST_HK_TABLE
|
||||
)
|
||||
|
Reference in New Issue
Block a user