Hey,
Im trying to forward data between the PC and the device thats connected to the usb host, using the teensy as a kind of proxy between it.
Example: The teensy receives a set report request from the PC. How would I forward the request to the device that is connected to the usb host?
I did not modify the enpoint0_receive function.
I would appreciate your help!
Im trying to forward data between the PC and the device thats connected to the usb host, using the teensy as a kind of proxy between it.
Example: The teensy receives a set report request from the PC. How would I forward the request to the device that is connected to the usb host?
C:
static void endpoint0_setup(uint64_t setupdata)
{
setup_t setup;
uint32_t endpoint, dir, ctrl;
const usb_descriptor_list_t* list;
setup.bothwords = setupdata;
switch (setup.wRequestAndType) {
// SET_REPORT
case 0x0921:
// Forward SET_REPORT to the device that is connected to the USB host
if (setup.wLength <= sizeof(endpoint0_buffer)) {
endpoint0_setupdata.bothwords = setup.bothwords;
endpoint0_receive(endpoint0_buffer, setup.wLength, 1); // Receive data from PC
return;
}
break;
}
USB1_ENDPTCTRL0 = 0x000010001; // stall
}
I did not modify the enpoint0_receive function.
I would appreciate your help!