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

host_wasmtime: support multiple sensor devices per backend #31

Merged
merged 3 commits into from
Dec 26, 2023

Conversation

yamt
Copy link
Collaborator

@yamt yamt commented Dec 21, 2023

No description provided.

@@ -211,7 +211,7 @@ exports_wasi_sensor_interface_main()

fprintf(stderr, "C guest started\n");

const char *sensor = "dummy";
const char *sensor = "dummy:dummy";
Copy link
Collaborator

Choose a reason for hiding this comment

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

You mean we can specify
dummy:image
dummy:depth
dummy:imu

if we create dummy image device, dummy depth device, dummy imu device ?

Copy link
Collaborator

@ayakoakasaka ayakoakasaka Dec 21, 2023

Choose a reason for hiding this comment

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

Do you think it makes sense ?

nokhwa:/dev/video0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You mean we can specify dummy:image dummy:depth dummy:imu

the dummy device ignores the latter part for now.

if we create dummy image device, dummy depth device, dummy imu device ?

it's possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you think it makes sense ?

nokhwa:/dev/video0

sort of. except that /dev/video0 seems like a very linux specific identifier.

Copy link
Collaborator

Choose a reason for hiding this comment

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

understood. I agree as the spec.

_ => return Ok(Err(wasi::sensor::sensor::DeviceError::NotFound)),
let v: Vec<&str> = device_name.split(":").collect();
if v.len() != 2 {
return Ok(Err(wasi::sensor::sensor::DeviceError::NotFound));
Copy link
Collaborator

Choose a reason for hiding this comment

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

"aaa:bbb" would be mandatory ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in this particular implementation, yes.
in the wasi-sensor api, no.

@yamt yamt merged commit 19aa6ac into midokura:main Dec 26, 2023
3 checks passed
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