![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Registered User Join Date: Feb 2009
Posts: 3
| I have installed a board that has two ports and have verified they are working by using the terminal: dmesg | grep tty console [tty0] enabled 0000:02:00.0: ttyS0 at I/O 0xdf00 (irq = 21) is a 16550A 0000:02:00.0: ttyS1 at I/O 0xde00 (irq = 21) is a 16550A Code: Code: int open_port(void)
{
int fd; /* File descriptor for the port */
fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
{
/*
* Could not open the port.
*/
perror("open_port: Unable to open /dev/ttyS0 - ");
}
else
fcntl(fd, F_SETFL, 0);
return (fd);
}
open_port: Unable to open /dev/ttyS0 -: Permission denied return code -1 Thank you Greg |
| morty346 is offline | |
| | #2 |
| Registered User Join Date: Feb 2009
Posts: 3
| Solved! chmod o+rw /dev/ttyS0 chmod o+rw /dev/ttyS1 Thank you anyways! Greg |
| morty346 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| serial port to poll on request | infineonintern | C++ Programming | 2 | 06-11-2009 06:52 AM |
| Access is denied when listen on a port | George2 | C# Programming | 1 | 05-29-2008 09:01 AM |
| Can't Read From Serial Port | HalNineThousand | Linux Programming | 14 | 03-20-2008 05:56 PM |
| DOS, Serial, and Touch Screen | jon_nc17 | A Brief History of Cprogramming.com | 0 | 01-08-2003 04:59 PM |
| VC++/NT serial port access | danhar707 | Windows Programming | 1 | 11-21-2002 12:28 PM |