Skip to main content

Sensor Functions

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

enable_accel_stream

Stream Accel. Streams accelerometer (and temperature) data to the host at the given rate.

Wire command: i\s\o

ArgWire type
stream_rate_msdecS32

Returns: none (Ok/Err only)

dev.io.sensors.enable_accel_stream(stream_rate_ms: int) -> Result
ow_status ow_io_sensors_enable_accel_stream(ow_device* dev, int32_t stream_rate_ms);
dev.io().sensors().enable_accel_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_accel_stream(stream_rate_ms) # 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.

accel (text)

Accelerometer Data

Payload fieldWire type
rangedecS32
xdecS32
ydecS32
zdecS32
temp_cdecS32
temp_fdecS32
is_movingbool