<br>Peter,<br><br>here is the simple code im trying to execute:<br><br><br>#include<stdio.h><br>#include<stdlib.h><br>#include<string.h><br>#include<stdbool.h> // To define Have Bool!!<br>#include<hid.h><br>
<br><br>//#define VENDOR_ID_PICARD 0x0461<br>//#define PRODUCT_ID_FILTER 0x0050<br>#define INPUTREPORT_SIZE 500<br><br>#define ITEM_INPUT 0x81<br>#define ITEM_OUTPUT 0x01<br><br>#define dev_id { 0x0461, 0x0050 , NULL, NULL, 0 }<br>
<br>int main(int argc, char *argv[])<br>{<br> printf("Hello World!\n");<br> <br> HIDInterface* hid;<br> hid_return ret;<br> unsigned short vendor_id = 0x0461;<br> unsigned short product_id = 0x0050;<br>
<br> HIDInterfaceMatcher matcher = { vendor_id, product_id , NULL, NULL, 0 };<br> <br> hid_set_debug(HID_DEBUG_ALL);<br> hid_set_debug_stream(stderr);<br> <br> ret = hid_init();<br> <br> if (ret != HID_RET_SUCCESS)<br>
{<br> fprintf(stderr, "hid_init failed with return code %d\n", ret);<br> return 1;<br> }<br> <br> hid = hid_new_HIDInterface();<br> if(hid == 0)<br> {<br> fprintf(stderr, "hid_new_HIDInterface! Out of memory?\n");<br>
}<br> <br> <br> ret = hid_force_open(hid, 0, &matcher, 3);<br> if (ret != HID_RET_SUCCESS)<br> {<br> fprintf(stderr, "hid_force_open failed with return code %d\n", ret);<br> return 1;<br>
}<br> <br> <br> ret = hid_write_identification(stdout, hid);<br> if (ret != HID_RET_SUCCESS)<br> {<br> fprintf(stderr, "hid_write_identification failed with return code %d\n", ret);<br>
return 1;<br> }<br> <br> ret = hid_dump_tree(stdout, hid);<br> if (ret != HID_RET_SUCCESS)<br> {<br> fprintf(stderr, "hid_dump_tree failed with return code %d\n", ret);<br> return 1;<br>
}<br> <br> <br> <br> return 0;<br>}<br><br><br>Do you have any idea about the origin of the error?<br><br><br>cheers,<br>Mohamed.<br>