with the help of apnt195, i had modified the STM32 usb hid application program.
during compilation, it showing the following error
demo.c(33): error: #147: declaration is incompatible with "BYTE OutReport" (declared at line 20 of "demo.h") demo.c(56): warning: #167-D: argument of type "BYTE *" is incompatible with parameter of type "char *" demo.c(58): warning: #167-D: argument of type "BYTE *" is incompatible with parameter of type "char *"
Dear sir,
i want to send multiple byte(ex. 8/16/32 bytes) from STM32 development kit to PC application through USB.
for that i'm using USBHID on STM32 development side and HID_Client program on VC++ side.
pls suggest me what are the necessity chages i have to make on both host and client side. also i'm bit confused about USAGE_MIN and Usage_Max.
pls suggest me any sample examples.
i made the following changes, code compiled with error. in this device not detected. **************************************************** in Hiduser.c
BOOL HID_GetReport (void) {
/* ReportID = SetupPacket.wValue.WB.L; */ switch (SetupPacket.wValue.WB.H) { case HID_REPORT_INPUT: GetInReport(); EP0Buf[0] = InReport[0]; EP0Buf[1] = InReport[1]; break; case HID_REPORT_OUTPUT: return (FALSE); /* Not Supported */ case HID_REPORT_FEATURE: /* EP0Buf[] = ...; */ /* break; */ return (FALSE); /* Not Supported */ } return (TRUE); } **************************************************** #if USB_CONFIGURE_EVENT void USB_Configure_Event (void) {
if (USB_Configuration) { /* Check if USB is configured */ GetInReport(); USB_WriteEP(0x81, &InReport[0], sizeof(InReport)); } } **************************************************** in demo.c void GetInReport (void) { int x = 0, y= 0; x = ADC_ConvertedValue; InReport[1] = x & 0xff; InReport[0] = (ADC_ConvertedValue >> 0x08); **************************************************** In client side program
void CHIDClientDlg::OnInput() { // int n; int x,y; char buf[16];
x = InReport[0]; x = (x << 8); y = InReport[1]; x = x | y ;
// if (InValue == InReport[1]) return;
// if (z == x) return; // z = x; // InValue = InReport[1];
// for (n = 0; n < 8; n++) { // m_Input[n].SetCheck((InValue & (1 << n)) ? 1 : 0); // } // sprintf(buf, "%04d", InValue); sprintf(buf, "%05x",x);
m_In.SetWindowText(buf); }
expecting your kind reply.
with regards
S.Venugopal
in the previous post, i typed it has "with error".
sorry it is "without error"