Beispiel #1
0
        /// <summary>
        /// Get the status of the queues
        /// </summary>
        /// <returns>Queue status object</returns>
        protected QueueStatus GetQueueStatus()
        {
            COMSTAT  cs;
            COMMPROP cp;
            uint     er;

            CheckOnline();
            if (!Win32Com.ClearCommError(_hPort, out er, out cs))
            {
                ThrowException("Unexpected failure");
            }
            if (!Win32Com.GetCommProperties(_hPort, out cp))
            {
                ThrowException("Unexpected failure");
            }
            return(new QueueStatus(cs.Flags, cs.cbInQue, cs.cbOutQue, cp.dwCurrentRxQueue, cp.dwCurrentTxQueue));
        }