Skip to content

Commit

Permalink
host_wasmtime: add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jan 12, 2024
1 parent f89562e commit 125cd91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions host_wasmtime/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ impl<T: WasiSensorView> wasi::sensor::sensor::HostDevice for T {
) -> Result<Result<Resource<wasi::sensor::sensor::Device>, wasi::sensor::sensor::DeviceError>>
{
trace!("opening a device {}", device_name);
// Note: We use structured names like "foo:bar", where "foo" is
// a device group and "bar" is a sensor in the group.
// This interpretation of names is specific to this host
// implementation (host_wasmtime), not meant to be a part of
// wasi-sensor specification.
let v: Vec<&str> = device_name.split(":").collect();
if v.len() != 2 {
return Ok(Err(wasi::sensor::sensor::DeviceError::NotFound));
Expand Down

0 comments on commit 125cd91

Please sign in to comment.