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

Device::HID->new() fails on macOS #4

Open
jhgorse opened this issue May 30, 2020 · 3 comments
Open

Device::HID->new() fails on macOS #4

jhgorse opened this issue May 30, 2020 · 3 comments

Comments

@jhgorse
Copy link

jhgorse commented May 30, 2020

Greetings,

Device::HID is failing to get the usb device when Device::USB appears to get it.

bash$ perl irrad_hid_probe.pl
Failed to hid_open at irrad_hid_probe.pl line 12.
No such device!

use Device::HID;
my $dev = Device::HID->new(vendor => 0x10c4, product => 0x63cd) or die "No such device!\n";

vs

use Device::USB;
my $usb = Device::USB->new();
...
my $dev = $usb->find_device( 0x10c4, 0x63cd );
$dev->open();
print "Manufactured by ", $dev->manufacturer(), "\n",
       " Product: ", $dev->product(), "\n";
...

How can I debug this?

@a3f
Copy link
Member

a3f commented May 30, 2020

So Device::USB works, but Device::HID doesn't? The hidapi README contains short C example code for reading manufacturer string. Please compile and try that to make sure that it's fine on the C side.

@jhgorse
Copy link
Author

jhgorse commented May 30, 2020

The C code works.

@a3f
Copy link
Member

a3f commented Jun 17, 2020

Had no time to look deeper into this. You couls start by implementing hid_error. It returns a wide character string, so some conversion is necessary. This should give you an idea about what fails where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants