signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.47k stars 901 forks source link

hid_write return -1 on linux #451

Open lio800206 opened 4 years ago

lio800206 commented 4 years ago

Hi I am using the hidlib to make a project both on windows and linux

int res;
unsigned char buf[65];
buf[0] = 0x00;
buf[1] = COMMAND MODE; //0xcc
state->signature = SIGNATURE;
memcpy(buf+2, state, sizeof(STATE));
res = hid_write(handle, buf, 65);
if(res == -1)
{
    return -1;
}

when I try on windows everything is work,but on linux "res" return -1.

Youw commented 4 years ago

Please see #373