Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>com_smode()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 COM_SMODE()
 Determines the current status of a background transmission
------------------------------------------------------------------------------
 Syntax

     COM_SMODE(<nComPort>) --> nSendMode

 Argument

     <nComPort>  Designates the port (1 to 4) for which the background
     transmission status is returned.

 Returns

     COM_SMODE() returns a number for which the bits represent various
     meanings shown in the table below.

 Description

     The ability to transmit in the background demands the ability to control
     the sending buffer.  For example, COM_SMODE() allows you to check to see
     if the sending buffer is waiting for an XON character when the software
     handshake is enabled.  The bits in the returned value represent the
     different modes:

     Table 3-7: Coding the Sending Mode
     ------------------------------------------------------------------------
     Bit  Symb. Const.   Definition
     ------------------------------------------------------------------------
     1    SMODE_EMPTY    Sending buffer empty
     2    SMODE_SOFT     Wait for software handshake release(XON)
     4    SMODE_HARD     Wait for hardware handshake release(CTS)
     8    SMODE_RFLUSH   Deleted from remote station
     ------------------------------------------------------------------------

 Note

     .  If no sending buffer has been set up for the designated port
        using COM_OPEN(), the function returns a value of 0.

 Examples

     .  Determine whether the port 2 sending buffer is empty:

        IF ISBIT(COM_SMODE(2), 1)
           ? "Port 2 sending buffer empty!"
        ENDIF

     .  Wait 20 seconds while the send buffer for port 2 is waiting
        for an XON, then release:

        WAITPERIOD(2000)

        DO WHILE ISBIT(COM_SMODE(2), 2) .AND. WAITPERIOD()
           *...
        ENDDO

     .  Clear the send buffer when XON is not received:

        IF ISBIT(COM_SMODE(2), 2)
           COM_SFLUSH(2)            // Clear send buffer port 2
        ENDIF


See Also: COM_HARD() COM_SOFT() COM_REMOTE() COM_SFLUSH()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson