Skip to content

Commit

Permalink
additional files, little changes in example
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmaciejbednarski committed Aug 9, 2024
1 parent 71a253e commit 485605c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# UPS-Control C++ library
# UPS-Control library
![Example on Windows](./Screenshot.png)

## How does it work?

Expand All @@ -25,6 +26,9 @@ The library works with `libusb` (https://github.com/libusb/libusb), a cross-plat
| 13 | UPS Rating | No | |
| 105 | Nothing | Yes | Power off UPS in 1 minute <br> During and after the UPS shutdown, the UPS status can still be retrieved. |

## UPS Status
The UPS status is returned by the library as a raw string. You need to parse it to get individual values. See the C# example `/examples/windows/main.cs` to see how to do it (start reading at line 88).

## Time conversion in `test_ups_with_time`

For the `test_ups_with_time` function, you can set the duration of the UPS test in minutes. I tested how the length (`wLength`) changes, which represents minutes in the descriptor.
Expand Down
Binary file added Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Video.mp4
Binary file not shown.
2 changes: 2 additions & 0 deletions examples/windows/main.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compatible with the Mono C# JIT compiler

using System;
using System.Text;
using System.Runtime.InteropServices;
Expand Down

0 comments on commit 485605c

Please sign in to comment.