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


B.4.1 STInput Lifecycle Management

Function: STInput * st_input_new (const gchar *name, const gchar *description, STUnit unit, gdouble min, gdouble max, gdouble step, gdouble val, guint64 flags, GError **error)

Creates a sensor-side endpoint. Notify affinity defaults to the thread-default GMainContext at construction.

name

Stable identifier used in rules and on the wire (unique within the service).

description

Human-readable text for UIs and operators.

unit

Quantity kind (see STUnit Enumeration).

min

Inclusive lower bound for val.

max

Inclusive upper bound for val.

step

Resolution grid; off-step sets snap to this step.

val

Initial reading.

flags

Policy bits (see api-io-flags).

error

Optional GError out-parameter on failure.

Returns: A new floating STInput, or NULL with error set when metadata cannot be honored.

Function: STInput * st_input_dup (const STInput *self)

Deep-copies an input into a fresh object with independent lifetime.

self

Source input; must not be NULL.

Returns: Newly allocated STInput (constructor transfer).

Function: void st_input_set_notify_context (STInput *self, GMainContext *context)

Chooses the GMainContext that delivers property notifies. Off-thread setters coalesce notifies via idle.

self

The input.

context

Affinity context, or NULL for thread-default / global default.

Returns: Nothing.

Function: GMainContext * st_input_get_notify_context (STInput *self)

Reads the current notify affinity.

self

The input.

Returns: Borrowed GMainContext (do not free).


Next: STInput Properties and Notify, Up: STInput: The Sensor Abstraction   [Contents]