Function Com_ReadMode() Foundation

Controls the Read Timeout processing characteristics of the device driver.

Syntax
Com_ReadMode( <nComPortNum>, ;
              <nMode>      , ;
              [<nTimeout>]   ;  // Default: 100
            ) --> lSuccess
Return

Returns .T. if mode can be set successfully or .F. otherwise.

Description

Com_ReadMode() controls the Read Timeout processing characteristics of the physical device driver (PDD).

Three modes can be specified with <nMode> using #define constants from XBTCOM.CH:

- NO_WAIT_READ_TIMEOUT

Read requests will return immediately with any available data.

<nTimeOut> will be ignored.

- READ_TIMEOUT

Read request is completed after the timeout interval specified with <nTimeout> elapses if no more data has been received for the request. If any data is received by the PDD from the hardware, it waits the specified period of time for more data to arrive.

<nTimeOut> - timeout value in .01 second units (0 = .01 seconds!)

- WAIT_READ_TIMEOUT

If any data is available the read request returns immediately with that data. If no data is available read requests are processed like in Normal Read Timeout mode (nMode == READ_TIMEOUT).

<nTimeOut> - timeout value in .01 second units (0 = .01 seconds!)

Default mode set when calling Com_Open() the first time for a COM port: NO_WAIT_READ_TIMEOUT

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.