---
name: "nutclient_set_device_variable_value"
section: "3"
platform: "linux"
package: "libnutclient-dev"
version: "2.8.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libnutclient_variables"
---

# nutclient\_set\_device\_variable\_value(3)

Variable related functions in Network UPS Tools high-level client access library

Part of [libnutclient\_variables(3)](/libnutclient_variables/3.md).

## NAME

libnutclient\_variables, nutclient\_get\_device\_variables, nutclient\_get\_device\_rw\_variables, nutclient\_has\_device\_variable, nutclient\_get\_device\_variable\_description, nutclient\_get\_device\_variable\_values, nutclient\_set\_device\_variable\_value, nutclient\_set\_device\_variable\_values - Variable related functions in Network UPS Tools high-level client access library

## SYNOPSIS

```
#include <nutclient.h>
```

```
typedef void* NUTCLIENT_t;
```

```
typedef char** strarr;
```

```
strarr nutclient_get_device_variables(NUTCLIENT_t client,
        const char* dev);
```

```
strarr nutclient_get_device_rw_variables(NUTCLIENT_t client,
        const char* dev);
```

```
int nutclient_has_device_variable(NUTCLIENT_t client,
        const char* dev, const char* var);
```

```
char* nutclient_get_device_variable_description(NUTCLIENT_t client,
        const char* dev, const char* var);
```

```
strarr nutclient_get_device_variable_values(NUTCLIENT_t client,
        const char* dev, const char* var);
```

```
void nutclient_set_device_variable_value(NUTCLIENT_t client,
        const char* dev, const char* var, const char* value);
```

```
void nutclient_set_device_variable_values(NUTCLIENT_t client,
        const char* dev, const char* var, const strarr values);
```

## DESCRIPTION

These functions allow to manage variables of devices.

The **nutclient\_get\_device\_variables()** function retrieves the list of variables names for a device. The returned strarr must be freed by *strarr\_free*.

The **nutclient\_get\_device\_rw\_variables** function retrieves the list of read-write variables names for a device. The returned strarr must be freed by *strarr\_free*.

The **nutclient\_has\_device\_variable** function tests if the specified variable is supported by the device. Return 1 is supported and 0 if not.

The **nutclient\_get\_device\_variable\_description** function retrieves the variable description, if any. The returned string must be freed.

The **nutclient\_get\_device\_variable\_values** returns variable values (generally only one). The returned strarr must be freed by *strarr\_free*.

The **nutclient\_set\_device\_variable\_value** intends to set the value of the specified variable.

The **nutclient\_set\_device\_variable\_values** intends to set multiple values of the specified variable.

Common arguments:

• *dev* is the device name.

• *var* is the variable name.

• *value* is the variable value.

• *values* is the variable array of values.

## SEE ALSO

[**libnutclient**(3)](/libnutclient/3.md) [**libnutclient\_devices**(3)](/libnutclient_devices/3.md) [**libnutclient\_general**(3)](/libnutclient_general/3.md)
