C API for BALTECH SDK

§ brp_create_rs232()

BRP_LIB brp_protocol brp_create_rs232 ( char *  dev_name,
unsigned  baudrate,
char  parity 
)

Creates a protocol object for RS232/CDC interfaces from the device name.

Please note that the device name is operating system dependend:

  • Windows: It is a consecutively numbered filename starting with \\.\COM1 (or alternatively COM1).
  • Linux: It is a consecutively numbered filename starting either with /dev/ttyS0 (in case the reader is connected to the build-in RS232 interface of the PC) or /dev/ttyACM0 (in case the reader is connected via USB/CDC). The short filename is like ttyS0/ttyACM0.
  • macOS: only USB/CDC is supported. the device name is like /dev/tty.usbmodem12345678, where the last 8 digits correspond to the readers serialnumber. The short filename is like tty.usbmodem12345678
Parameters
dev_namethe full (or short) device name of the serial interface.
baudratei.e. 9600 or 115200
parityhas to be 'N', 'E' or 'O'
Returns
a protocol, that can be used for sessions or NULL, if out of memory.