Imported Upstream version 2.7.1
This commit is contained in:
parent
a1fa151fc7
commit
0121794af9
451 changed files with 41339 additions and 10887 deletions
|
|
@ -18,24 +18,61 @@ C / C++
|
|||
Client access library
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The upsclient library can be linked into other programs to give access
|
||||
to upsd and UPS status information. Both static and shared versions are provided.
|
||||
`libupsclient` and `libnutclient` libraries can be linked into other programs
|
||||
to give access to upsd and UPS status information.
|
||||
Both static and shared versions are provided.
|
||||
|
||||
These library files and associated header files are not installed by
|
||||
default. You must `./configure --with-lib` to enable building and
|
||||
installing these files. The libraries can then be built and installed
|
||||
with `make` and `make install` as usual. This must be done before
|
||||
building other (non-NUT) programs which depend on them.
|
||||
|
||||
Low-level library: libupsclient
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
`libupsclient` provides a low-level interface to directly dialog with upsd.
|
||||
It is a wrapper around the NUT network protocol.
|
||||
|
||||
For more information, refer to the linkman:upsclient[3],
|
||||
manual page and the various link:../man/index.html#devclient[upscli_*(3)]
|
||||
functions documentation referenced in the same file.
|
||||
|
||||
Clients like upsc are provided as examples of how to retrieve data using the
|
||||
upsclient functions.
|
||||
link:http://www.networkupstools.org/projects.html[Other programs] not included
|
||||
in this package may also use this library, such as wmnut.
|
||||
|
||||
This library file and the associated header files are not installed by
|
||||
default. You must `./configure --with-lib` to enable building and
|
||||
installing these files. The libraries can then be built and installed
|
||||
with `make` and `make install` as usual. This must be done before
|
||||
building other (non-NUT) programs which depend on them.
|
||||
High level library: libnutclient
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For more information, refer to the linkman:upsclient[3],
|
||||
manual page and the various link:../man/index.html#devclient[upscli_*(3)]
|
||||
functions documentation referenced in the same file.
|
||||
`libnutclient` provides a high-level interface representing devices, variables
|
||||
and commands with an object-oriented API in C++ and C.
|
||||
|
||||
For more information, refer to the linkman:libnutclient[3] manual page.
|
||||
|
||||
#include <iostream>
|
||||
#include <nutclient.h>
|
||||
using namespace nut;
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Connection
|
||||
Client* client = new TcpClient("localhost", 3493);
|
||||
Device mydev = client->getDevice("myups");
|
||||
cout << mydev.getDescription() << endl;
|
||||
Variable var = mydev.getVariable("device.model");
|
||||
cout << var.getValue()[0] << endl;
|
||||
}
|
||||
catch(NutException& ex)
|
||||
{
|
||||
cerr << "Unexpected problem : " << ex.str() << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Configuration helpers
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
@ -114,10 +151,6 @@ multiple UPS units).
|
|||
Java
|
||||
----
|
||||
|
||||
This chapter presents the new Java support for NUT, called jNut.
|
||||
The NUT java support have been externalized.
|
||||
It is available at https://github.com/networkupstools/jnut
|
||||
|
||||
include::../scripts/java/README[]
|
||||
|
||||
include::../scripts/java/jNut/README[]
|
||||
|
||||
include::../scripts/java/jNutList/README[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue