Opening ttyS0
Hi All,
I am trying to open the /dev/ttyS0 port and it is not returning from "open" system call. The program is as follows ... #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main () { int fd; fd = open("/dev/ttyS0", O_WRONLY|O_NOCTTY); // Never returns from here if (fd < 0) { perror ("Error\n"); return -1; } printf ("Success"); close(fd); return 0; } In the above program, it never returns from the "open" What may be the reason? Please help me in this regard. Thanks Somesh SS |
what distro are u using?
|
maybe something silly
Are the permissions low enough on /dev/ttyS0?
|
Yes, Permissions are OK.
But I think I got it solved! I just loaded serial.o driver and it returned success! Thanks! |
Can any one explain me why it was hanging and now when serial,o is loaded, why it works?
Regards |
Because you need a driver for the serial port
to be able to use it... Cheers, Tink |
All times are GMT -5. The time now is 11:12 AM. |