'\" t .\" Title: libnutclient_commands .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 04/26/2022 .\" Manual: NUT Manual .\" Source: Network UPS Tools 2.8.0 .\" Language: English .\" .TH "LIBNUTCLIENT_COMMAND" "3" "04/26/2022" "Network UPS Tools 2\&.8\&.0" "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_commands, nutclient_get_device_commands, nutclient_has_device_command, nutclient_get_device_command_description, nutclient_execute_device_command \- Instant command related functions in Network UPS Tools high\-level client access library .SH "SYNOPSIS" .sp .nf #include .fi .sp .nf typedef void* NUTCLIENT_t; .fi .sp .nf typedef char** strarr; .fi .sp .nf strarr nutclient_get_device_commands( NUTCLIENT_t client, const char* dev); .fi .sp .nf int nutclient_has_device_command( NUTCLIENT_t client, const char* dev, const char* cmd); .fi .sp .nf char* nutclient_get_device_command_description( NUTCLIENT_t client, const char* dev, const char* cmd); .fi .sp .nf void nutclient_execute_device_command( NUTCLIENT_t client, const char* dev, const char* cmd, const char* param=""); .fi .SH "DESCRIPTION" .sp These functions allow to manage instant commands of devices\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The \fBnutclient_get_device_commands()\fR function retrieves the list of command names for a device\&. .sp The returned strarr must be freed by \fIstrarr_free\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The \fBnutclient_has_device_command\fR function tests if the specified command is supported by the device\&. .sp Return 1 is supported and 0 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_command_description\fR function retrieves the command description, if any\&. .sp The returned string must be freed\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The \fBnutclient_execute_device_command\fR intends to execute the instant command, with an optional parameter\&. .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 .\} \fIcmd\fR is the instant command name\&. .RE .SH "SEE ALSO" .sp \fBlibnutclient\fR(3) \fBlibnutclient_devices\fR(3) \fBlibnutclient_general\fR(3)