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

SYNOPSIS

Note
Two NUT websites

This version of the page reflects NUT release v2.8.0 with codebase commited ff16dabca at 2022-04-04T11:04:28+00:00

Options, features and capabilities in current development (and future releases) are detailed on the main site and may differ from ones described here.

#include <nutclient.h>
typedef void* NUTCLIENT_t;
typedef char** strarr;
strarr nutclient_get_device_commands(
        NUTCLIENT_t client,
        const char* dev);
int nutclient_has_device_command(
        NUTCLIENT_t client,
        const char* dev, const char* cmd);
char* nutclient_get_device_command_description(
        NUTCLIENT_t client,
        const char* dev, const char* cmd);
void nutclient_execute_device_command(
        NUTCLIENT_t client,
        const char* dev, const char* cmd,
        const char* param="");

DESCRIPTION

These functions allow to manage instant commands of devices.

  • The nutclient_get_device_commands() function retrieves the list of command names for a device.

    The returned strarr must be freed by strarr_free.

  • The nutclient_has_device_command function tests if the specified command is supported by the device.

    Return 1 is supported and 0 if not.

  • The nutclient_get_device_command_description function retrieves the command description, if any.

    The returned string must be freed.

  • The nutclient_execute_device_command intends to execute the instant command, with an optional parameter.

Common arguments:

  • dev is the device name.

  • cmd is the instant command name.

SEE ALSO