Open a USB HID Device
open_success = hid_open(VendorID,ProductID)
Open USB HID Device
This function open an USB HID Device using the VendorID and ProductID of the device connected to the host computer.
Do not forget close the device.
VendorID="04D8"; ProductID="900A"; VendorID=uint16(hex2dec(VendorID)); ProductID=uint16(hex2dec(ProductID)); init_success=hid_init(); if ( init_success < 0 ) then disp("unable to initialize the HIDAPI Library"); return else disp("HIDAPI Library initialized"); end open_success=hid_open(VendorID,ProductID); if ( open_success < 0 ) then disp("unable to open device"); return else disp("device open"); close_success=hid_close(); end exit_success=hid_exit(); if ( exit_success < 0 ) then disp("unable to free static data associated with HIDAPI Library"); return else disp("HIDAPI Library have been freed all of the static data associated"); end | ![]() | ![]() |