Hi,
please I want to read from serial port, I can write but not read, here is my program.* thanks for
help
regards
bela
#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>
int main(){
* int fd, n; char rr[10];
* fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
* n = write(fd, "ATZ
", 4);
* if (n < 0)*** puts("write() of 4 bytes failed!
");
* else******** puts("4 bytes success!
");
* //* fcntl(fd, F_SETFL, 0);
* //* with the previous it waits ...* for ever
* //* with next no thing read : fails***
*** fcntl(fd, F_SETFL, FNDELAY);
* n = read(fd, rr,2 );