Skip to content

feat(bcl): return BCT_ACK from BCL_tool_register_* functions#475

Open
Toshihiro Suzuki (suzuki-toshihir0) wants to merge 2 commits intomainfrom
feature/bcl-return-bct-ack
Open

feat(bcl): return BCT_ACK from BCL_tool_register_* functions#475
Toshihiro Suzuki (suzuki-toshihir0) wants to merge 2 commits intomainfrom
feature/bcl-return-bct-ack

Conversation

@suzuki-toshihir0
Copy link
Contributor

@suzuki-toshihir0 Toshihiro Suzuki (suzuki-toshihir0) commented Feb 19, 2026

Summary

  • BCL_tool_register_cmd などの BCL 公開 API 7関数の戻り値を voidBCT_ACK に変更した。
  • BCT_register_cmd の登録失敗(BCT_INVALID_CMD_NO)をユーザーが BCL_tool_register_hoge のような関数で検知できるようになる。

Background

  • BCT_register_cmd はコマンド登録数が BCT_MAX_CMD_NUM を超えると BCT_INVALID_CMD_NO を返してサイレントに失敗する。従来の BCL 公開 API はすべて void 型だったため、この失敗に気づく手段がなかった。
  • なので、Task Listなどを書くときに BCT_MAX_CMD_NUM を超える数のコマンドを詰めてしまっても気づきにくい。

Design Notes

  • 後方互換性: C では戻り値の無視は合法なため、既存の BCL_tool_register_cmd(ti, id); という呼び出しはそのまま動作する
  • EL recordはユーザー任せにする: エラー検知後の EL 記録はユーザーが自分のユーザー定義グループを使って行う

🤖 Generated with Claude Code

BCL公開APIの戻り値をvoidからBCT_ACKに変更し、BCT_register_cmdの
登録失敗(BCT_INVALID_CMD_NO)をユーザーが検知できるようにする。

BCT_MAX_CMD_NUMを超えた場合のサイレントな失敗を、BC_load_xxx内で
戻り値を確認することで把握できるようになる。ELへの記録はユーザー側で
行う設計とし、EL_CORE_GROUPのenum番号には一切変更を加えない。

C言語では戻り値の無視は合法なため、既存のBC_load_xxx実装に対する
後方互換性は保たれる。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Block Command Loader (BCL) public API to propagate error status from underlying BCT registration functions. Previously, all 7 BCL public API functions (BCL_tool_register_cmd, BCL_tool_register_cmd_to_other_obc, BCL_tool_register_rotate, BCL_tool_register_combine, BCL_tool_register_limit_combine, BCL_tool_register_deploy, BCL_tool_register_app) had void return types, making it impossible for callers to detect when BCT_register_cmd fails (e.g., when the command table is full and returns BCT_INVALID_CMD_NO). Now these functions return BCT_ACK to enable error detection while maintaining backward compatibility.

Changes:

  • Changed return type from void to BCT_ACK for 7 BCL public API functions
  • Updated 3 internal static helper functions to return BCT_ACK
  • Modified all function implementations to capture and return the BCT_ACK status from BCT_register_cmd

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tlm_cmd/block_command_loader.h Updated function declarations and documentation to return BCT_ACK instead of void for 7 public API functions
tlm_cmd/block_command_loader.c Modified implementations to capture BCT_ACK from underlying calls, updated internal static function signatures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

-Wdeclaration-after-statement (clang Werror) に対応するため、
#ifブロック内のprepare_param呼び出しより後に置いていたBCT_ACK ack宣言を
各関数の先頭に移動する。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants