generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from ut-issl/feature/fix_TF_ACK
Pre Release (v3.6.0-beta.0): TLM生成関数の返り値を int から TF_ACK にするなど
- Loading branch information
Showing
10 changed files
with
503 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 66 additions & 66 deletions
132
...nimum_user_for_s2e/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_MOBC_TLM_DB_TF.csv
Large diffs are not rendered by default.
Oops, something went wrong.
132 changes: 66 additions & 66 deletions
132
...or_s2e/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_TF.csv
Large diffs are not rendered by default.
Oops, something went wrong.
110 changes: 110 additions & 0 deletions
110
Examples/minimum_user_for_s2e/src/src_user/Test/test/src_core/CmdTlm/test_telemetry_frame.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
|
||
import isslwings as wings | ||
import pytest | ||
|
||
ROOT_PATH = "../../../" | ||
sys.path.append(os.path.dirname(__file__) + "/" + ROOT_PATH + "utils") | ||
import c2a_enum_utils | ||
import wings_utils | ||
|
||
c2a_enum = c2a_enum_utils.get_c2a_enum() | ||
ope = wings_utils.get_wings_operation() | ||
|
||
# コードと整合をとる | ||
TF_TLM_PAGE_SIZE = 64 | ||
TF_TLM_PAGE_MAX = 4 | ||
|
||
# 使われてない tlm id | ||
NO_USED_TLM_ID = 1 | ||
|
||
|
||
@pytest.mark.real | ||
@pytest.mark.sils | ||
def test_telemetry_frame_set_page(): | ||
init_tf() | ||
|
||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
assert tlm_TF["TF.PAGE_NO"] == 0 | ||
|
||
assert "SUC" == wings.util.send_rt_cmd_and_confirm( | ||
ope, c2a_enum.Cmd_CODE_TF_SET_PAGE_FOR_TLM, (1,), c2a_enum.Tlm_CODE_HK | ||
) | ||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
assert tlm_TF["TF.PAGE_NO"] == 1 | ||
|
||
assert "PRM" == wings.util.send_rt_cmd_and_confirm( | ||
ope, c2a_enum.Cmd_CODE_TF_SET_PAGE_FOR_TLM, (TF_TLM_PAGE_MAX,), c2a_enum.Tlm_CODE_HK | ||
) | ||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
assert tlm_TF["TF.PAGE_NO"] == 1 | ||
|
||
|
||
@pytest.mark.real | ||
@pytest.mark.sils | ||
def test_telemetry_frame_tlm_func(): | ||
init_tf() | ||
|
||
# 登録されている tlm func の確認 | ||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
assert int(tlm_TF["TF.TLM0"], base=16) != 0 # tlm id = 0 は MOBC tlm が普通はある | ||
|
||
# 登録されていない tlm func の確認 | ||
page = NO_USED_TLM_ID // TF_TLM_PAGE_SIZE | ||
offset = NO_USED_TLM_ID % TF_TLM_PAGE_SIZE | ||
|
||
assert "SUC" == wings.util.send_rt_cmd_and_confirm( | ||
ope, c2a_enum.Cmd_CODE_TF_SET_PAGE_FOR_TLM, (page,), c2a_enum.Tlm_CODE_HK | ||
) | ||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
|
||
assert tlm_TF["TF.TLM" + str(offset)] == "0x00000000" | ||
|
||
# tlm func の登録 | ||
func_adr = "0x12345678" | ||
assert "SUC" == wings.util.send_rt_cmd_and_confirm( | ||
ope, | ||
c2a_enum.Cmd_CODE_TF_REGISTER_TLM, | ||
(NO_USED_TLM_ID, int(func_adr, base=16)), | ||
c2a_enum.Tlm_CODE_HK, | ||
) | ||
tlm_TF = wings.util.generate_and_receive_tlm( | ||
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TF | ||
) | ||
assert tlm_TF["TF.TLM" + str(offset)] == func_adr | ||
|
||
# 不正な登録 | ||
# → 第一引数が uint8_t なので,そもそも TF_TLM_PAGE_SIZE * TF_TLM_PAGE_MAX 以上の値を打てない | ||
# assert "PRM" == wings.util.send_rt_cmd_and_confirm( | ||
# ope, c2a_enum.Cmd_CODE_TF_REGISTER_TLM, (TF_TLM_PAGE_SIZE * TF_TLM_PAGE_MAX, int(func_adr, base=16)), c2a_enum.Tlm_CODE_HK | ||
# ) | ||
|
||
|
||
@pytest.mark.real | ||
@pytest.mark.sils | ||
def test_telemetry_frame_final_check(): | ||
init_tf() | ||
|
||
|
||
def init_tf(): | ||
assert "SUC" == wings.util.send_rt_cmd_and_confirm( | ||
ope, c2a_enum.Cmd_CODE_TF_INIT, (), c2a_enum.Tlm_CODE_HK | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
Oops, something went wrong.