C2A_Core
test_ccp_util.c
[詳解]
1 #pragma section REPRO
7 #include "test_ccp_util.h"
8 #include "../../TlmCmd/common_cmd_packet_util.h"
10 
12 {
13  cycle_t ti = CCP_get_param_from_packet(packet, 0, cycle_t);
16 
18 }
19 
21 {
22  uint16_t len = CCP_get_param_from_packet(packet, 0, uint16_t);
23  uint8_t first_data = CCP_get_param_from_packet(packet, 1, uint8_t);
24  const uint8_t* data;
25 
26  // CCP_get_raw_param_head の test
27  if (CCP_get_raw_param_head(packet) != CCP_get_param_head(packet) + sizeof(uint16_t) + sizeof(uint8_t))
28  {
30  }
31 
32  // len チェック
33  if (CCP_get_raw_param_len(packet) != len)
34  {
36  }
37 
38  if (len == 0)
39  {
40  // raw param なし
42  }
43 
44  data = CCP_get_raw_param_head(packet);
45  if (data[0] != first_data)
46  {
48  }
49 
51 }
52 
53 #pragma section
コマンド定義
@ Cmd_CODE_NOP
@ CCP_EXEC_SUCCESS
@ CCP_EXEC_ILLEGAL_CONTEXT
コマンド実行時のその他のエラー
const uint8_t * CCP_get_param_head(const CommonCmdPacket *packet)
先頭のパラメタのポインタを取得
PH_ACK CCP_register_tlc_asap(cycle_t ti, TLCD_ID tlcd_id, CMD_CODE cmd_id, const uint8_t *param, uint16_t len)
Timeline command を登録 (ASAP 版)
CCP_CmdRet CCP_make_cmd_ret_without_err_code(CCP_EXEC_STS exec_sts)
コマンド返り値である CCP_CmdRet を作成(エラーコード不使用版)
const uint8_t * CCP_get_raw_param_head(const CommonCmdPacket *packet)
CCP packet から,RAW コマンド引数の先頭ポインタを取得する
uint16_t CCP_get_raw_param_len(const CommonCmdPacket *packet)
CCP packet から,RAW コマンド引数の長さを返す
#define CCP_get_param_from_packet(packet, n, type)
CCP packet から,n番目のコマンド引数を取得する
uint32_t cycle_t
Definition: obc_time.h:10
PH_ACK
@ PH_ACK_TLC_SUCCESS
TL 登録に成功した
コマンド返り値
Space Packet (コマンド用)
CCP_CmdRet Cmd_TEST_CCP_GET_RAW_PARAM_INFO(const CommonCmdPacket *packet)
Definition: test_ccp_util.c:20
CCP_CmdRet Cmd_TEST_CCP_REGISTER_TLC_ASAP(const CommonCmdPacket *packet)
Definition: test_ccp_util.c:11
CCP 汎用 utility テスト用 app