'\" t
.\" Title: libnutclient_variables
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 06/21/2026
.\" Manual: NUT Manual
.\" Source: Network UPS Tools 2.8.5
.\" Language: English
.\"
.TH "LIBNUTCLIENT_VARIABL" "3" "06/21/2026" "Network UPS Tools 2\&.8\&.5" "NUT Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "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
.SH "SYNOPSIS"
.sp
.nf
#include
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);
.fi
.SH "DESCRIPTION"
.sp
These functions allow to manage variables of devices\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_get_device_variables()\fR
function retrieves the list of variables names for a device\&.
.sp
The returned strarr must be freed by
\fIstrarr_free\fR
(see
\fBlibnutclient_general\fR(3))\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_get_device_rw_variables\fR
function retrieves the list of read\-write variables names for a device\&.
.sp
The returned strarr must be freed by
\fIstrarr_free\fR
(see
\fBlibnutclient_general\fR(3))\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_has_device_variable\fR
function tests if the specified variable is supported by the device\&.
.sp
Return
\fI1\fR
if supported and
\fI0\fR
if not\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_get_device_variable_description\fR
function retrieves the variable description, if any\&.
.sp
The returned string must be freed by
\fBfree\fR(3)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_get_device_variable_values\fR
returns variable values (generally only one)\&.
.sp
The returned strarr must be freed by
\fIstrarr_free\fR
(see
\fBlibnutclient_general\fR(3))\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_set_device_variable_value\fR
intends to set the value of the specified variable\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBnutclient_set_device_variable_values\fR
intends to set multiple values of the specified variable\&.
.RE
.sp
Common arguments:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIdev\fR
is the device name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIvar\fR
is the variable name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIvalue\fR
is the variable value\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIvalues\fR
is the variable array of values\&.
.RE
.SH "SEE ALSO"
.sp
\fBlibnutclient\fR(3) \fBlibnutclient_devices\fR(3) \fBlibnutclient_general\fR(3)