Parameters

Reading and writing server configuration parameters; the Key naming convention distinguishes global parameters from driver-board parameters.

ti_set_parameter

Set a parameter.

Parameter keys are the full parameter names from the registry (case-sensitive, UTF-8 encoded); global / device scope is defined by the parameter registry.

  • client: Client handle.
  • key: Parameter name (case-sensitive, UTF-8 encoded), supports hierarchical naming.
  • value: Parameter value (string format; the server is responsible for type parsing).
  • Returns: TI_OK — set successfully
  • Returns: TI_ERR_NOT_CONNECTED — not connected
  • Returns: TI_ERR_INVALID_ARG — client / key / value is NULL
  • Returns: TI_ERR_SERVER — the server rejected the parameter

Example:

// Global parameter
ti_set_parameter(cli, "PRINT_SPEED_TIMER", "100");
// Device parameter
ti_set_parameter(cli, "SYSTEM_DATETIME", "2026-08-18 10:00:00");

See also: ti_get_parameter()

ti_get_parameter

Get a parameter (single call).

The “two-call” pattern is no longer needed — the caller pre-allocates a buffer of at least TI_MAX_PARAM_VALUE bytes and passes its capacity in buf_size; one call retrieves the parameter value.

Global / device scope is defined by the parameter registry (same as set).

  • client (input): Client handle.

  • key (input): Parameter name (UTF-8 encoded), supports hierarchical naming.

  • value_buf (output): Output buffer (pre-allocated by the caller).

  • buf_size (input): Capacity of value_buf in bytes. Recommended to be ≥ TI_MAX_PARAM_VALUE.

  • Returns: TI_OK — retrieved successfully

  • Returns: TI_ERR_NOT_CONNECTED — not connected

  • Returns: TI_ERR_INVALID_ARG — client / key / value_buf is NULL

  • Returns: TI_ERR_BUFFER_TOO_SMALL — buf_size is insufficient; the parameter value was truncated

  • Returns: TI_ERR_SERVER — the server does not have this parameter

Example:

char buf[TI_MAX_PARAM_VALUE];
int rc = ti_get_parameter(cli, "PRINT_SPEED_TIMER", buf, sizeof(buf));
if (rc == TI_OK) printf("PRINT_SPEED_TIMER = %s\n", buf);

See also: ti_set_parameter() See also: TI_MAX_PARAM_VALUE