Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コマンド返り値が CCP_CmdRet に変わったことに付随する細かい改善 #418

Merged
merged 3 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Drivers/Super/driver_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,15 +1687,15 @@ CCP_CmdRet DS_conv_driver_err_to_ccp_cmd_ret(DS_DRIVER_ERR_CODE code)
case DS_DRIVER_ERR_CODE_ILLEGAL_CONTEXT:
case DS_DRIVER_ERR_CODE_UNKNOWN_ERR:
// 全てこれでいいのかは,要検討
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)code);
case DS_DRIVER_ERR_CODE_ILLEGAL_PARAMETER:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)code);
case DS_DRIVER_ERR_CODE_ILLEGAL_LENGTH:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_LENGTH);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_LENGTH, (uint32_t)code);
default:
// ここに来るのは以下
// DS_DRIVER_ERR_CODE_OK
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS);
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)code);
}
}

Expand All @@ -1705,19 +1705,19 @@ CCP_CmdRet DS_conv_cmd_err_to_ccp_cmd_ret(DS_CMD_ERR_CODE code)
switch (code)
{
case DS_CMD_ILLEGAL_CONTEXT:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)code);
case DS_CMD_ILLEGAL_PARAMETER:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)code);
case DS_CMD_ILLEGAL_LENGTH:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_LENGTH);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_LENGTH, (uint32_t)code);
default:
// ここに来るのは以下の3つ
// DS_CMD_OK
// DS_CMD_DRIVER_SUPER_ERR
// DS_CMD_UNKNOWN_ERR
// 下2つのエラーはDriver側の問題で,そちらでエラー情報を持つべき
// ここでは SUCCESSを返す
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS);
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)code);
}
}

Expand Down
6 changes: 3 additions & 3 deletions System/TimeManager/time_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ static CCP_CmdRet TMGR_conv_tmgr_ack_to_ccp_cmd_ret_(TMGR_ACK ack)
switch (ack)
{
case TMGR_ACK_OK:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS);
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack);
case TMGR_ACK_PARAM_ERR:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)ack);
default:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack);
}
}

Expand Down
16 changes: 8 additions & 8 deletions TlmCmd/block_command_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,30 +388,30 @@ CCP_CmdRet BCT_convert_bct_ack_to_ccp_cmd_ret(BCT_ACK ack)
switch (ack)
{
case BCT_SUCCESS:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS);
return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack);

// FIXME: これだめじゃん?
yngyu marked this conversation as resolved.
Show resolved Hide resolved
case BCT_INVALID_BLOCK_NO:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)ack);

case BCT_INVALID_CMD_NO:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_CMD_NOT_DEFINED);
return CCP_make_cmd_ret(CCP_EXEC_CMD_NOT_DEFINED, (uint32_t)ack);

case BCT_DEFECTIVE_BLOCK:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack);

case BCT_CMD_TOO_LONG:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)ack);

case BCT_BC_FULL:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack);

case BCT_ZERO_PERIOD:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER);
return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, (uint32_t)ack);

// FIXME: これだめじゃん?
default:
return CCP_make_cmd_ret_without_err_code(CCP_EXEC_UNKNOWN);
return CCP_make_cmd_ret(CCP_EXEC_UNKNOWN, (uint32_t)ack);
}
}

Expand Down