I work with Serial ports all the time and have come quite adept to it, but in my language of choice (PowerBasic) as well as others they all seem to have functions for checking just the Transmit buffer or the Receive buffer but do not really elude to how they gather this information.
Over the years I have developed some code that using Windows Api that I can do some things that may be found as extreme but seemed to work. One thing I have never been able to do (and all my research points to posts that I have done) is to get a handle or a pointer or whatever to the TX and RX buffers separately
In Windows API for example you can WriteFile or ReadFile but the handle passed is the handle to the port itself, so if I want to check a particular buffer then I give it the port and something "Magical" gives me the response.
My question is, if I have the handle to the port.....how do I check for info of just the RX buffer? (Size, chars waiting, etc)
My gut says its possible....but not many people have done it, so I thought I would ask somewhere that language was independent?