Hello All!
I'm trying to write a software using SLABHIDDevice.dll to communicate with my PCB with MCU EFM32GG332F1024 of Silicon Laboratories. On MCU work firmware that waits for a frame (64 bytes, interrupt endpoint) from the host and sends another frame the host back!
When the program is started on the PC, my PCB is detected, all the string descriptors are correctly read, the HID is opened! All this is done by using SLIBHIDDevice.dll without errors!
However, when I try to send one frame to the device, it appears HID_DEVICE_TRANSFER_FAILED !
And when I try to take a frame - HID_DEVICE_INVALID_BUFFER_SIZE !
I read the SiLabs AN532.pdf. But I did not understand the reason for the first error, and also how I can set the correct buffer size for reception!
At me in the program buffers are set as usually:
#define HID_IN_REPORT_SIZE 64 #define HID_OUT_REPORT_SIZE 64 unsigned char IN_BUFF[HID_IN_REPORT_SIZE+1]; unsigned char OUT_BUFF[HID_OUT_REPORT_SIZE+1];
The program does the following:
... HidDevice_SetTimeouts(Device,150000,150000); HidDevice_FlushBuffers(Device); int STEP = 1024; while (STEP--) { ERRORS = HidDevice_SetOutputReport_Interrupt (Device, OUT_BUFF,64); // ... Here i check ERRORS ERRORS = HidDevice_GetInputReport_Interrupt (Device, IN_BUFF,64,1,&bytesReturned); // ... Here i check ERRORS } ...
Can someone tell me what's wrong? Are there working example with using SLABHIDDevice.dll?
Onic