Send a Feature report to the device.
send_feature_success=hid_send_feature_report(txBuff,_sized)
Send a Feature report to the device.
clc n=5 txBuff=init_buff(n) for i=1:n txBuff=setBuffValue(txBuff,i,i) end txBuff=setBuffValue(txBuff,1,hex2dec("00")) VendorID="04D8"; ProductID="010B"; 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"); end nonblocking_success=hid_set_nonblocking(%t); if ( nonblocking_success < 0 ) then disp("unable to set nonblocking"); else disp("device have been set nonblocking"); end send_feature_success=hid_send_feature_report(txBuff,uint8(n)) if ( send_feature_success < 0 ) then disp("unable to send the feature report"); else disp("feature report sent"); end [rxBuff,get_feature_success]=hid_get_feature_report(uint8(n)); if ( get_feature_success < 0 ) then disp("unable to get the feature report"); else disp("feature report received"); disp(rxBuff); end close_success=hid_close(); if ( close_success < 0 ) then disp("unable to closed device"); else disp("device closed"); 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 | ![]() | ![]() |
HIDAPI Library initialized Device Open device have been set nonblocking feature report sent feature report received 0 0 241 0 0 device closed HIDAPI Library have been freed all of the static data associated | ![]() | ![]() |