Andrey Fanyagin
01/09/2011 11:23 AM
post81653
|
Hello, I cant open serial port.
Code:
#include <stdio.h> /* Standard input/output definitions */
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include <fcntl.h> /* File control definitions */
#include <errno.h> /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */
int main(int argc, char *argv[])
{
int fd; /* File descriptor for the port */
fd = open("/dev/ser1", O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
{
perror("open_port: Unable to open /dev/ser1 - ");
}
close(fd);
return 0;
}
return: open_port: Unable to open /dev/ser1 - : Not enough memory
Please help :(
|
|
|