I code a program which two computer communicate each other with serial port in cross platform but my program dont run cross platform but run linux to linux or windows to windows . I think my serial port settings arent the same.My settings:

WINDOWS:
DCB properties;
GetCommState(serialPort, &properties);

properties.Parity = NOPARITY;
properties.BaudRate=9600;
properties.ByteSize = 8;
properties.StopBits = ONESTOPBIT;

SetCommState(serialPort, &properties);

LINUX:

struct termios properties;

tcgetattr(serialPort, &properties);

properties.c_cflag = CS8|CREAD|B9600|CLOCAL;
properties.c_iflag = IGNBRK;
properties.c_oflag = 0;
properties.c_lflag = 0;
properties.c_cc[VMIN] = 1;
properties.c_cc[VTIME]= 0;

tcsetattr(serialPort, TCSANOW, &properties);

I'm certainly no expert, but I believe the serial I/O is setup with a tty device , then an emulation is setup in termcap. There is a command line program to do this, but I don't remember what it is.

The serial device gets associated with serial port, the device is associated with the emulation and a login profile is created.
You can tinker with the selected termcap for various effects and the login profile will determine the level of security, plus shell scripts to be run at login.
I don't think you can do much with Linux without a login shell!

Sorry to ramble, but i think that's roughly the area you need to be looking at...

commented: Nice ~~ SpS +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.