hi,
still i am having problem. i did my code following way, and also i am using fwrite(data, 1, 1, ser_device); function to out character through uart.
ser_device = fopen(SERIAL_DEVICE, "w");
fwrite(data, 1, 1, ser_device); function to out character through uart.
fclose(ser_device);
/* Install and open dummy drivers for stdin, stdou and stderr. */
res = _nio_dev_install("dummy:",&nio_dummy_dev_fn, (NULL));
assert(NULL != res);
fd = open("dummy:", 0); // 0 - stdin
assert(fd == 0);
fd = open("dummy:", 0); // 1 - stdout
assert(fd == 1);
fd = open("dummy:", 0); // 2 - stderr
assert(fd == 2);
/* Instal and set tty driver */
res = _nio_dev_install("tty:", &nio_tty_dev_fn, (void*)&(NIO_TTY_INIT_DATA_STRUCT){BSP_DEFAULT_IO_CHANNEL, 0});
assert(NULL != res);
close(0);
fd = open("tty:",NIO_TTY_FLAGS_ECHO); // 0 - stdin
assert(fd == 0);
close(1);
fd = open("tty:",NIO_TTY_FLAGS_ECHO); // 1 - stdout
assert(fd == 1);
close(2);
fd = open("tty:",NIO_TTY_FLAGS_ECHO); // 2 - stderr
assert(fd == 2);
AND ALSO I TRIED:
close(0);
fd = open("tty:",0); // 0 - stdin
assert(fd == 0);
close(1);
fd = open("tty:",0); // 1 - stdout
assert(fd == 1);
close(2);
fd = open("tty:",0); // 2 - stderr
assert(fd == 2);
but still its outing carriage return character. this implementation i am doing in ethernet_to_serial example. give some idea.
regards,
sudhakar p