You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote an application loosely based on the webusb-serial example, that transfers small packets of sensor data, ~10 packets/s, from a USB dongle (nrf52840-mdk) to the host computer via the vendor endpoint. Just like in the example, I simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) via controlTransfer() to ask the device to start/stop transmitting data to the host.
Possible problem. IF the following happens (host side):
I stop an ongoing data transfer ('request': 0x22, 'value': 0x00), release the interface, and close it. I wait for several seconds up to minutes.
I re-open the same interface, claim it, ask the device to start data transfer with a request 0x22 with value 0x01
THEN on many occasions the interface spits out packets that were transmitted by the USB dongle before 1) happened, i.e., across closing and re-opening the interface. They don't appear to be packets left in TinyUSB's ring buffer for the device class (I've tried modifying the TinyUSB code to clear that buffer), so I wonder whether this is a TinyUSB issue, an issue with the USB driver of the host computer (OSX), or something else entirely.
Note 1: tud_vendor_write_available() is used to make sure the device can actually send data.
Note 2: this does not happen if 1)and 2) are done on a CDC-ACM endpoint.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote an application loosely based on the webusb-serial example, that transfers small packets of sensor data, ~10 packets/s, from a USB dongle (nrf52840-mdk) to the host computer via the vendor endpoint. Just like in the example, I simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) via controlTransfer() to ask the device to start/stop transmitting data to the host.
Possible problem. IF the following happens (host side):
THEN on many occasions the interface spits out packets that were transmitted by the USB dongle before 1) happened, i.e., across closing and re-opening the interface. They don't appear to be packets left in TinyUSB's ring buffer for the device class (I've tried modifying the TinyUSB code to clear that buffer), so I wonder whether this is a TinyUSB issue, an issue with the USB driver of the host computer (OSX), or something else entirely.
Note 1: tud_vendor_write_available() is used to make sure the device can actually send data.
Note 2: this does not happen if 1)and 2) are done on a CDC-ACM endpoint.
Thanks in advance for any insights on this.
Beta Was this translation helpful? Give feedback.
All reactions