Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I am trying to talk to a weather info system which needs to receive some commands to answer. Can anyone help me to convert these two functions for mbed USBHost. At the moment i am fiddling around with the program USBHostShell_HID_talkactive_alpha from Sergio Collado. The system is recognized as class 00 and the VID and PID are returned correctly. The last output is:
Transfer EDaddres:00 Token:2 Len:0 State:5 Data out: ProcessDoneQueue 00 020C0000 Interrupt endpoint 81 00030000
I could initiate a transfer from the system if i could send some commands. But i did not succeed up to now and could need some help. Thanks.
void s_usb_msg( char msg1[1],char msg2[1],char msg3[1],char msg4[1],char msg5[1],char msg6[1],char msg7[1],char msg8[1] ) { char tbuf[1000]; tbuf[0] = msg1[0]; tbuf[1] = msg2[0]; tbuf[2] = msg3[0]; tbuf[3] = msg4[0]; tbuf[4] = msg5[0]; tbuf[5] = msg6[0]; tbuf[6] = msg7[0]; tbuf[7] = msg8[0]; ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x200, 0, tbuf, 8, 1000); } void read_usb_msg(char *buffer) { char tbuf[1000]; usb_interrupt_read(devh, 0x81, tbuf, 0x20, 1000); memcpy(buffer, tbuf, 0x20); }