C API for BALTECH SDK

§ brp_Sys_SetCommParam()

brp_errcode brp_Sys_SetCommParam ( brp_protocol  protocol,
brp_Baudrate  NewBaudrate,
brp_Parity  NewParity,
unsigned  CWT 
)

This command is only required when the serial host-to-reader interface is in use. In case the protocol is running, this command can be used to change the settings of the serial line:

  • Baud rate
  • Parity
  • Character Waiting Time (CWT)

Usually the reader uses the settings specified in the configuration of the reader under the Protocols/BrpSerial Key. If the corresponding configuration values do not exist, the default settings are used (Baud rate 115200; no parity; CWT 20 ms).

The BRP response frame to this command is received according to the old serial settings. The new serial settings are only in effect starting with the next BRP command frame.

The parameters set by this command are lost when the reader is powered off or reset.

CWT must never be smaller than the time needed for transferring a single byte. This is especially important when using baud rates smaller than 9600. It is good practice to adapt the CWT according to the following equation: CWT = 10 / baud rate + 10.

Parameters
[in]protocolused to execute the command
[in]NewBaudrate1/100 of the baud rate to set The Baudrate specifies the performance of an UART based interface in bits per second. For the old-style 8bit format, which omits the least significant digit, this format is not supported any more. Configurations using this format cannot be opened.
[in]NewParity'N' for no parity, 'E' for even parity and 'O' for odd parity Specifies the Parity-bit mode which is used for UART protocols.
[in]CWTCharacter Waiting Time: maximum time to wait between two characters in a frame.