Implement tracking commands in libnutclient#673
Implement tracking commands in libnutclient#673aquette merged 2 commits intonetworkupstools:masterfrom
Conversation
There was a problem hiding this comment.
Beside from my comments, I'd like to see evidences that you tested the following:
- older upsd with TRACKING feature not available
- newer upsd with TRACKING feature enabled / not enabled
Documentation:
- docs/man/nutclient* needs update
- It could be good to also complete a bit the code example in docs/new-clients.txt -> High level library: libnutclient, to also illustrate the use of the new async / tracking methods.
thx
clients/nutclient.cpp
Outdated
There was a problem hiding this comment.
As per https://github.com/networkupstools/nut/blob/master/docs/net-protocol.txt#L209
Result can also be:
- ERR UNKNOWN (command execution failed with unknown error)
- ERR INVALID-ARGUMENT (command execution failed due to missing or invalid argument)
beside from the ERR FAILED (command execution failed)
clients/nutclient.h
Outdated
There was a problem hiding this comment.
not sure what you wanna mean by "redeem", but should be reworded.
Also async ID is to be worded "tracking ID", as elsewhere.
|
part of #656 |
|
Updated pull request, tested with sample program on both old and new upsd with no issues. |
aa361e2 to
67b2305
Compare
Signed-off-by: Jean-Baptiste Boric <[email protected]>
67b2305 to
9b0a799
Compare
Signed-off-by: Jean-Baptiste Boric <[email protected]>
| using namespace std; | ||
|
|
||
| int main(int argc, char** argv) | ||
| int main(int argc, char **argv) |
There was a problem hiding this comment.
@boricj nitpicking somehow, but:
a comment here in the code would be helpful to depict that
// argv[1] is the mandatory NUT device name (@localhost), used to list variables from
// argv[2] is an optional command. When provided, it will be executed and possibly with status tracking enabled
I'll merge the PR and do it myself to avoid another 1d delay, so FYI and for future PR ;)
* Implement tracking commands in libnutclient Signed-off-by: Jean-Baptiste Boric <[email protected]> * Add TrackingResult::INVALID_ARGUMENT Signed-off-by: Jean-Baptiste Boric <[email protected]>
Extends libnutclient's C++ API to support tracking commands.