|
|
|
|
|
- Using an external library: RXTX
- Features specific to Android and Android widget
sParameter (Function) In french: sFixeParamètre Defines or modifies the parameters for configuring the specified serial port, parallel port or infrared port. This setting is optional. The default values are as follows: - Transfer rate: 9600 Bauds
- Parity: None
- 8 data bits
- 1 stop bit
Caution: The parameters of two linked stations must be identical. Remarks: - The port must be opened (sOpen) before the call to sParameter. sOpen automatically initializes the serial port.
   Infrared ports are not supported. This function returns information regarding the server.   Only serial ports are supported.
PortNum = sOpen("COM1", 2000, 2000)
IF PortNum <> 0 THEN
IF sParameter(PortNum, 9600, 1, 8, 0) THEN
ELSE
Error("COM1 configuration error", ErrorInfo(errFullDetails))
END
sClose(PortNum)
ELSE
Error("Error opening COM1", ErrorInfo(errFullDetails))
END
Syntax
<Result> = sParameter(<Port number> , <Rate> , <Parity> , <Nb Data Bits> , <Nb Stop Bits> [, <DTR/DSR> [, <RTS/CTS> [, <XON/XOFF>]]])
<Result>: Boolean - True if the parameters have been initialized properly,
- False otherwise. HErrorInfo returns more details.
Note: If the port has not been previously opened (by function sOpen), function sParameter has no effect..
<Port number>: Integer Identifier of the port used: - Port number:
- Serial port number: 1, 2, 3, ... 32 for COM1, COM2, COM3, ... COM32.
- Parallel port number: -1, -2, -3 or -4 for LPT1, LPT2, LPT3 or LPT4.
- Infrared port number: 1, 2, 3, ... 32 for IR1, IR2, IR3, ... IR32.
- Port identifier returned by sOpen (if this function was called with a port name).
  Only this type of parameter is available.
<Rate>: Integer Rate for data transfer (expressed in Bauds or Bits per second). <Parity>: Integer Parity of the transfer:
| | 0 | No parity | 1 | Even parity | 2 | Odd parity |
<Nb Data Bits>: Integer Number of bits per character: 4, 5, 6, 7 or 8. <Nb Stop Bits>: Integer Number of stop bits:
| | 0 | 1 stop bit | 1 | 1.5 stop bits | 2 | 2 stop bits |
New in version 2025 <DTR/DSR>: Optional integer - 0 (or False, default value) if the DTR/DSR protocol must be ignored and if it should be in "active" mode.
- 1 (or True) if the DTR/DSR protocol must be in "Handshake" mode,
- 2 if the DTR/DSR protocol must be ignored and if it should be in "inactive" mode.
For more details, see the documentation for managing communication ports.
<RTS/CTS>: Optional integer - 0 (or False, default value) if the RTS/CTS protocol must be ignored and if it should be in "active" mode.
- 1 (or True) if the RTS/CTS protocol must be in "Handshake" mode,
- 2 if the RTS/CTS protocol must be ignored and if it should be in "inactive" mode.
For more details, see the documentation for managing communication ports.
<XON/XOFF>: Optional boolean - True if the XON/XOFF protocol must be taken into account,
- False (default value) if this protocol must be ignored.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|