setting port in linux and windows

Reply

Join Date: Dec 2006
Posts: 1
Reputation: fatihbilmuh is an unknown quantity at this point 
Solved Threads: 0
fatihbilmuh fatihbilmuh is offline Offline
Newbie Poster

setting port in linux and windows

 
0
  #1
Dec 19th, 2006
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);
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 222
Reputation: JRM will become famous soon enough JRM will become famous soon enough 
Solved Threads: 14
JRM's Avatar
JRM JRM is offline Offline
Posting Whiz in Training

Re: setting port in linux and windows

 
1
  #2
Dec 23rd, 2006
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...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC