Skip to content

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

@potto216

Description

@potto216

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions