feat(bcl): return BCT_ACK from BCL_tool_register_* functions#475
feat(bcl): return BCT_ACK from BCL_tool_register_* functions#475Toshihiro Suzuki (suzuki-toshihir0) wants to merge 2 commits intomainfrom
Conversation
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>
There was a problem hiding this comment.
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
voidtoBCT_ACKfor 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_ACKstatus fromBCT_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>
Summary
BCL_tool_register_cmdなどの BCL 公開 API 7関数の戻り値をvoid→BCT_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型だったため、この失敗に気づく手段がなかった。BCT_MAX_CMD_NUMを超える数のコマンドを詰めてしまっても気づきにくい。Design Notes
BCL_tool_register_cmd(ti, id);という呼び出しはそのまま動作する🤖 Generated with Claude Code