I need to write a small program which collects (20-36 string) data from several com (serial ports) and sends them out on one. For example com2,3,4 to com1.
It should be on Windows Xp workstation. (It is possible that I will do it later on linux, it seems to me simpler to use /dev/ttyS0, but my boss prefers MS)
I find several several examples where I can define my own classes, header files for opening serial port.
I tried the attached one. It defines a CSerialPort class for functions to open and read from serial port.
There is also a header file cserial.h. (attachements)
There is a note:
I am using DllImport to import the kernel32.dll for this header file.
I tried to use the attached cserial.h header file. But I get several errors while compile:
expected constructor destructor before class
expected , or ; before class
... more in serial.jpg attached
Maybe I am trying to use those source codes totally the wrong way, sorry if so.
Any suggestion that can align me in to the right direction will help.
If somebody knows better example codes for serial programming (for WinXp, DevC++), please post it for me.