CyUSB.Net HID ReadInput problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

I try to read data from HID device using ReadInput in timer (50ms, 300ms, ...) like this:

   

   

System::Void read_timer_Tick(System::Object^  sender, System::EventArgs^  e)

   

{

   

if (hidDevice == nullptr) return;

   

if (hidDevice->ReadInput())

   

//if (hidDevice->GetInput(hidDevice->Inputs->ID))

   

{

   
    }   
   
    }   
   
        
   
    The problem is that ReadInput causes abnormal slow down of the application: window resizing, text entering to textbox and so on. CPU usage (including kernel) is less than 5 percents. ReadInput returns data buffer, but is very slow.   
   
    Another problem is that GetInput does not return any data (returns with false).   
   
    Used suite version is CySuiteUSB_3_4_7_B204.exe.   
   
    Thanks for any help.   
   
        
0 Likes
3 Replies
Anonymous
Not applicable

 Hi,

   

    Which endpoints are you interacting with Getinput and Readinput APIs ?. ReadInput will hang indefinitely if the device does not have an Input report ready to be read.

   

Thanks

   

Prajith

0 Likes
Anonymous
Not applicable

I simply call function of CyHidDevice, but most likely it was implemented assuming that it will be used in some other way, but at this moment it is unclear how it should be used.

0 Likes
Anonymous
Not applicable

 Hi,

   

   

Using ReadInput( ) you should be able to communicate with the non-Control endpoint. GetInput( ) API is for Control endpoit.

   

 

   

Thanks

   

Prajith

0 Likes