Previous: , Up: STInput: The Sensor Abstraction   [Contents]


B.4.4 Range and Value Control

Function: gdouble st_input_get_val (const STInput *self)

Reads the current value.

self

The input.

Returns: Current reading.

Function: gboolean st_input_set_val (STInput *self, gdouble val, GError **error)

Publishes a new reading. Off-step values snap to step (warning logged). After rounding, values outside min/max become ST_ERROR_INVALID_VALUE.

self

The input.

val

Desired reading.

error

Filled on hard failure.

Returns: TRUE if accepted (possibly after snapping).

Function: gdouble st_input_get_min (const STInput *self)

Reads the lower bound.

self

The input.

Returns: Current minimum.

Function: gboolean st_input_set_min (STInput *self, gdouble min, GError **error)

Sets the lower bound; may re-grid related fields for consistency.

self

The input.

min

New minimum.

error

Filled on failure.

Returns: TRUE on success.

Function: gdouble st_input_get_max (const STInput *self)

Reads the upper bound.

self

The input.

Returns: Current maximum.

Function: gboolean st_input_set_max (STInput *self, gdouble max, GError **error)

Sets the upper bound; may re-grid related fields for consistency.

self

The input.

max

New maximum.

error

Filled on failure.

Returns: TRUE on success.

Function: gdouble st_input_get_step (const STInput *self)

Reads the resolution step.

self

The input.

Returns: Current step.

Function: gboolean st_input_set_step (STInput *self, gdouble step, GError **error)

Changes resolution and re-grids min, max, and the current value.

self

The input.

step

New step size.

error

Filled on failure.

Returns: TRUE on success.

Function: guint64 st_input_get_flags (const STInput *self)

Reads the policy bitfield.

self

The input.

Returns: Current flags.

Function: gboolean st_input_set_flags (STInput *self, guint64 flags, GError **error)

Replaces the entire flag bitfield and notifies when it changes.

self

The input.

flags

New bitfield.

error

Filled on failure.

Returns: TRUE on success.


Previous: STInput Metadata Accessors, Up: STInput: The Sensor Abstraction   [Contents]