I would like to automate my VirtualHere client. For that I need feedback if adding a device to a client worked or not. I wasn't able to find out if that is possible with the command line api (windows). Do I need to run the client as a service?
Thanks for your help.
You don't need to run it as a
You don't need to run it as a service.
Do this e.g for device at address "12345"
vhui64.exe -t "USE,123435"
Then call the command below and parse the output every second in a loop (with 5 sec timeout) until you find the line that contains that address 12345 and
(In-use by you)
vhui64.exe -t "LIST"
Thank for your help. How can
Thank for your help. How can I parse the output of the list command? As I am using the windows client it always starts a new window with the output data.
Actually you will need to
Actually you will need to write a simple pipe writer/reader to control the client using a programming language of your choice are parse it in that. See here https://www.virtualhere.com/client_api and the c++ example at the bottom
I fixed this in 2.9.2 of the
I fixed this in 2.9.2 of the client by adding redirection to a file which you can then parse for the output. See here for more information "A Windows batch file example" https://www.virtualhere.com/client_api
Thank you very much. This
Thank you very much. This helps a lot. I'd like to suggest another enhancement. Let's say I am starting the console application like this:
vhui64.exe -t "USE,123435"
. The simplest way to check if I am connected to the device would be to provide an exit code:0 -> Connected to device
1 -> Device is in use by another client
2 -> Device not found
...
What do you think?
I think that its a good idea
I think that its a good idea however it is not a synchronous process unfortunately so it may never return or return seconds later. Originally i thought about doing it this way but its not viable because everything is async in the program and server and its a complicated process when that command is issued. and it much simpler to poll the list command....