-
#include
-
#include
-
#include
-
#include
-
#include
-
-
-
int main(int argc,char* argv[])
-
{
-
-
char buf[10];
-
char lu;
-
struct termios tt_avant, tt_apres;
-
-
//recuperation d errread(0,buf,10);eurs et recuperation du bloc de controle standard dans tt_avant
-
if(tcgetattr(0, &tt_avant)==-1)
-
{perror("tcgetattr"); exit(1);}
-
-
tt_apres=tt_avant;
-
tt_apres.c_iflag &= ~(IXON|IXOFF);
-
tt_apres.c_lflag &= ~(ICANON|ECHO);
-
tt_apres.c_cc[VMIN]=1;
-
-
//int tcsetattr(int fd, int optional_actions, struct termios *termios_p);
-
-
if(tcsetattr(0,TCSANOW, &tt_apres)==-1)
-
{perror("tcsetattr"); exit(1);}
-
-
do
-
{
-
read(0,buf,10);
-
lu=buf;
-
printf("%d caractere lu= %c\n",strlen(buf),lu);
-
fflush(&buf);
-
}
-
while (lu!='F');
-
-
if(tcsetattr(0,TCSANOW, &tt_avant)==-1)
-
{perror("tcsetattr"); exit(1);}
-
-
return 0;
-
-
}
Posted by bluez Wed 28th Feb 2007 17:39 - Syntax is None/text - 88 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Description:
sr02 en force
sr02 en force
PermaLink to this entry https://pastebin.co.uk/11171
Posted by bluez Wed 28th Feb 2007 17:39 - Syntax is None/text - 88 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0