Menu

#2 Blocking mode with timeout patch

open
nobody
None
5
2010-08-10
2010-08-10
Alessandro
No

It seems that the blocking mode with timeout it's not working.

old code (cssl.c):

void cssl_settimeout(cssl_t *serial, int timeout) {
[...]
serial->tio.c_cc[VTIME]=timeout;
tcsetattr(serial->fd,TCSANOW,&(serial->tio));
[...]
}

new code:

void cssl_settimeout(cssl_t *serial, int timeout) {
[...]
serial->tio.c_cc[VTIME]=timeout;
serial->tio.c_cc[VMIN]= timeout>0?0:1;
tcsetattr(serial->fd,TCSANOW,&(serial->tio));
[...]
}

happy coding!

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.