Skip to content

Conversation

@boricj
Copy link
Contributor

@boricj boricj commented Feb 26, 2019

Extends libnutclient's C++ API to support tracking commands.

Copy link
Member

@aquette aquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you wanna mean by "redeem", but should be reworded.
Also async ID is to be worded "tracking ID", as elsewhere.

@aquette
Copy link
Member

aquette commented Feb 28, 2019

part of #656

@boricj
Copy link
Contributor Author

boricj commented Mar 6, 2019

Updated pull request, tested with sample program on both old and new upsd with no issues.

@boricj boricj force-pushed the trackingcookie_libnutclient branch from aa361e2 to 67b2305 Compare March 6, 2019 12:43
Signed-off-by: Jean-Baptiste Boric <Jean-BaptisteBORIC@Eaton.com>
@boricj boricj force-pushed the trackingcookie_libnutclient branch from 67b2305 to 9b0a799 Compare March 8, 2019 14:18
Copy link
Member

@aquette aquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also handle "ERR INVALID-ARGUMENT (command execution failed due to missing or invalid argument)" beside from the generic Failure on "ERR FAILED"
Once fixed, I'll be able to merge.

Signed-off-by: Jean-Baptiste Boric <Jean-BaptisteBORIC@Eaton.com>
using namespace std;

int main(int argc, char** argv)
int main(int argc, char **argv)
Copy link
Member

@aquette aquette Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 ;)

@aquette aquette merged commit b637312 into networkupstools:master Mar 11, 2019
jimklimov pushed a commit to jimklimov/nut that referenced this pull request Apr 1, 2019
* Implement tracking commands in libnutclient

Signed-off-by: Jean-Baptiste Boric <Jean-BaptisteBORIC@Eaton.com>

* Add TrackingResult::INVALID_ARGUMENT

Signed-off-by: Jean-Baptiste Boric <Jean-BaptisteBORIC@Eaton.com>
@jimklimov jimklimov added this to the 2.8.0 milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants