Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hid_enumerate prints usage of all devices #628

Open
Mola19 opened this issue Sep 26, 2023 · 2 comments
Open

hid_enumerate prints usage of all devices #628

Mola19 opened this issue Sep 26, 2023 · 2 comments
Labels
Windows Related to Windows backend

Comments

@Mola19
Copy link

Mola19 commented Sep 26, 2023

This might be user error by me, or maybe it is already solved, but i couldn't find a similar issue.

My code is

#include <iostream>

#include "hidapi.h"

int main()
{
    hid_enumerate(0, 0);
    std::cout << "---END---" << std::endl;
}

Output:

  ---END---
6
6
1
6
1
80
1
1
1
1
92
6
1
6
2
2
1
6
E
1
1
1
6
A1
80
5
80
1
1
1
A1
1
1

The numbers seem to be the usage for each hid device.

The weird thing is that they are printed after the code ends.

Whether hid_init(), hid_exit() or hid_free_enumeration() get called doesn't influence this issue.

OS: Windows 10
Compiler: MSVC C++ 17
HIDAPI version: I reproduced this on 0.14.0, 0.11.0 and 0.9.0

@Youw
Copy link
Member

Youw commented Sep 26, 2023

very interesting
winapi backend doesn't even have the printf anywhere
is the behavior changes if you you printf instead of cout?

@Mola19
Copy link
Author

Mola19 commented Sep 26, 2023

No, it doesn't seem to change anything, neither does removing it

@mcuee mcuee added the Windows Related to Windows backend label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Related to Windows backend
Projects
None yet
Development

No branches or pull requests

3 participants