Can XON and XOFF be equal?

Can an application use the same char in XON and XOFF? If so, how should my device driver handle this situation.

0


a source to share


3 answers


XON and XOFF are two different ASCII characters, so they cannot be equal.



However, using a switch for XON / XOFF flow control is a bad idea because characters can get lost. I also don't see any advantage over using two characters.

+3


a source


If your driver is solely responsible for handling xon / xoff and the xon / xoff flag characters may be identical, then I would say that for your xon / xoff state, you need to have a small state machine (flag) driver, and only look for xon. when xoff has already been seen.



If you have hardware support for xon / xoff, then you will need to find out if this state is supported by the hardware and return appropriate errors if not.

+2


a source


While it may be allowed, I have never seen it. I would think this is a recipe for disaster if both sides don't sync their state machines with the discarded byte.

+2


a source







All Articles