| | |
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 |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking highest homework i/o inches include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft mqqueue mysql number odf open owf pattern pdf performance pointer posix power probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming socketprogramming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h





