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

Why does to_result() in libtock-rs/platform/src/command_return.rs return BADRVAL for a driver check? #446

Closed
potto216 opened this issue Jan 7, 2023 Discussed in #441 · 0 comments · Fixed by #448
Closed

Comments

@potto216
Copy link
Contributor

potto216 commented Jan 7, 2023

In the discussion this was determined to be a bug which I will submit a PR for. The details are:

Discussed in #441

Originally posted by potto216 December 14, 2022
When performing a driver check with Console, Alarm, etc .is_success() and .raw_values()
return correct values but I don't understand .to_result()'s meaning

The three methods are located in libtock-rs/apis/console/src/lib.rs

For example for Console

S::command(DRIVER_NUM, command::DRIVER_CHECK, 0, 0).is_success()

returns true

and

S::command(DRIVER_NUM, command::DRIVER_CHECK, 0, 0).raw_values()
returns
ReturnVariant(128), r1 = 0, r2 = 0, r3 = 0
where pub const SUCCESS: ReturnVariant = ReturnVariant(128);

But
S::command(DRIVER_NUM, command::DRIVER_CHECK, 0, 0).to_result()

returns
BADRVAL

Is this expected? I would think this is indicating an error.

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 a pull request may close this issue.

1 participant