Page 1 of 1

disable XON XOFF termios howto?

Posted: Sat May 02, 2015 9:08 am
by peepo
by default software flow control is enabled, how to disable?

minicom -b 9600 -o -D /dev/ttyAMA0 rtscts
wfm

but using termios this does not:

struct termios options;
tcgetattr(fd, &options);
options.c_iflag &= ~(IXON|IXOFF|IXANY);
cfsetispeed(&options, B9600);
cfsetospeed(&options, B9600);
tcsetattr(fd, TCSAFLUSH, &options);

I tried various combinations without success

thanks

Jonathan

Re: disable XON XOFF termios howto?

Posted: Sat May 02, 2015 9:25 am
by PeterO
Have you tried setting "raw mode" ?

This is the code I normally use to configure a dumb serial port...

Code: Select all

  serial_fd = open("/dev/ttyAMA0",O_RDWR);


  tcgetattr(serial_fd,&newtio);
  cfsetospeed(&newtio,B57600);
  newtio.c_cc[VMIN] = 0;
  newtio.c_cc[VTIME] = 0;
  cfmakeraw(&newtio);
  newtio.c_cflag &= ~CRTSCTS;
  tcsetattr(serial_fd,TCSANOW,&newtio);

PeterO

Re: disable XON XOFF termios howto?

Posted: Sat May 02, 2015 11:33 am
by peepo
how do I undo cfmakeraw?

seems far too strong** and did not achieve what was wanted:
ie equivalent to: minicom -b 9600 -o -D /dev/ttyAMA0 rtscts

cheers

~:"

**ie after reboot minicom is no longer typing characters...

Re: disable XON XOFF termios howto?

Posted: Sat May 02, 2015 12:58 pm
by PeterO
peepo wrote:how do I undo cfmakeraw?
There is nothing to "undo", termios settings only apply to the device while it is open.

seems far too strong** and did not achieve what was wanted:
ie equivalent to: minicom -b 9600 -o -D /dev/ttyAMA0 rtscts
As far as I can see "rtscts" is not a valid option to minicom so I don't know what you are trying to achieve. Plus PI doesn't have any hardware handshake lines anyway (AFAIK).
**ie after reboot minicom is no longer typing characters...
Where are you putting your code that changes the terminal settings ?
PerterO



man



cheers

~:"