я открываю файл
| Код | int serial_open( char* FileName , int Speed) { int fd; fd = open(FileName, O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) { return -1; } termios options = {0}; options.c_cflag = CSTOPB * 0 | B9600 | CRTSCTS| CS8 | CLOCAL | CREAD; tcflush(fd, TCIFLUSH); if ( tcsetattr(fd, TCSANOW, &options) != 0) { close(fd); return -1; } return fd;
} ... // и пишу int serial_write(int fd, void *buf, int nbytes) { int dwBytesSent; dwBytesSent = write(fd, buf, nbytes); if (dwBytesSent < 0) { return -1; } return dwBytesSent; }
|
Данный пишутся в файл но не отправляются может что не так сделал? Чтение проходит на ура |