Hi guys,
I'm trying to connect to a CISCO router using termios. I have some small problems. When I press the enter key, I get double prompts. Here is what I've done:
And I have two threads, one for reading user input and the other one for writing and reading the port. I expect this output:
But what I get is:
And this happens all the times except for the first time. Am I missing something?
Thanks.
I'm trying to connect to a CISCO router using termios. I have some small problems. When I press the enter key, I get double prompts. Here is what I've done:
Code:
struct termios dev;
int fd = 0;
fcntl(fd, F_SETFL, FNDELAY);
tcgetattr(fd, &dev);
dev.c_lflag &= ~(ICANON | ISIG | ECHO);
dev.c_iflag &= ~(ICRNL);
tcsetattr(fd, TCSANOW, &dev);
And I have two threads, one for reading user input and the other one for writing and reading the port. I expect this output:
Code:
Router>
But what I get is:
Code:
Router>
Router>
And this happens all the times except for the first time. Am I missing something?
Thanks.