Skip to content

[protocol] Convert hello command and libhoth to use the new error#254

Open
esnguyen wants to merge 1 commit into
google:mainfrom
esnguyen:esnguyen/poc_hello_error
Open

[protocol] Convert hello command and libhoth to use the new error#254
esnguyen wants to merge 1 commit into
google:mainfrom
esnguyen:esnguyen/poc_hello_error

Conversation

@esnguyen
Copy link
Copy Markdown
Collaborator

As a way to centeralize the way we report error through different domains, we are using hello command as a poc. This should make a temporary libhoth exec to be non instrusive and allow for changes.

@esnguyen esnguyen force-pushed the esnguyen/poc_hello_error branch from cbf8a2f to 845fdcf Compare May 29, 2026 19:25
As a way to centeralize the way we report error through different
domains, we are using hello command as a poc. This should make a
temporary libhoth exec to be non instrusive and allow for changes.

Signed-off-by: Ellis Sarza-Nguyen <sarzanguyen@google.com>
@esnguyen esnguyen force-pushed the esnguyen/poc_hello_error branch from 845fdcf to c7be823 Compare May 29, 2026 19:30
@esnguyen esnguyen requested a review from stevenportley May 29, 2026 19:33
Comment thread protocol/status.h
@@ -57,28 +66,28 @@ enum hoth_host_space {
// Hoth error code: Low 16 bits of the 32-bit Base Error Code
// Firmware Error
enum hoth_fw_error_status {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume this is intended to replace the hoth_status in host_cmd.h?

One thing we should be careful of is that host commands can return one of two different types of errors:

  • Dauntless only supports the subset you have here, a u16
  • Earlgrey also supports a different type of error that u32 and provides a lot more context

We might want to reserve a 16bit prefix for these old Dauntless error codes, and add it onto the error code whenever we don't get the full u32. We can probably just change HTOOL_ERROR_HOST_COMMAND_START to do this since I don't see it used anywhere outside of libhoth

Comment thread protocol/host_cmd.c
// libhoth_hostcmd_exec_v2 is the new core implementation that returns a
// rich 64-bit libhoth_error. It should be used for all new commands and
// when migrating existing commands to the centralized status reporting system.
libhoth_error libhoth_hostcmd_exec_v2(struct libhoth_device* dev,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume the plan is to complete the migrate to this function and then to just rename everything back to libhoth_hostcm_exec? I don't think we have any consumers of this API outside of this repo so that should be safe.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants