Configures the local PC's serial port timeout parameters (For Serial Connections Only).
- Parameters
-
| [in] | handle | Valid handle returned by SM_Open(). |
| [in] | multiple | |
| [in] | constant | |
| [in] | interval | |
- Return values
-
| 0 | Successful. |
| -1 | Invalid SeaMAX handle. |
| -2 | Connection not established. |
| -3 | Current connection is non-serial. |
| -4 | Could not configure serial timeouts. Possible invalid parameter. |
This function configures the PC's local serial port connection timeouts.
multiple: The multiple parameter is used to calculate the total timeout for a read or write operation. For instance, if a serial operations requires sending 10 bytes and the multiple parameter provided is 15 (ms), the total timeout for that read or write will be 150 ms. A zero (0) indicates the multiple timeout should not be used.
constant: A constant may be added to the total timeout for read or write operations. For instance, in the multiple example above, a constant parameter of 200 would cause the total timeout to be 150 ms + 200 = 350 ms. A zero (0) indicates the constant timeout should not be used.
interval: An interval timeout can be used to timeout if the time between incoming characters exceeds the interval parameter (ms). For instance, an interval parameter of 10 would cause a timeout if the incoming characters have more than 10 ms delay between them. A zero (0) indicates the interval timeout should not be used.
- Note
- The
interval parameter does not take effect until the first character is received. It is often prudent to provide a large constant timeout (e.g., 10000) as well to ensure that serial operations will return provided no data returns from a serial read.
Referenced by SM_Open().