| | |
setting port in linux and windows
![]() |
•
•
Join Date: Dec 2006
Posts: 1
Reputation:
Solved Threads: 0
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);
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...
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...
![]() |
Similar Threads
- How to remove Linux and install Windows XP? (IT Professionals' Lounge)
- installing linux over troubled windows (*nix Software)
- Linux vs. Microsoft Windows (IT Professionals' Lounge)
- what are steps to uninstall linux and reinstall windows (Windows NT / 2000 / XP)
- Mounting an ext2 Linux Filesystem in Windows XP/NT/2000 (*nix Hardware Configuration)
Other Threads in the C Forum
- Previous Thread: A Few Questions On C
- Next Thread: Finding path in a graph using linked list
| Thread Tools | Search this Thread |
* adobe ansi api array asterisks binarysearch calculate centimeter changingto char character cm convert copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory feet fflush fgets file fork forloop frequency givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hacking highest histogram homework i/o inches infiniteloop input intmain() iso kernel keyboard km linked linkedlist linux linuxsegmentationfault list locate looping loopinsideloop. lowest match microsoft mqqueue mysql number oddnumber odf open opendocumentformat owf pattern pdf performance posix probleminc process program programming radix recv recvblocked repetition research reversing scanf scheduling segmentationfault send sequential socket socketprograming stack standard string systemcall threads turboc unix user variable voidmain() wab whythiscodecausesegmentationfault windows.h windowsapi





