tud_cdc_connected() or tud_cdc_line_state_cb() problem when unplug USB connector #1185
Unanswered
mastupristi
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi,
I'm using tinyUsb 0.12.0, on i.MX RT1051.
I'm successfully using the
tud_cdc_line_state_cb()callback to be notified when on the PC I connect/disconnect to the ttyACM0 (on PC I useminicom).The scenario is: with the usb cable plugged in I run minicom and the
tud_cdc_line_state_cb()is called withdtr=1. In the moment I quit minicom thetud_cdc_line_state_cb()is called withdtr=0.The problem arises if, with minicom running, i unplug the usb cable. In that case the
tud_cdc_line_state_cb()is not called. But when I plug the cable back in it is called again withdtr=1.This makes it difficult if not impossible to code state machines take into account the connection state.
Is this behavior intentional? How can I be notified of the cable disconnection?
best regards
Max
Beta Was this translation helpful? Give feedback.
All reactions