Skip to main content

Sensor Functions

dev.io.sensors - wire path i\s - generated from fwMenuSensors.

enable_motion_stream

Stream Motion. Streams accelerometer and gyroscope data to the host at the given rate. 0 stops the stream.

Wire command: i\s\m

ArgWire type
stream_rate_msdecS32

Returns: none (Ok/Err only)

dev.io.sensors.enable_motion_stream(stream_rate_ms: int) -> Result
ow_status ow_io_sensors_enable_motion_stream(ow_device* dev, int32_t stream_rate_ms);
dev.io().sensors().enable_motion_stream(stream_rate_ms: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.io.sensors.enable_motion_stream(stream_rate_ms) # check dev.ok

enable_field_stream

Stream Field. Streams magnetometer data to the host at the given rate. 0 stops the stream.

Wire command: i\s\f

ArgWire type
stream_rate_msdecS32

Returns: none (Ok/Err only)

dev.io.sensors.enable_field_stream(stream_rate_ms: int) -> Result
ow_status ow_io_sensors_enable_field_stream(ow_device* dev, int32_t stream_rate_ms);
dev.io().sensors().enable_field_stream(stream_rate_ms: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.io.sensors.enable_field_stream(stream_rate_ms) # check dev.ok

enable_env_stream

Stream Env. Streams temperature, humidity and ambient light to the host. This stream is change-driven: the rate is a heartbeat floor, so samples can arrive faster when readings move. 0 stops the stream.

Wire command: i\s\e

ArgWire type
stream_rate_msdecS32

Returns: none (Ok/Err only)

dev.io.sensors.enable_env_stream(stream_rate_ms: int) -> Result
ow_status ow_io_sensors_enable_env_stream(ow_device* dev, int32_t stream_rate_ms);
dev.io().sensors().enable_env_stream(stream_rate_ms: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.io.sensors.enable_env_stream(stream_rate_ms) # check dev.ok

enable_orientation_stream

Stream Orientation. Streams fused roll, pitch, yaw and heading to the host at the given rate. 0 stops the stream.

Wire command: i\s\r

ArgWire type
stream_rate_msdecS32

Returns: none (Ok/Err only)

dev.io.sensors.enable_orientation_stream(stream_rate_ms: int) -> Result
ow_status ow_io_sensors_enable_orientation_stream(ow_device* dev, int32_t stream_rate_ms);
dev.io().sensors().enable_orientation_stream(stream_rate_ms: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.io.sensors.enable_orientation_stream(stream_rate_ms) # check dev.ok

get_sensors

Get Sensors. Prints the most recent sample from each of the four sensor groups.

Wire command: i\s\g

Returns: none (Ok/Err only)

dev.io.sensors.get_sensors() -> Result
ow_status ow_io_sensors_get_sensors(ow_device* dev);
dev.io().sensors().get_sensors() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.io.sensors.get_sensors() # check dev.ok

Events

Spontaneous frames this menu emits (not command responses). Text events arrive as [*<id> ...] frames (Python: Transport.events; C: ow_poll_text_event; Rust: poll_event -> Event::Text); binary events use the binary API below. The on-device rthon binding does not receive event streams in v1.

motion (text)

Accelerometer and gyroscope data

Payload fieldWire type
ax_mgdecS32
ay_mgdecS32
az_mgdecS32
gx_ddpsdecS32
gy_ddpsdecS32
gz_ddpsdecS32

field (text)

Magnetometer data

Payload fieldWire type
mx_dutdecS32
my_dutdecS32
mz_dutdecS32
magnitude_dutdecS32
heading_cdegdecS32

env (text)

Temperature, humidity and ambient light

Payload fieldWire type
temp_ccdecS32
rh_cpctdecS32
lux_cluxdecU32

orientation (text)

Fused roll, pitch, yaw and heading

Payload fieldWire type
roll_cdegdecS32
pitch_cdegdecS32
yaw_cdegdecS32
heading_cdegdecS32
flagsdecS32